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
 Incorrect structure members parsing
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

AGL
New Member

Russia
8 Posts

Posted - Mar 01 2006 :  01:21:55 AM  Show Profile  Reply with Quote
I'm using VAX1440 under VS6
See expression below:

DWORD ofslcharset = (DWORD)&((LOGFONTW*)NULL)->lfCharSet;

VAX can't tell where "lfCharSet" member is declared.
But in the same expression with two additional brackets:

DWORD ofslcharset = (DWORD)&(((LOGFONTW*)NULL)->lfCharSet);

it works fine.

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Mar 01 2006 :  7:11:15 PM  Show Profile  Reply with Quote
if you mean that lfCharSet is underlined as a mistyped symbol in the first line then i am seeing the same thing here. if you mean something else then i do not follow.

case=1014

zen is the art of being at one with the two'ness
Go to Top of Page

jpizzi
Tomato Guru

USA
642 Posts

Posted - Mar 02 2006 :  12:17:00 AM  Show Profile  Reply with Quote
quote:
DWORD ofslcharset = (DWORD)&((LOGFONTW*)NULL)->lfCharSet;
DWORD ofslcharset = (DWORD)&(((LOGFONTW*)NULL)->lfCharSet);

Wow. I'm having trouble parsing that. It looks to me like you are explicitly de-referencing a NULL pointer, and then taking the address of the result. How is that supposed to work? (I know, that doesn't make too much difference to the question you posed, but....)

Joe Pizzi
Go to Top of Page

AGL
New Member

Russia
8 Posts

Posted - Mar 02 2006 :  01:11:52 AM  Show Profile  Reply with Quote
>jpizzi
This code is needed to get offset to lfCharSet member from beginning of structure LOGFONTW
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Mar 02 2006 :  6:30:23 PM  Show Profile  Reply with Quote
very occasionally i need to get the offset into a structure, and i am sure i do it in a simpler looking manor.

*considers* however i actually have an instance of the structure in hand when i do this, which makes it easier.

zen is the art of being at one with the two'ness
Go to Top of Page

jpizzi
Tomato Guru

USA
642 Posts

Posted - Mar 02 2006 :  10:37:16 PM  Show Profile  Reply with Quote
Well, I haven't ever had to do that, but I know of the "offsetof" way to do it. But, I just looked it up, and it is a macro that expands to exactly your code! Wow. Learn something new everyday.

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