Click here to Skip to main content
15,890,185 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more: , +
VB
ghMDIClientArea = CreateWindow(TEXT("MDICLIENT"), // predefined value for MDI client area
                           NULL, // no caption required
                           WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE,
                           0, // No need to give any x/y or height/width since this client
                              // will just be used to get client windows created, effectively
                              // in the main window we will be seeing the mainframe window client area itself.
                           0,
                           0,
                           0,
                           hwnd,
                           NULL,
                           ghInstance,
                           (void *) &MDIClientCreateStruct);


getting this error in te code please help asap
error C2440: '=' : cannot convert from 'HWND' to 'HINSTANCE'
Posted
Comments
Sergey Alexandrovich Kryukov 9-Apr-12 12:23pm    
Where is the declaration of ghMDIClientArea?
--SA
amityadav4a 9-Apr-12 12:30pm    
It is global.
Sergey Alexandrovich Kryukov 10-Apr-12 10:49am    
No. Nothing is "global". Where is it? You cannot ask such question without showing this declaration. What's the use?
--SA

1 solution

Please see my comment to the question. It's not nice to ask a question and hide the declaration which caused the problem.

Anyway, you just trying to work with some unrelated types, judging by the name ghMDIClientArea — very unrelated, by some reason which only you can know. Look at the declaration of CreateWindow:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms632679%28v=vs.85%29.aspx[^].

Return type is HWND (window handle), so declare appropriate variable to represent it.

By the way, who needs MDI? This UI style is highly discouraged even by Microsoft. Why torturing yourself and chase out your customers?

—SA
 
Share this answer
 
Comments
Monjurul Habib 10-Apr-12 1:13am    
5!
Sergey Alexandrovich Kryukov 10-Apr-12 10:48am    
Thank you, Monjurul.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900