Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Win-API: DialogBoxIndirect Function

 
Post new topic   Reply to topic Printable version
 View previous topic  HiJack This... Is this something to wo... Post :: Post my zone just made  View next topic  
Author Message
50% Packetloss
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Tue May 31, 2005 8:45 pm   Post maybe stupid    Post subject: Win-API: DialogBoxIndirect Function Reply to topic Reply with quote

I have 2 questions.
First is: what is a dword boundry? Or any boundry for that matter. The source code that I am refering to is found here (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/dialogboxes/usingdialogboxes.asp), at the very bottom of the page. The msdn documentation is great but the fucking thing is in another language or something, whoever wrote it seems incapable of explaining something without using a geek-dialect.
Second: I'm not sure if found a typo or not, this is the documentation for the DLGITEMTEMPLATE struct (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/dialogboxes/dialogboxreference/dialogboxstructures/dlgitemtemplate.asp) it specifies that "The creation data array begins at the next WORD boundary after the title array," however, the documentation of the DialogBoxIndirect function (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/dialogboxes/dialogboxreference/dialogboxfunctions/dialogboxindirect.asp) specifies that "The creation data array that follows a DLGITEMTEMPLATE structure must ... be aligned on a DWORD boundary." The source code example backs up the DialogBoxIndirect() documenation.
_________________
Current Terror Alert Level
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
50% Packetloss
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Wed Jun 01, 2005 5:13 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email AIM Address
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Wed Jun 01, 2005 1:52 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List
50% Packetloss
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Wed Jun 01, 2005 4:58 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Trash Talk All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 29 page(s) served in previous 5 minutes.

phpBB Created this page in 0.572190 seconds : 28 queries executed (86.1%): GZIP compression disabled