惟独ActiveX控件的dll库文件,VC++能调用它导出的方法吗
只有ActiveX控件的dll库文件,VC++能调用它导出的方法吗
如题,比如ActiveX文件名是A.dll,现在只有这个文件,但我知道它导出的方法名称,比如
int Startup();
int Cleanup();
......
我能在测试程序中调用Startup和Cleanup吗?
最好能给个例子,多谢!
------解决方案--------------------
例子:调用USER32.dll中的SetLayeredWindowAttributes函数
如题,比如ActiveX文件名是A.dll,现在只有这个文件,但我知道它导出的方法名称,比如
int Startup();
int Cleanup();
......
我能在测试程序中调用Startup和Cleanup吗?
最好能给个例子,多谢!
------解决方案--------------------
例子:调用USER32.dll中的SetLayeredWindowAttributes函数
typedef BOOL (WINAPI* lpfnSetTransparent)(HWND hWnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags);
HMODULE hUserDll = ::LoadLibrary(_T("USER32.dll"));
if ( hUserDll )
{
lpfnSetTransparent pFnSetTransparent = NULL;
pFnSetTransparent = (lpfnSetTransparent)GetProcAddress(hUserDll, "SetLayeredWindowAttributes");
if (pFnSetTransparent )
bRet = pFnSetTransparent(/*自定义4个参数*/);
}