Archived

This topic is now archived and is closed to further replies.

Bonny

Menu problem and Window closes if clicked outside

Recommended Posts

Hello I have reentered into the world of Visual C++ after a while. I have tried for sometime now to resolve this. I hope somebody might point me in the correct direction or tell me what I might be doing wrong. This is regarding a Visual C++ DirectX application. I use Visual Studio .NET. I am not using the MFC. There are two problems I face. 1. I have a menu lets say that has File, Edit, Help. When I click on File, the menu drops down. Up until here it''s fine but then when I move the mouse over Edit, the file menu that dropped down previously does not disappear. It still remains under the Edit menu list. I cant figure out what I might be doing wrong. Is there someother message I need to take care of to refresh the window. 2. My second problem is as follows. This is regarding the same application. If I click anywhere outside the window my application closes. It also closes if I minimize the window. It does not close if I maximise the window. My window style is WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_VISIBLE; I would appreciate any help Thanks Bonny

Share this post


Link to post
Share on other sites
I''m totally guessing here, but perhaps there''s something wrong with the wndproc. Maybe there is some faulty code related to WM_COMMAND handling that produces the menu related problem. And maybe a missing case break in the switch is allowing program flow to fall through to the window closing handler in the second case. I might be way off with those guesses, but it can''t hurt to double check the wndproc.

Share this post


Link to post
Share on other sites
I tried what you said. Still the same. I even removed all the event handlers and the same problem persists.

I did notice in the output window during debugging that it says.

The thread ''Win32 Thread'' (0x860) has exited with code 0 (0x0).

and then it says
The program ''[1512] Trial.exe: Native'' has exited with code 1 (0x1).

Is this the cause of any or all of my problems?



Share this post


Link to post
Share on other sites
I would have to look at your code to accurately diagnose the problem. Zip up the code - the version that prompted your first post if possible - and email it to me. I''ll take a look.

Share this post


Link to post
Share on other sites