Click here to Skip to main content
15,908,626 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralVERIFY Pin
act_x29-Nov-04 4:17
act_x29-Nov-04 4:17 
GeneralRe: VERIFY Pin
Antony M Kancidrowski29-Nov-04 4:22
Antony M Kancidrowski29-Nov-04 4:22 
GeneralRe: VERIFY Pin
act_x29-Nov-04 4:29
act_x29-Nov-04 4:29 
GeneralRe: VERIFY Pin
Antony M Kancidrowski29-Nov-04 4:41
Antony M Kancidrowski29-Nov-04 4:41 
GeneralRe: VERIFY Pin
David Chamberlain29-Nov-04 8:04
David Chamberlain29-Nov-04 8:04 
Generalfile association in Dialog based application Pin
vyjesh29-Nov-04 1:17
vyjesh29-Nov-04 1:17 
GeneralRe: file association in Dialog based application Pin
Antony M Kancidrowski29-Nov-04 4:32
Antony M Kancidrowski29-Nov-04 4:32 
GeneralRegisterWindowEx Problems... Pin
Anonymous29-Nov-04 0:59
Anonymous29-Nov-04 0:59 
Hello.

When I try to register my windows class using RegisterClassEx in my program I get an error which GetLastError tells me is error 120.

This apparently is:

This function is not supported on this system.

I find this confusing as an identical call in one of the programs in the SDK samples works fine? The only difference between the two is that my project is built using UNICODE. Could this affect the outcome of function calls with identical input?

This is the code:

LRESULT WINAPI MsgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_DESTROY:
PostQuitMessage(0);
return 0;

case WM_PAINT:
case WM_TIMER:
case WM_GRAPHNOTIFY:
case WM_LBUTTONDOWN:
case WM_NEXTSCREEN:
case WM_STARTSCREEN:
HandleEvent(msg, wParam, lParam);
break;

case WM_DISPLAYCHANGE:
break;

case WM_CHAR:
{
if(wParam == VK_ESCAPE)
{
PostMessage(hWnd, WM_CLOSE, 0, 0);
}
else
{
PostMessage(hWnd, WM_NEXTSCREEN, 0, 0);
}
}
break;
}
return DefWindowProc(hWnd, msg, wParam, lParam);
}

HRESULT MakeWindow(HINSTANCE hInstance)
{
WNDCLASSEX wc = {sizeof(WNDCLASSEX),
CS_CLASSDC,
MsgProc,
0L,
GetModuleHandle(NULL),
NULL,
NULL,
NULL,
NULL,
L"Star Chart",
NULL};

RegisterClassEx(&wc);
}

... rest of windows code ...

How can it be that this identical code works fine in one project and not in the other?

Any ideas would be greatly appreciated because I have been at this for 6 hours now with no success...

If anybody needs to see any other code I would be glad to post it for you, I really just don't know what to try now...


edit:

I have now found that it is the GetModuleHandle() call that is producing the error? Can this be right?


Thanks in advance.

Mark Coleman
GeneralRe: RegisterWindowEx Problems... Pin
Anonymous29-Nov-04 5:17
Anonymous29-Nov-04 5:17 
Generalhook for console app Pin
efanHarris29-Nov-04 0:44
efanHarris29-Nov-04 0:44 
GeneralProblems with MS Outlook 2000 when using MAPISendMail Pin
Subramanyam29-Nov-04 0:04
Subramanyam29-Nov-04 0:04 
Questionhow to Convert CString object to BYTE object? Pin
pubududilena29-Nov-04 0:02
pubududilena29-Nov-04 0:02 
AnswerRe: how to Convert CString object to BYTE object? Pin
ThatsAlok29-Nov-04 1:48
ThatsAlok29-Nov-04 1:48 
GeneralOutlook .MSG file structure Pin
mcousins28-Nov-04 21:44
mcousins28-Nov-04 21:44 
GeneralRe: Outlook .MSG file structure Pin
JM Navarro29-Nov-04 4:32
JM Navarro29-Nov-04 4:32 
GeneralCTreeCtrl drag & drop Pin
stevy8228-Nov-04 21:33
stevy8228-Nov-04 21:33 
GeneralRe: CTreeCtrl drag & drop Pin
RS.Ratheesh14-Jan-10 22:49
RS.Ratheesh14-Jan-10 22:49 
Generalget name (or class) of parent dialog Pin
tiziacaia28-Nov-04 19:06
tiziacaia28-Nov-04 19:06 
GeneralRe: get name (or class) of parent dialog Pin
ThatsAlok28-Nov-04 20:30
ThatsAlok28-Nov-04 20:30 
GeneralRe: get name (or class) of parent dialog Pin
tiziacaia29-Nov-04 6:23
tiziacaia29-Nov-04 6:23 
GeneralRe: get name (or class) of parent dialog Pin
Blake Miller29-Nov-04 9:18
Blake Miller29-Nov-04 9:18 
GeneralRe: get name (or class) of parent dialog Pin
toxcct29-Nov-04 9:36
toxcct29-Nov-04 9:36 
GeneralRe: get name (or class) of parent dialog Pin
tiziacaia29-Nov-04 17:50
tiziacaia29-Nov-04 17:50 
GeneralWaitForSingleObject() Problem Pin
lisoft28-Nov-04 18:41
lisoft28-Nov-04 18:41 
GeneralRe: WaitForSingleObject() Problem Pin
Robert Bielik28-Nov-04 20:14
Robert Bielik28-Nov-04 20:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.