How to by pass handler and implement the function inside handler directly? 
Author Message
 How to by pass handler and implement the function inside handler directly?

I'm working on the oclient samples of the MSDN CD by modifying some code.

I want to create an application without any menu. When I execute the
application, it will automatically carry out the implementation of
OnPasteLink() of CMainView.cpp. In the presence of menu, this implementation
is carried out by clicking Edit, Paste Link.

I haven't figured out how to remove the menu yet. Remove everything from
menu editor makes the program unrunnable. To test the other function, I
copied the coding of OnPasteLink() to InitInstance() like this:

CMainView* pMainView = new CMainView;
 if (pMainView->DoPasteItem(TRUE, NULL, NULL) == NULL)
  AfxMessageBox(IDP_GET_FROM_CLIPBOARD_FAILED);

It compiled and built alright, but when I execute it, it will give a
message:
"Debug Assertion Failed!
Program:C:\OCLIENT\DEBUG\CLIENT.EXE
file: objcore.cpp
Line: 43"

Line 43 is the ASSERT statement of the following:
BOOL CObject :: IsKindOf(...)const
{
    ASSERT(this!=NULL);

Quote:
}

So does it mean that I can't call what's inside OnPasteLink() directly from
the InitInstance? Besides, how can I remove the whole menu? I just need the
container without any menu.

Thanks,
Christine



Mon, 11 Oct 2004 12:20:31 GMT  
 How to by pass handler and implement the function inside handler directly?
Hi!

Well, part of your problem might be solved by MSDN Article Q131368, "HOWTO: Create MFC Applications
that Do Not Have a Menu Bar".

--
Jeff Partch

Quote:

> I'm working on the oclient samples of the MSDN CD by modifying some code.

> I want to create an application without any menu. When I execute the
> application, it will automatically carry out the implementation of
> OnPasteLink() of CMainView.cpp. In the presence of menu, this implementation
> is carried out by clicking Edit, Paste Link.

> I haven't figured out how to remove the menu yet. Remove everything from
> menu editor makes the program unrunnable. To test the other function, I
> copied the coding of OnPasteLink() to InitInstance() like this:

> CMainView* pMainView = new CMainView;
>  if (pMainView->DoPasteItem(TRUE, NULL, NULL) == NULL)
>   AfxMessageBox(IDP_GET_FROM_CLIPBOARD_FAILED);

> It compiled and built alright, but when I execute it, it will give a
> message:
> "Debug Assertion Failed!
> Program:C:\OCLIENT\DEBUG\CLIENT.EXE
> file: objcore.cpp
> Line: 43"

> Line 43 is the ASSERT statement of the following:
> BOOL CObject :: IsKindOf(...)const
> {
>     ASSERT(this!=NULL);
> }

> So does it mean that I can't call what's inside OnPasteLink() directly from
> the InitInstance? Besides, how can I remove the whole menu? I just need the
> container without any menu.

> Thanks,
> Christine



Mon, 11 Oct 2004 12:39:26 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. * ISR handlers (interrupt handlers) *

2. How to get the handler of an edit box inside a window

3. Help needed: how to do disk I/O inside an interrupt handler

4. Get the view handler or pointer, from inside the frame

5. Get the view handler or pointer, from inside the frame

6. to use or not use ref keyword when passing an event handler to a class

7. Passing parameter to sybase error handler

8. Passing Commands to original handlers

9. ** How can I pass addresses to an interrupt handler **

10. Passing Strings or structures to a message handler through WPARAM and LPARAM

11. Passing Parameters to Exception Handler

12. VS7.0 IDE Problem (Can't add Message Handler Function)

 

 
Powered by phpBB® Forum Software