Click here to Skip to main content
15,912,329 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I am using TheForgers' Win32 Tutorial as a starting point to the WinAPI... Anyways I broke the source down into modules to make it easier to write:
C
main.c          =    WinMain and Main Window Procedure
MDIChdProc.c    =    MDI Child Proc

I need to share the handle of the Main Window Handle between these two modules but I am not really sure how... Any help would be greatly Appreciated...

The handle I need to share is:
C
HWND g_hMainWindow;
Posted
Updated 26-Mar-11 19:21pm
v2
Comments
pankajupadhyay29 27-Mar-11 1:21am    
Edited to add pre tag.

1 solution

May be we can use normal extern variables.Defining HWND g_hMainWindow=NULL;(NULL value is inialisation value and it will be updated after the main window is created) as global variable in main.c and declaring it as extern HWND g_hMainWindow; in MDIChdProc.h.
 
Share this answer
 
Comments
drkwlf 27-Mar-11 5:27am    
Your a genious I owe you one...

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