Stewart Gordon Wrote:
> No, it's because you put a cast in to suppress the error.
>
> Stewart.
You are right.It is the switch statement.I followed your guide and finally make
it.Great!
Thank you so much!
Stewart Gordon Wrote:
> Your problem is right here: In D, switch statements must have default
> clauses of there's any chance of the value being switched not matching
> any of the switches. If there isn't, a SwitchError is thrown at
> runtime. Presumably, the program crashes because there's no
Sam Hu wrote:
Don Wrote:
Sam Hu wrote:
int DialogFunc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
This should be extern(Windows). I'm surprised that compiled, it
shouldn't have.
Yes.it compiled even without extern(Windows) ,maybe because I imported win32
package other than std.c.window
Sam Hu wrote:
int DialogFunc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
switch(msg)
{
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDOK:
EndDialog(hwnd,1);
Don Wrote:
> Sam Hu wrote:
> > int DialogFunc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
>
> This should be extern(Windows). I'm surprised that compiled, it
> shouldn't have.
Yes.it compiled even without extern(Windows) ,maybe because I imported win32
package other than std.c.windows.wind
Sam Hu wrote:
int DialogFunc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
This should be extern(Windows). I'm surprised that compiled, it
shouldn't have.
Thank you so much for your help!
Below is the resource file,I compiled it with
rcc -32 testd.rc
it then generated
testd.res.
testd.rc:
#include
101 DIALOG 129, 26, 180, 70
STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Show Info"
FONT 8, "MS Sans Serif"
BEGIN
EDITTEXT
Sam Hu wrote:
Greetings to everybody!
As subjected.I use vc++ to generate a very simple dialog resource,and then
compiled with rcc.exe accompanied with dmc:
rcc -32 mydialog.rc
it generated mydialog.res file.
Did you remember to include this .res file on the command line when
linking your p
Greetings to everybody!
As subjected.I use vc++ to generate a very simple dialog resource,and then
compiled with rcc.exe accompanied with dmc:
rcc -32 mydialog.rc
it generated mydialog.res file.
In my main win32 SDK source file,I use DialogBox to try to load the dialog,but
it failed.
Doesn't