Click here to Skip to main content
15,888,521 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to use classes? Pin
Mark Salsbery15-Dec-07 11:36
Mark Salsbery15-Dec-07 11:36 
AnswerRe: How to use classes? Pin
Mark Salsbery15-Dec-07 11:43
Mark Salsbery15-Dec-07 11:43 
GeneralNew program queries Pin
Anthony Appleyard15-Dec-07 2:54
Anthony Appleyard15-Dec-07 2:54 
GeneralRe: New program queries Pin
Hamid_RT15-Dec-07 3:17
Hamid_RT15-Dec-07 3:17 
GeneralRe: New program queries Pin
CPallini15-Dec-07 3:28
mveCPallini15-Dec-07 3:28 
GeneralProblem when using DllMain() function Pin
ashishbhatt15-Dec-07 2:06
ashishbhatt15-Dec-07 2:06 
GeneralRe: Problem when using DllMain() function Pin
Mike Dimmick15-Dec-07 7:53
Mike Dimmick15-Dec-07 7:53 
GeneralRe: Problem when using DllMain() function Pin
ashishbhatt15-Dec-07 17:27
ashishbhatt15-Dec-07 17:27 
Hi,,

Sorry for the very late reply.

Thank you very much for reply.I have read the article as you told and I have solved this problem but now I am facing new problem regarding this topic.

Now I am using below code for the my project purpose using Dllmain().Here I have created one DLL in that I am using this function.In this DLL what happens that this DLL checks for screen update and mouse update on the desktop and sends messsages to my MFC Activex Control (which is another project in the same Solution).

<br />
 // The DLL's main procedure<br />
BOOL WINAPI DllMain (HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)<br />
{<br />
   // Save the instance handle<br />
   hInstance = (HINSTANCE)hInst;<br />
<br />
   // Any code.......<br />
<br />
   return TRUE;<br />
}<br />

And now problem is when I run my Activex from Activex control test Container then whenever this test container is active on top of the desktop then messages(like Scrren update,,Mouse update)are peeked up by Activex control application but when any other window is active then these messages are not peeked by Activex.

Is the problem with this hInstance which get the instance of the window in which My Activex is running???

I ahve tested running my activex in explorer but the same problem exists.

I peeked up these messages from my Activex by below code....
<br />
   MSG msg;<br />
   while(1)<br />
   {<br />
      if(!PeekMessage(&msg,m_desktop->m_hwnd,NULL,NULL,PM_REMOVE))<br />
      {<br />
        if(!m_desktop->CheckUpdate())<br />
           break;<br />
        if (!WaitMessage())<br />
        {<br />
	  AfxMessageBox(CString("WaitMessage Failed"));<br />
	  break;<br />
        }<br />
      }<br />
      else if(msg.message ==  SCREEN_UPDATE)<br />
      {<br />
         // Any code......<br />
      }<br />
      else if(msg.message == MOUSE_UPDATE)<br />
      {<br />
        // Any code.......<br />
      }<br />
      <br />
   }<br />


Please give me any suggetion if you have any idea or ask me if you have any more quetions.

Thanks in Advance.

Ashish Bhatt
GeneralRe: Problem when using DllMain() function Pin
Mark Salsbery15-Dec-07 8:07
Mark Salsbery15-Dec-07 8:07 
GeneralGDI+ How to mask an image with a mask bitmap Pin
followait15-Dec-07 2:00
followait15-Dec-07 2:00 
GeneralRe: GDI+ How to mask an image with a mask bitmap Pin
Mark Salsbery15-Dec-07 8:11
Mark Salsbery15-Dec-07 8:11 
GeneralRe: GDI+ How to mask an image with a mask bitmap Pin
followait15-Dec-07 14:19
followait15-Dec-07 14:19 
GeneralCListCtrl in CDialogBar can't receive WM_CREATE Pin
followait15-Dec-07 1:29
followait15-Dec-07 1:29 
QuestionRe: CListCtrl in CDialogBar can't receive WM_CREATE Pin
CPallini15-Dec-07 1:49
mveCPallini15-Dec-07 1:49 
GeneralRe: CListCtrl in CDialogBar can't receive WM_CREATE Pin
followait15-Dec-07 2:06
followait15-Dec-07 2:06 
QuestionRe: CListCtrl in CDialogBar can't receive WM_CREATE Pin
CPallini15-Dec-07 2:44
mveCPallini15-Dec-07 2:44 
QuestionRe: CListCtrl in CDialogBar can't receive WM_CREATE Pin
Hamid_RT15-Dec-07 3:16
Hamid_RT15-Dec-07 3:16 
GeneralRe: CListCtrl in CDialogBar can't receive WM_CREATE Pin
followait15-Dec-07 14:20
followait15-Dec-07 14:20 
GeneralRe: CListCtrl in CDialogBar can't receive WM_CREATE Pin
Hamid_RT15-Dec-07 18:25
Hamid_RT15-Dec-07 18:25 
GeneralRe: CListCtrl in CDialogBar can't receive WM_CREATE Pin
Jörgen Sigvardsson15-Dec-07 11:04
Jörgen Sigvardsson15-Dec-07 11:04 
GeneralRe: CListCtrl in CDialogBar can't receive WM_CREATE Pin
followait15-Dec-07 14:22
followait15-Dec-07 14:22 
Generaldefault implementation of assignment operator Pin
George_George14-Dec-07 19:04
George_George14-Dec-07 19:04 
GeneralRe: default implementation of assignment operator Pin
CPallini15-Dec-07 0:45
mveCPallini15-Dec-07 0:45 
GeneralRe: default implementation of assignment operator Pin
George_George15-Dec-07 4:01
George_George15-Dec-07 4:01 
GeneralThanks Pin
CPallini15-Dec-07 5:21
mveCPallini15-Dec-07 5:21 

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.