#define QMPLUGIN_API extern "C" __declspec(dllexport)
typedef int (*QMPLUGIN_HANDLER)(char *lpszParamList, char *lpszRetVal);
typedef struct {
char *m_lpszCommandName;
char *m_lpszCommandDescription;
QMPLUGIN_HANDLER m_pHandlerFunction;
UINT m_nParamNumber;
} QMPLUGIN_CMD_INFO;
typedef QMPLUGIN_CMD_INFO* (*CommandFunc)(int iCommandNum); HINSTANCE thDll;
thDll = LoadLibrary("xxxxxplugin.dll"); if (thDll != NULL)
{
CommandFunc someFunc = (CommandFunc)GetProcAddress(thDll, "GetCommand");
if (someFunc != NULL)
{
QMPLUGIN_CMD_INFO* abc = someFunc(0);
printf("the function description is %s\n", abc->m_lpszCommandDescription);
}else
{
printf("Load Function Error\n");
} FreeLibrary(thDll);
}else{
printf("Load DLL Error\n");
}
typedef int (*QMPLUGIN_HANDLER)(char *lpszParamList, char *lpszRetVal);
typedef struct {
char *m_lpszCommandName;
char *m_lpszCommandDescription;
QMPLUGIN_HANDLER m_pHandlerFunction;
UINT m_nParamNumber;
} QMPLUGIN_CMD_INFO;
typedef QMPLUGIN_CMD_INFO* (*CommandFunc)(int iCommandNum); HINSTANCE thDll;
thDll = LoadLibrary("xxxxxplugin.dll"); if (thDll != NULL)
{
CommandFunc someFunc = (CommandFunc)GetProcAddress(thDll, "GetCommand");
if (someFunc != NULL)
{
QMPLUGIN_CMD_INFO* abc = someFunc(0);
printf("the function description is %s\n", abc->m_lpszCommandDescription);
}else
{
printf("Load Function Error\n");
} FreeLibrary(thDll);
}else{
printf("Load DLL Error\n");
}
解决方案 »
- 求助WEBBROWSER.NAVIGATE时,IE6.0和8.0都可以打开,但是7.0提示找不到网站
- 求一个32位CRC校验的算法
- quickreport 打印无法分页 使用newpage有错(illegal call to newpage)无法使用
- PDF控件
- 急,菜鸟求助~~怎么实现和access数据库联接并显示,
- 請問﹕哪有InstallShieldExpress軟件下載﹖最好是沒有時間限制的﹗
- 帮忙看看这样的指针用法是什么意思?
- 帮忙分析一个break引起的异常
- delphi7 转 delphi2010 StrLCopy 函数报错,如何转换?
- 有谁知道这是什么主板?(高分赠送)
- RS232 串口通讯
- 哪位大侠帮个忙,SPCOMM收不到字符。
type
QMPLUGIN_CMD_INFO = record
m_lpszCommandName, m_lpszCommandDescription: Pchar;
m_pHandlerFunction: QMPLUGIN_HANDLER;
m_nParamNumber: UINT;
end;
PQMPLUGIN_CMD_INFO = ^QMPLUGIN_CMD_INFO; QMPLUGIN_HANDLER = function(lpszParamList, lpszRetVal: pchar): integer;
QMPLUGIN_CMD_INFO = function(iCommandNum: integer): PQMPLUGIN_CMD_INFO; var
thDll: HINST;
someFunc: CommandFunc;
abc: PQMPLUGIN_CMD_INFO;
begin
thDll := LoadLibrary('xxxxxplugin.dll'); if thDll <> 0 then
begin
someFunc := GetProcAddress(thDll, 'GetCommand');
if @someFunc <> nil then
begin
abc := someFunc(0)
end end;
FreeLibrary(thDll);