调用动态链接库dll的问题
typedef bool(__stdcall CHANGE)(char *,char *,BOOL,int);void BmpToJpgDlg()
{
HINSTANCE hInst = ::LoadLibrary( L"JpgVSbmp.dll ");
if( hInst == NULL )
{
return;
}
CHANGE* pFunc = (CHANGE *)::GetProcAddress(hInst, "BmpToJpg ");
CString strBMP=_T("C:\\tmp.bmp"),strJPG=_T("C:\\tmp.jpg");
pFunc(strBMP.GetBuffer(50),strJPG.GetBuffer(50),TRUE,75);
strBMP.ReleaseBuffer();
strJPG.ReleaseBuffer();
::FreeLibrary(hInst);
}
这是我所要调用的函数定义
C++定义为:BOOL BmpToJpg(LPCSTR lpBmpFileNameForIn, LPCSTR lpJpgFileNameForOut,BOOL bColor, int nQuality)
PB声明:Function Boolean BmpToJpg(string lpBmpFileNameForIn,string lpJpgFileNameForOut,Boolean bColor, int nQuality) LIBRARY "jpgvsbmp.dll"
这样会pFunc的参数会报错,求大侠告诉我该怎样传参数进去?多谢多谢