Re: Can I use resource file(*.rc,*.res) in D under Win32 API?(Yes)

2009-09-15 Thread Sam Hu
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!

Re: Can I use resource file(*.rc,*.res) in D under Win32 API?

2009-09-15 Thread Sam Hu
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

Re: Can I use resource file(*.rc,*.res) in D under Win32 API?

2009-09-14 Thread Stewart Gordon
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

Re: Can I use resource file(*.rc,*.res) in D under Win32 API?

2009-09-14 Thread Stewart Gordon
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);

Re: Can I use resource file(*.rc,*.res) in D under Win32 API?

2009-09-14 Thread Sam Hu
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

Re: Can I use resource file(*.rc,*.res) in D under Win32 API?

2009-09-14 Thread Don
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.

Re: Can I use resource file(*.rc,*.res) in D under Win32 API?

2009-09-14 Thread Sam Hu
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

Re: Can I use resource file(*.rc,*.res) in D under Win32 API?

2009-09-11 Thread Stewart Gordon
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

Can I use resource file(*.rc,*.res) in D under Win32 API?

2009-09-11 Thread Sam Hu
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