LoadLibrary()返回0x10000000,GetLastError()得到0x00000006: ERROR_INVALID_HANDLE, 这是为什

  • 主题发起人 主题发起人 fjhst
  • 开始时间 开始时间
F

fjhst

Unregistered / Unconfirmed
GUEST, unregistred user!
LoadLibrary()返回0x10000000,GetLastError()得到0x00000006: ERROR_INVALID_HANDLE, 这是为什么?(60分)<br />我的代码如下:

LRESULT CALLBACK WndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
/*
...
...
*/
typedef BOOL ( * SetHookFunc)(DWORD);
SetHookFunc pUnInstallMyHook, pInstallMyHook;

switch (iMsg)
{
case WM_CREATE :
SetTimer (hwnd, ID_TIMER, 2000, NULL);
GetMyHandle();

hLibrary = (HINSTANCE)LoadLibrary((LPCTSTR)"MyDll.dll"); //Load DLL in main
/*LoadLibrary()返回0x10000000*/
ErrCode = GetLastError();
/*GetLastError()得到0x00000006: ERROR_INVALID_HANDLE, 这是为什么?*/

pInstallMyHook = (SetHookFunc)GetProcAddress(hLibrary, "InstallMyHook");
(pInstallMyHook)((DWORD)MyHandle);
return 0;
case WM_TIMER :
if(WordIndex&gt;9) WordIndex = 0;
SendKeys(WordList[WordIndex]);
WordIndex = WordIndex+1;
return 0;
case WM_PAINT :
hdc = BeginPaint (hwnd, &amp;ps);
GetClientRect (hwnd, &amp;rc);
hBrush = CreateSolidBrush(fFlipFlop ? RGB(255,0,0) : RGB(0,0,255));
FillRect (hdc, &amp;rc, hBrush);
EndPaint (hwnd, &amp;ps);
DeleteObject (hBrush);
return 0;
case WM_DESTROY :
KillTimer (hwnd, ID_TIMER);
pUnInstallMyHook = (SetHookFunc)GetProcAddress(hLibrary, "UnInstallMyHook");
(pUnInstallMyHook)((DWORD)MyHandle);
FreeLibrary(hLibrary); //Free Library in main
PostQuitMessage (0);
return 0;
}
return DefWindowProc (hwnd, iMsg, wParam, lParam);
}

恳请各位大侠出手相就,谢谢!
 
天哪!我用UltraEdit排得整整齐齐的,怎么一贴上去就成这副得性了?
 
哎!老人家,您又来了,别老UPUP的!帮一把吧!
 
我没有你的dll文件阿
没发试
吧代码发给我把
liuyj@cbn.com.cn
 
请与我联系:BadEgg@163.com
 
多人接受答案了。
 
后退
顶部