![]() |
win32 dialog help
Hey everyone I need some help. First a little back story. I am getting a new Pocket PC for Christmas and i thought it would be cool to have a FIRST playbook application on it so i could make autonomous "plays". I did a little research and found out i need to learn win32 (something I have wanted to do anyway) before I could write an app for windows CE. so i found a nifty little tutorial that explained windows programming well. Then i hit a wall. I did the the tutorial on modal dialogs. Everything complied fine but no dialog box when i select the about menu under help. I'm using DevC++. Here is the code. Anyone got any Ideas? Thanks.
Code:
#include <windows.h> |
Re: win32 dialog help
If you're familiar with the .NET languages you can write a PPC application in Visual Studio targeting the compact framework. I wrote a program to time contractions when my wife was expecting in about an hour. There is even an emulator so you can test it on your PC without downloading it to the PDA. The framework class documentation has a flag that indicates whether the class is supported by the compact framework.
|
Re: win32 dialog help
I compiled and ran the code on WinXP-Pro.
When you click on the menu, instead of giving you a dialog box, the controls on the dialog become part of the MDI environment of the parent window. I'll try out some different things and get back to you. |
Re: win32 dialog help
There's any number of things that could be going wrong, but my guess would be that the dialog is being created, but not shown.
One thing I noticed was that you grab the WM_INITDIALOG message in AboutDialog, but don't do anything with it. If you don't process a given message, your handler routine should return FALSE to signify to windows that it should use the default behavior, which in this case involves painting the window to the screen, etc. Try changing the last line of your handler to "return FALSE;" and putting a "return TRUE;" after both of the EndDialog(...) calls. For example, here's the aboutDialog callback routine that I use in RoboGUI: Code:
BOOL CALLBACK aboutProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam){ |
Re: win32 dialog help
Unfortanuly i don't now much of anything about .net. I tried changing and adding the returns and nothing happened. Here is the full project.
whiteboard.zip Thanks for your help guys |
Re: win32 dialog help
Quote:
Code:
LRESULT CALLBACK aboutProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam){ |
Re: win32 dialog help
Quote:
Also, if you could add the following code and try running it again, that would be great: -In WindowProcedure, in the IDI_HELP_ABOUT case, just above the line DialogBox(...): MessageBox(NULL, "Got menu click", "Test", MB_OK); -In AboutDialog, in the WM_INITDIALOG case: MessageBox(NULL, "Got init dialog", "Test", MB_OK); Then try choosing About from the help menu and see how many message boxes show up. -Rob Quote:
|
Re: win32 dialog help
Yeah it is definitely my computer. I'm running XP home. The funny thing is it doesn't run of my other computer with windows XP Pro. I finally got it to work with my laptop.
I added those message box and i don't get any of them on my main computer. The link about is updated with that code. Well i guess I can take it from here thanks. |
Re: win32 dialog help
I just downloaded the project, and it works fine for me (XP Pro SP1). I can't recompile, though- I use VC++ 6.
What you may want to do is center the dialog box somewhere, just to make sure it isn't appearing off-screen. |
Re: win32 dialog help
Quote:
|
Re: win32 dialog help
Quote:
|
| All times are GMT -5. The time now is 02:51. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi