Remove menu in SDI.

jaeb
jaeb used Ask the Experts™
on
Hi,

When I create SDI project using Project wizard,

a Menu is created automatically.

So If I compile the code, A Menu always appeares.

But I don't want a menu.

So I remove menu in resource.

Then A program doesn't start.

How can I remove menu???
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Vinayak KumbarSr Program Manager

Commented:
Hi,

Leave the menu in resource for now. Go to OnCreate(...) function in MainFrm.cpp. Just before returning form that function, put the following line of code.

SetMenu(NULL);

That should give u the menu less SDI window.

Try it out.
VinExpert
Commented:
I'm almost sure this is not the best way to do it, but unless you find another solution, try the following:

In your PreCreateWindow function add this line:
     cs.hMenu = NULL;

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial