MFC+opencv,使用cvLoadImage方法,参数要求为const char *类型
图片使用edit control控件获取,在edit control控件中添加变量m_imgAddr,为CString类型
将m_imgAddr赋给cvLoadImage方法需要强转,使用以下语句强转:
首先对工程属性中——常规——字符集,选使用多字节字符集。
char *c = (LPSTR)(LPCSTR)m_imgAddr;
该方法通过博文http://blog.csdn.net/flydream0/article/details/8543525/习得,并非官方建议,官方建议方法请参考该博文其他方法。