LoadMenu 与 MAKEINTRESOURCE
LoadMenu 与 MAKEINTRESOURCE LoadMenu: hInstance, // handle to module LPCTSTR lpMenuName // menu name or resource identifier);
#define MAKEINTRESOURCEW(i) (LPWSTR)((DWORD)((WORD)(i)))
#ifdef UNICODE
#define MAKEINTRESOURCE MAKEINTRESOURCEW
#else
#define MAKEINTRESOURCE MAKEINTRESOURCEA
#endif // !UNICODE
最后一个参数是string,然后,由宏MAKEINTRESOURCE的写法可知,这个宏虽然是将WORD转为了LPSTR(LPWSTR),但实质数据并没有变,所以在vb中,第二个参数用Long其实是一样的,所以应该这样改,
Private Declare Function LoadMenu Lib 'user32.dll' Alias 'LoadMenuA' (ByVal hInstance As Long, ByVal lpString As Long) As Long
Private Declare Function SetMenu Lib 'user32.dll' (ByVal hwnd As Long, ByVal hMenu As Long) As Long
Dim tMenu&
tMenu = LoadMenuVB2(24641, 'SHDOCLC.DLL')
SetMenu Me.hwnd, tMenu
End Sub
Dim hinstSHDOCLC&
Dim hMenu&
hinstSHDOCLC = LoadLibrary(slib)