Archived

This topic is now archived and is closed to further replies.

jharkey

Drawing on a Dialog Box

Recommended Posts

hello again, i was wondering if there was a way to draw on a dialog box, like you can on the client area of a regular window. i try to get its device context, and then blit, but nothing happens. i was also wondering something about dll files. can you write programs using the ones that come with windows, like the one used in solitaire(cards.dll), or do you have to have microsofts permission.

Share this post


Link to post
Share on other sites
oops, forgot to ask. just wondering how everyone does there error checking in windows. i always check the results of my initializtion fucntions, like CreateWindowEx, and others like DeleteObject and CloseHandle, but i dont check things like BitBlt or other drawing functions, should i, or would that make it too slow. the gdi is already slow enough.

Share this post


Link to post
Share on other sites
To draw on a dialogbox, I think you can subclass it. But this is probably not what you want. I registered my own window, and used this as custom control. On my own window I can draw and do whatever I like.

You can write your own DLL''s

You should check for errors every function in theory. But if you did your program will exist of more error checking than original code. It''s your choice. Most Win32 almost never return errors, unless you''re out of resources, memory, handles, disk space...
The functions that returns error from time to time should be checked, but this speaks for itself.

A professional program should check for every error. I''m glad I don''t have to do this. For errors I use throw, try and catch with a string. This is not really nice, but easy and practical. If an errors show up often, its best to write some nice error checking.



Share this post


Link to post
Share on other sites
I don''t know for sure, but I''d imagine there wouldn''t be any problem with using DLLs that come with Windows. Hey, you use all kinds of functions they wrote, so why not DLLs?

Basukuenen pretty much covered everything else. I generally don''t do anywhere near as much error checking as I should. Just whenever I use functions that might return an error, and even then I just do like if(FAILED(whatever)) exit(1);, then if my program closes for no appearent reason, start commenting stuff out until I find where the problem is^_^
I know it''s totally wrong to do it like that, but seeing as how I generally abandon projects if I get sick of them, there''s not much point in spending half my time doing good error checking, so I''ll just go add it in once everything else is done.




-Deku-chan

DK Art (my site, which has little programming-related stuff on it, but you should go anyway^_^)

"I'm dropping like flies!" - me, playing Super Smash Bros. (and losing)
"What fun!" - me, playing Super Smash Bros. (and beating the crap out of somebody)

Share this post


Link to post
Share on other sites