Click here to Skip to main content
15,897,518 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: WideCharToMultiByte Pin
Christian Graus25-Nov-02 23:06
protectorChristian Graus25-Nov-02 23:06 
GeneralRe: WideCharToMultiByte Pin
candan26-Nov-02 14:40
professionalcandan26-Nov-02 14:40 
GeneralRe: WideCharToMultiByte Pin
Christian Graus26-Nov-02 15:33
protectorChristian Graus26-Nov-02 15:33 
GeneralConvert to widechar Pin
Member 910463223-Jan-14 4:09
Member 910463223-Jan-14 4:09 
GeneralProblems with Microsoft Forms 2.0 Frame Control Pin
jmgir25-Nov-02 22:31
jmgir25-Nov-02 22:31 
Generalreadind an excel cell from MFC app Pin
sinouhe25-Nov-02 22:19
sinouhe25-Nov-02 22:19 
GeneralRe: readind an excel cell from MFC app Pin
perlmunger26-Nov-02 6:25
perlmunger26-Nov-02 6:25 
GeneralCreate a window in an ATL control Pin
Jerome Conus25-Nov-02 22:02
Jerome Conus25-Nov-02 22:02 
Hi !

My app (VC6) is an ATL object, and I would like, during the initialization of the object, to create a window and to post messages to this window. Right now, the only thing the app is doing is to display a message box when a message is received....nad it doesn't work !!!

Here is what I'm doing :

Here is my window class :
<br />
#include "atlwin.h"<br />
#define WM_MYMESSAGE WM_APP+1<br />
<br />
class CMyWindow : public CWindowImpl<CMyWindow><br />
{<br />
public:<br />
   CMyWindow(){};<br />
   virtual ~CMyWindow(){};<br />
   DECLARE_WND_CLASS("MyWindow") <br />
<br />
   BEGIN_MSG_MAP(CMyWindow)<br />
      MESSAGE_HANDLER(WM_MYMESSAGE, OnMyMessage)<br />
   END_MSG_MAP()<br />
<br />
   LRESULT OnMyMessage(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& Handled)<br />
   {<br />
      ::MessageBox(NULL,"Message","Message",MB_OK);<br />
      return 0;<br />
   }<br />
};<br />


and here is my interface code (in the class declaration, I just added a member of type CMyWindow*) :

<br />
CEventBox::CEventBox()<br />
{<br />
   m_pMyWindow=new CMyWindow;<br />
   RECT myRect;<br />
   myRect.bottom=100;<br />
   myRect.left=0;<br />
   myRect.top=0;<br />
   myRect.right=100;<br />
   m_pMyWindow->Create(NULL, myRect, NULL, 0, 0, 0U, NULL);<br />
}<br />
<br />
STDMETHODIMP CEventBox::SendEvent(long lNbrEvent, long lSpaceTime)<br />
{<br />
   PostMessage(m_pMyWindow->m_hWnd,WM_MYMESSAGE,0,0);<br />
   return S_OK;<br />
}<br />


For my tests, I try to use this ATL object in a VB project, where I call the method 'SendEvent' of the interface. Nothing crashed but I cannot see the window I created in the constructor of CEventBox and the message box of OnMessageBox is never displayed.

Any help will be greatly appreciated !
Thank you !
Jerome
QuestionDynamicly create controls in dialog + scroll bar? Pin
anonimous25-Nov-02 21:53
anonimous25-Nov-02 21:53 
AnswerRe: Dynamicly create controls in dialog + scroll bar? Pin
Anonymous26-Nov-02 11:23
Anonymous26-Nov-02 11:23 
QuestionHow to get NT group name from Windows 9x/ME client? Pin
Ruxo Zheng25-Nov-02 20:15
Ruxo Zheng25-Nov-02 20:15 
Generalhelp: ODBC CRecordSet update delay.. Pin
trustno125-Nov-02 18:42
trustno125-Nov-02 18:42 
GeneralSetItemText Pin
David Kadish25-Nov-02 18:33
David Kadish25-Nov-02 18:33 
GeneralRe: SetItemText Pin
Roman Fadeyev25-Nov-02 18:57
Roman Fadeyev25-Nov-02 18:57 
GeneralRe: SetItemText Pin
perlmunger25-Nov-02 19:39
perlmunger25-Nov-02 19:39 
GeneralRe: SetItemText Pin
Rage25-Nov-02 20:16
professionalRage25-Nov-02 20:16 
GeneralRe: SetItemText Pin
perlmunger26-Nov-02 3:52
perlmunger26-Nov-02 3:52 
GeneralMake programme identify multi-display Pin
TianYang25-Nov-02 17:56
TianYang25-Nov-02 17:56 
GeneralRe: Make programme identify multi-display Pin
Scott H. Settlemier26-Nov-02 6:50
Scott H. Settlemier26-Nov-02 6:50 
GeneralADO Field names Pin
devvvy25-Nov-02 16:44
devvvy25-Nov-02 16:44 
GeneralRe: ADO Field names Pin
perlmunger25-Nov-02 19:04
perlmunger25-Nov-02 19:04 
Generalthanks but.... Pin
devvvy25-Nov-02 20:33
devvvy25-Nov-02 20:33 
GeneralRe: thanks but.... Pin
Alexandru Savescu25-Nov-02 21:43
Alexandru Savescu25-Nov-02 21:43 
Generalhelp! ADO - how to determine if a field is PK/FK Pin
devvvy25-Nov-02 23:22
devvvy25-Nov-02 23:22 
Generalany ADO/C++ solution? Pin
devvvy26-Nov-02 7:58
devvvy26-Nov-02 7:58 

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.