Forget attachment.Resent.

Sam Hu Wrote:

> Hello,
> 
> After my reading below post:
> http://d.puremagic.com/issues/show_bug.cgi?id=2580
> I can compile the win32 SDK sample in dmd\sample folder.After that I tried to 
> encapsulate all those staff in class.Attached is my chance.Below is a short 
> description about all the 3 classes:
> WinClass:Encapsulation of WNDCLASSEX
> WinFrame:Encapsulation of window frame
> WinApp:Encapsulation of the Gui application 
> 
> Here I have a couple of question.It would be grateful if anybody here kindly 
> let me know,though I do know it is a bit long and it is  just an excise of a 
> beginner:
> 1.The program compiled but runs with an Access Violation error.I can not 
> found the place the error occurred.I tried to comments out the try...catch 
> block,but the program runs invisible and with 100% CPU usage,I have to 
> aborted from the task manager. 
> 2.Is it possible to encapsulate the callback function 
> int WindowProc(HWND hWnd, uint uMsg, WPARAM wParam, LPARAM lParam)
> into any of the three classes?Which one should be the ideal place?
> 3.Is is possible to encapsulate all the framework into just one class,say 
> WinFrame,and then we can call it by 
> auto app=new WinFrame;
> app.show;
> If yes,how?
> 4.Is it possible to use main() other than int WinMain(),if yes,how?
> And I do know point 3 and 4 may be a longer story and there are a lot of GUI 
> libararies for reference.But I can not gain a clear idea just by reading the 
> other's large project with out short explanation.So really appreciate,if 
> anybody can teach me.
> 
> Thanks and best regards,
> Sam
> 
> 
> 

Attachment: Win32SDK.d
Description: Binary data

Attachment: winsamp3.d
Description: Binary data

Reply via email to