FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

About the unicode/ansi aliases

 
Post new topic   Reply to topic     Forum Index -> Core32
View previous topic :: View next topic  
Author Message
jcesar



Joined: 26 Apr 2004
Posts: 5

PostPosted: Thu May 27, 2004 2:34 pm    Post subject: About the unicode/ansi aliases Reply with quote

In the current distribution of Core32, unicode / ansi aliases are isolated on a separate file wich is imported by the application programmer.

Converting commdlg.h I've found a couple of macros that used SendMessage and didn't had corresponding A/W versions so they sould use the same version that the programmer choose. For example:

Code:

#define CommDlg_OpenSave_GetFolderIDList(_hdlg, _pidl, _cbmax) \
        (int)SNDMSG(_hdlg, CDM_GETFOLDERIDLIST, (WPARAM)_cbmax, (LPARAM)(LPVOID)_pidl)


Was converted to:

Code:

LRESULT CommDlg_OpenSave_GetFolderIDList(HWND _hdlg, LPVOID _pidl, UINT _cbmax)
{
    return SendMessage(_hdlg, CommonDialogNotification.CDM_GETFOLDERIDLIST,
        cast (WPARAM)_cbmax, cast (LPARAM)_pidl);
}


The problem is that the SendMessage alias isn't defined in my module but on unicode.d or ansi.d.

I don't know wich version should I use.

Thanks
_________________
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS$ d- s+:+ a-- C++> ULS++ P++ L+> !E W+++ N+ o? K? w++>
O---@ M V? PS+ PE Y+ PGP t+ 5- X+++@ R- tv+(++) b++> DI!
D++> G e+> h-- r- y+
------END GEEK CODE BLOCK------
Back to top
View user's profile Send private message
jcesar



Joined: 26 Apr 2004
Posts: 5

PostPosted: Tue Jun 01, 2004 4:02 pm    Post subject: Reply with quote

I have been thinking a little more on the topic and it seems we could just define the unicode/ansi aliases in the same file the functions are declared and still keep the unicode.d and ansi.d files (Wich are a really nice mecanism):

Code:

//unicode.d

version = UNICODE;

import winbase;
import winuser;
...


Code:

//ansi.d

version = ANSI;    // Just don't define UNICODE

import winbase;
import winuser;
...


Then each file would be:

Code:

SendMessageW(...);
SendMessageA(...);

version (UNICODE)
{
    alias SendMessageW SendMessage;
}
else
{
    alias SendMessageA SendMessage;
}



What do you think?
_________________
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS$ d- s+:+ a-- C++> ULS++ P++ L+> !E W+++ N+ o? K? w++>
O---@ M V? PS+ PE Y+ PGP t+ 5- X+++@ R- tv+(++) b++> DI!
D++> G e+> h-- r- y+
------END GEEK CODE BLOCK------
Back to top
View user's profile Send private message
jcc7



Joined: 22 Feb 2004
Posts: 657
Location: Muskogee, OK, USA

PostPosted: Tue Jun 01, 2004 7:22 pm    Post subject: Reply with quote

jcesar wrote:
I have been thinking a little more on the topic and it seems we could just define the unicode/ansi aliases in the same file the functions are declared and still keep the unicode.d and ansi.d files . . .
How is this different than the way it's currently setup? Are you suggesting that the aliases in unicode.d/ascii.d be moved to other files? That sounds like a reasonable idea to me. I thought that was how the .h files were set up.

I think one of the most important goals is to keep the D port parallel (as much as possible) to the original header files. It would make correcting errors and updating to new headers that much easier. Also it would faciliate adding definitions from Y. Tomino's automatically-generated headers.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Core32 All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot 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


Powered by phpBB © 2001, 2005 phpBB Group