Click here to Skip to main content
15,927,592 members
Home / Discussions / COM
   

COM

 
GeneralHelp! How to understanding marshaling! Pin
Kang wenzhen24-Dec-01 22:16
Kang wenzhen24-Dec-01 22:16 
GeneralRe: Help! How to understanding marshaling! Pin
Tim Smith25-Dec-01 2:36
Tim Smith25-Dec-01 2:36 
GeneralProblems with class header of COM object Pin
IGx8922-Dec-01 8:52
IGx8922-Dec-01 8:52 
GeneralRe: Problems with class header of COM object Pin
IGx8922-Dec-01 8:56
IGx8922-Dec-01 8:56 
GeneralRe: Problems with class header of COM object Pin
Michael Dunn22-Dec-01 14:51
sitebuilderMichael Dunn22-Dec-01 14:51 
GeneralRe: Problems with class header of COM object Pin
IGx8922-Dec-01 16:01
IGx8922-Dec-01 16:01 
Generalusing IDirectDraw7 in a type library Pin
20-Dec-01 15:36
suss20-Dec-01 15:36 
GeneralATL and MFC OnIdle() Pin
Jamie Hale18-Dec-01 6:01
Jamie Hale18-Dec-01 6:01 
The application that I'm working on has an OnIdle() handler. It was written by someone else - despite my suggestion that a timer would better suit the situation. :P

Now, I've added a few more ATL objects (the project already had a few), and for some strange reason, simply having the object created at initialization time causes an OnIdle() call after the App has closed and cleared some of it's state.

class CMyObject :
  public CComObjectRootEx<CComSingleThreadModel>,
  public IMyInterface {
  ...
};

class CMyApp : public CWinApp {
  ...
  CComObject<CMyObject> *m_pObj;
  ...
  BOOL OnIdle(long);
  void Init();
  ...
};

void CMyApp::Init() {
  ...
  CComObject<CMyObject>::CreateInstance(&m_pObj);
  ...
}

BOOL CMyApp::OnIdle(long) {
  ...
  CMainFrame *pMF = static_cast<CMainFrame *>(m_pMainWnd);
  ...
}


The initialization goes fine, and hell it has nothing to do with the App or main frame. Then, when I close the application, it crashes because OnIdle() is getting called AFTER the App state has been cleared, and pMF is NULL.

Does simply creating an ATL object somehow screw around with the application message queues? Is the OnIdle() getting called from another thread? My ATL objects are all using CComSingleThreadModel...

J
GeneralProblem identified... Pin
Jamie Hale18-Dec-01 9:27
Jamie Hale18-Dec-01 9:27 
GeneralRe: Problem identified... Pin
Ernest Laurentin18-Dec-01 9:48
Ernest Laurentin18-Dec-01 9:48 
GeneralRe: Problem identified... Pin
Jamie Hale18-Dec-01 10:19
Jamie Hale18-Dec-01 10:19 
GeneralOutput parameter for COM local server Pin
18-Dec-01 4:54
suss18-Dec-01 4:54 
GeneralRe: Output parameter for COM local server Pin
Michael P Butler18-Dec-01 5:04
Michael P Butler18-Dec-01 5:04 
GeneralRe: Output parameter for COM local server Pin
18-Dec-01 6:05
suss18-Dec-01 6:05 
QuestionHow to capture IE Event in WTL.... Pin
Huu Quynh18-Dec-01 3:37
Huu Quynh18-Dec-01 3:37 
GeneralSome Basic COM Questions Pin
ragamuffin16-Dec-01 8:49
ragamuffin16-Dec-01 8:49 
GeneralRe: Some Basic COM Questions Pin
Aaron Schaefer17-Dec-01 6:58
Aaron Schaefer17-Dec-01 6:58 
GeneralSIngletons, Threading, and Marshalling Pin
Not Active15-Dec-01 3:55
mentorNot Active15-Dec-01 3:55 
GeneralRe: SIngletons, Threading, and Marshalling Pin
Ernest Laurentin15-Dec-01 6:12
Ernest Laurentin15-Dec-01 6:12 
GeneralRe: SIngletons, Threading, and Marshalling Pin
Not Active15-Dec-01 9:30
mentorNot Active15-Dec-01 9:30 
GeneralCOM & Duel Processors Pin
Ancient Dragon13-Dec-01 13:06
Ancient Dragon13-Dec-01 13:06 
GeneralRe: COM & Duel Processors Pin
Ganesh Ramaswamy19-Dec-01 5:24
Ganesh Ramaswamy19-Dec-01 5:24 
GeneralCoInitializeEx ( ) Pin
Tim Rymer13-Dec-01 4:12
Tim Rymer13-Dec-01 4:12 
GeneralRe: CoInitializeEx ( ) Pin
Michael P Butler13-Dec-01 5:11
Michael P Butler13-Dec-01 5:11 
GeneralRe: CoInitializeEx ( ) Pin
Ernest Laurentin13-Dec-01 5:38
Ernest Laurentin13-Dec-01 5:38 

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.