 |
Server Help Community forums for Subgame, ASSS, and bots
|
Author |
Message |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: Wed Jun 01, 2005 5:13 am Post maybe stupid Post subject: |
 |
|
|
|
Also another thing: Is it safe to have a global pointer to the HINSTANCE passed to winmain()? Many functions require the variable and all the example code that I have is using GetModuleHandle() to obtain the instance handle (which seems a little stupid if the handle's place in memory is fixed). |
|
Back to top |
|
 |
Mr Ekted Movie Geek

Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Wed Jun 01, 2005 1:52 pm Post maybe stupid Post subject: |
 |
|
|
|
Why use DialogBoxIndirect() unless you are creating dialog box controls on the fly? Normally you would make a dialog template visually, store it as a resource, then use DialogBox().
A DWORD boundary is a 4 byte boundary. That means the pointer & 3 must equal 0. Any pointer allocated with malloc/calloc is guaranteed to be suitably aligned for anything.
An HINSTANCE is just a form of HANDLE, meaning it is a pointer to something inside Windows (app, module, memory, pen, brush, font, etc) that is passed to the application as a void *. As you know, pointers can be passed around an application as data. The HINSTANCE passed to your WinMain is simply a pointer to the base of the your EXE's code. This is always equal to 0x00400000. Saving the pointer, or calling GetModuleHandle() for the app itself is the proper way to obtain it. _________________ 4,691 irradiated haggis! |
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: Wed Jun 01, 2005 4:58 pm Post maybe stupid Post subject: |
 |
|
|
|
Yah, I'm just going through a bunch of functions and figuring out how they work. I haven't planned on making a windows program yet. |
|
Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Software by php BB © php BB Group Server Load: 29 page(s) served in previous 5 minutes.
|