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
 VAX 1220: #define'd types and scope problems
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Uniwares
Tomato Guru

Portugal
2322 Posts

Posted - Mar 17 2004 :  6:47:45 PM  Show Profile
I've got a problem with some types defined in the standard Windows SDK headers.
Symbols like SERVICE_STATUS_HANDLE or SC_HANDLE are shown as unknown (and yes, they are reddish underlined here) although the header file (WinSvc.h) is included.
Opening the header file and searching for the symbol reveals that VA knows this symbol and shows it properly colored. Back to the file where its used ... unknown symbol.

Looking at how these symbols are defined:
DECLARE_HANDLE(SERVICE_STATUS_HANDLE);
which is
#define DECLARE_HANDLE(name) typedef void * name
So here lies the culprit - VA does not take these definitions across file boundaries. They are only correctly resolved in the file where the #define resides.

Anything that can be done? Please?

[edit]
Defining these types of symbols in VA's stdafx.h (why you call that afx, its not MFC?) would be a solution, but a incorrect one. I think that VA should be able to understand at least the "standard" headers used by everybody.
[/edit]

Edited by - Uniwares on Mar 17 2004 7:39:46 PM

LarryLeonard
Tomato Guru

USA
1041 Posts

Posted - Mar 17 2004 :  8:32:42 PM  Show Profile
I was with you right up to the point you said, "I think that VA should be able to understand at least the 'standard' headers used by everybody."

Just because it's a standard header, doesn't make it any easier to work with. I remember the first time I compiled an MFC project at Warning Level 4, and got hundreds and hundreds and hundreds of warnings - all from the standard headers! It was my introduction to #pragma warning. Seems like before VC6, Warning Level 4 always compiled cleanly... or was it VC5 ...

Anyway, you're right that it would be nice to be able to get to those symbols. Somewhere recently they talked about how they don't parse files from top to bottom, they do it as you type. But then again, the 'standard' headers aren't going to change, so they must be parsing them in some order, wouldn't you think? But maybe it's not the 'correct' order, as far as being able to do what we want. Boy, this stuff hurts my head, this late at night...

Also, I know why it's called 'Afx' instead of 'MFC' - let me know if you want the whole boring explanation...
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2322 Posts

Posted - Mar 17 2004 :  9:02:51 PM  Show Profile
Yes, for the 'standard' SDK headers are some rules defined which will never ever change (otherwise even MS cant compile their stuff anymore). No, it doesnt make it any easier, given the way MS uses and reuses some macros.

I know the story about Afx and MFC, I was just wondering why WT uses it. I'd understand a 'stdwt.h' or 'stdtomato.h' or even a 'stdred.h' but 'stdafx.h' ??
Go to Top of Page

Cezariusz
Tomato Guru

Poland
244 Posts

Posted - Mar 18 2004 :  03:53:24 AM  Show Profile
quote:
Also, I know why it's called 'Afx' instead of 'MFC' - let me know if you want the whole boring explanation...

Actually, I've been always wondering why it's Afx, so I'd love to hear the story.

Cezariusz Marek
https://midicat.net/
Go to Top of Page

LarryLeonard
Tomato Guru

USA
1041 Posts

Posted - Mar 18 2004 :  08:42:41 AM  Show Profile
quote:
I'd understand a 'stdwt.h' or 'stdtomato.h' or even a 'stdred.h' but 'stdafx.h'??
Yeah, 'stdafx.h' is a seriously bad name for that file. I try to avoid name collisions whenever possible, and have a bias for long, descriptive names, so I'd call it "VAX_Standard_Stuff.h" or something...

quote:
Actually, I've been always wondering why it's Afx, so I'd love to hear the story.
Back in the old days, when MFC was being created, the original name of the project was "Application Framework". So, apparently the style then was prefix your symbols with the abbreviation of your group's name. In this case, that would be "Af" - but unfortunately, there was already a group at Microsoft that used those initials (I never heard what their name was - "Antitrust Fighting"?), so they just appended an "x", to create "Afx".

Then they changed the whole thing to "Microsoft Foundation Classes", but - gasp - never went back to rename their symbols for consistency. (That should have been our first clue.)
Go to Top of Page

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Mar 18 2004 :  08:50:47 AM  Show Profile
Antitrust fighting? Ho ho!

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 - Mar 18 2004 :  09:27:55 AM  Show Profile
Isn't Micro$oft one of the biggest supporters of TCPA?

Looks like they're not that "Anti" (anymore?)

Nice story, didn't know that, too...

Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Mar 18 2004 :  10:52:16 AM  Show Profile
For VA X, it's After-everything-else FiX

Whole Tomato Software, Inc.
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2322 Posts

Posted - Mar 18 2004 :  1:52:00 PM  Show Profile
No, that cant be right. You are telling us that VAX parses this file before everything else, so it should be BFX. Ha! Got ya.
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Mar 18 2004 :  3:16:02 PM  Show Profile
Good point.

We should say, "After we tried tweaking our parser to make sense of multiple, convoluted and macro-intensive definitions, create a FiX in the stdafx.h file."

Whole Tomato Software, Inc.
Go to Top of Page

WannabeeDeveloper
Tomato Guru

Germany
775 Posts

Posted - Mar 18 2004 :  3:38:52 PM  Show Profile
quote:
Originally posted by support

"After we tried tweaking our parser to make sense of multiple, convoluted and macro-intensive definitions, create a FiX in the stdafx.h file."



Now that's what I call a "readable Header Filename"

Go to Top of Page

Uniwares
Tomato Guru

Portugal
2322 Posts

Posted - Mar 18 2004 :  4:23:41 PM  Show Profile
And with a mere 135 chars it does not even exceed MAX_PATH.
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