Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 1240: Suggestion PopUp suggesting...
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

WannabeeDeveloper
Tomato Guru

Germany
775 Posts

Posted - Jul 01 2004 :  05:00:39 AM  Show Profile
The Suggestion (or is it the completion? I'm confused...) Box when typing the beginning of a function-name (like, for example "PlaySound") suggests 3 types of PlaySound:

PlaySound
PlaySoundA
PlaySoundW

I believe this is wrong, since the #define UNICODE should decide if I use the A or W Variant, shouldn't it? Offering them to the programmer (what happens if you compile in UNICODE and choose PlaySoundA in this case?) is quite confusing...

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Jul 01 2004 :  06:09:31 AM  Show Profile
Suggestion boxes have tomatoes.

My understanding is that VA doesn't know which things are #define'd for a particular build, and so reads both halves of the #ifdef. So it has no way of knowing that one of those functions is #ifdef'ed out.

Stephen Turner
ClickTracks http://www.clicktracks.com/
Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
Go to Top of Page

WannabeeDeveloper
Tomato Guru

Germany
775 Posts

Posted - Jul 01 2004 :  06:54:16 AM  Show Profile
Wild guessing:
Isn't the decision if a project is compiled in UNICODE written somewhere in the *.dsw/*.dsp or *.sln/*.vcproj File?
If so, shouldn't VAX be able to parse this file and look, if UNICODE is defined (although I still think showing ANY of the 2 defines is wrong, a simple "PlaySound" would be enough, no matter if UNICODE is defined or not)?

I mean, when I hover the mouse over the function afterwards it shows the correct "BOOL PlaySoundW(...)" in the tooltip... so somehow VAX must be able to see the defines?!?

Go to Top of Page

kschaab
Tomato Guru

USA
118 Posts

Posted - Jul 02 2004 :  7:56:52 PM  Show Profile
UNICODE can be specified a number of ways, not all involve project file settings. For example you could #define UNICODE in a precompiled header and not link the crt, and then you don't have anything in the project that states you are using UNICODE. I typed in PlaySound and I get BOOL WINAPI PlaySound(LPCSTR pszSound, HMODULE hmod, DWORD fdwSound) and I'm using UNICODE. I even switched to using UNICODE in project settings and it still says LPCSTR...
Go to Top of Page

Erik Olofsson
Tomato Guru

111 Posts

Posted - Jul 02 2004 :  11:06:43 PM  Show Profile
The correct way is to display all three, because they are all defined irrespective of UNICODE define. PlaySound is just defined to point to PlaySoundA or PlaySoundW depending on UNICODE define.

Cutting Edge Project Management
http://www.hansoft.se
Go to Top of Page

WannabeeDeveloper
Tomato Guru

Germany
775 Posts

Posted - Jul 03 2004 :  06:32:40 AM  Show Profile
Okay, but HOW does VAX later on "know" that I intend to use PlaySoundW when hovering over PlaySound in my Sourcecode?

Once again:
When I hover the mouse over the function afterwards it shows the correct "BOOL PlaySoundW(...)" in the tooltip... so somehow VAX must be able to see the defines?!?

Why is it able to "see" which version I want to use afterwards and not while typing?


Go to Top of Page

Erik Olofsson
Tomato Guru

111 Posts

Posted - Jul 03 2004 :  09:18:27 AM  Show Profile
You might want to use PlaySound if you want the version to be choosen depending on UNICODE define, or PlaySoundA if you always want to use multibyte characters to specify the sound name, or PlaySoundW if you know that you always want to specify a wide char string to the function.

All three could always be the right choice, so VAX has no choice but to display them all. It might know what PlaySound points to when you hover over it but that doesn't mean that you always want that version.

Windows doesn't care is you mix different versions of the functions, it's alayws converted and sent to the W version internally.

Cutting Edge Project Management
http://www.hansoft.se

Edited by - Erik Olofsson on Jul 03 2004 09:18:58 AM
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Jul 07 2004 :  12:27:09 AM  Show Profile
VA X does not respect your UNICODE setting. As kschaab mentions, there are many ways to set it. VA X would invariably fail.

VA X is hacked to collapse Unicode definitions into something more friendly. VA X hides the true mess of A and W versions. Try clicking on SendMessage(), then going to its definition.

Unfortunately, the way Playsound is defined gets passed our collapsing code. It's done differently. Hence, VA X does not display just PlaySound() as we want it to do.

case=153

FWIW, Eons ago, VA did display all the details of Unicode definitions. The practice was more annoying than valuable. Hence, the effort to collapse.

Whole Tomato Software, Inc.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000