PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Example program doesnt show button

I took the example program and tried to run it. The menu function works fine but the button doesn't appear on my PPC - any suggestions as to why not?

Func WndProc(hWnd$, Msg$, wParam$, lParam$)
ok$ = true;
case (Msg$)
WM_COMMAND:
wmId$ = LOWORD(wParam$);
wmEvent$ = HIWORD(wParam$);
case (wmId$)
401:
PostMessage(hWnd$, WM_CLOSE, 0, 0);
402:
ShowMessage("Wow!");
500:
case (wmEvent$)
BN_CLICKED:
ShowMessage("Hello World");
end;
End;
End;

Return (ok$);
End;

func WinMain
form$ = NewForm("MLM", "MyWindowClass", &WndProc;);

menu$ = NewMenu(form$, "Here", 400);
NewMenuItem(menu$, -1, "E&xit;", 401);
NewMenuItem(menu$, -1, "-", 0);
NewMenuItem(menu$, -1, "S&how;", 402);

b$ = NewControl(200, "BUTTON", NULL, "Greetings", 0, form$, 70, 100, 100, 20);
ShowWindow(form$, SW_SHOW);

return (true);
End;
Hi,

The demo you are using is very old. It's missing the WS_VISIBLE property.

I suggest you create a new form using the PIDE on the PC and run the form on the PocketPC. Or you can do it from the Visual Form Builder on the PocketPC.

Don't type form code like this. It's from the old PPL days! :)
Thanks for that - does the PIDE work like other IDEs whereby if I double click the control (button), it helps me code the clicked event?
The new version 1.0 will. We have implemented a very nice event handling system. It's very easy to use a lot less coding than before.

Version 0.9.7 doesn't have that. You will have to code using the standard Windows API coding mecanism.