Strange behavior of AfxGetMainWnd()!!!
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
Hi, I am facing a problem related to window handle. I have loaded two different OCXs in different instances of the same container application(OLE Server). In OnCreate() method of second OCX control I am calling the AfxGetMainWnd()function. It is called after calling the base class function of OnCreate() method. Now trying to run both instances simultaneously. The problem is sometimes AfxGetMainWnd()function returns the pointer to a window of first OCX control which is loaded in the first container instance just before. Why it happens? Thankx in advance. Regards, SUnil