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
 Wrong syntax coloring
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

khb
Tomato Guru

Germany
337 Posts

Posted - Sep 15 2006 :  02:45:40 AM  Show Profile  Reply with Quote
Please have a look at the following code snippet:
  GetAdaptersInfo((PIP_ADAPTER_INFO) pcBuffer, &ulLen);
  PIP_ADAPTER_INFO pInfo = (PIP_ADAPTER_INFO) pcBuffer;
  m_dwSubNetMask = inet_addr(pInfo->IpAddressList.IpMask.String);
The item "String" is a member of IpMask and, therefore, shouldn't be shown in blue. Also, the tooltip on that item seems to be incorrect: "char unnamed672732::String[4 * 4]".

I'm using VC6, Win XP, no other add-ins.

Regards,
Marcus.

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Sep 17 2006 :  1:32:11 PM  Show Profile  Reply with Quote
is it possible for you to post the definition of "PIP_ADAPTER_INFO"
i think i know part of what is happening. you normally get "unnamed672732" when there is a component with no name:

enum { CHOCOLATE, BANANA, ORANGE };


is a simple example. here CHOCOALTE is an item inside an enum, but the enum has no name.

this does not explain the odd colouring of String, but i suspect VA is simply confused in this case. the colouring code has to run very quickly, so it can work in real time, but it also has to operate on very limited information, so duplicate names have a tendency to confuse it.

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

khb
Tomato Guru

Germany
337 Posts

Posted - Sep 18 2006 :  09:48:48 AM  Show Profile  Reply with Quote
The stuff is defined in IPTypes.h of the Microsoft SDK:

typedef struct _IP_ADAPTER_INFO {
    struct _IP_ADAPTER_INFO* Next;
    DWORD ComboIndex;
    char AdapterName[MAX_ADAPTER_NAME_LENGTH + 4];
    char Description[MAX_ADAPTER_DESCRIPTION_LENGTH + 4];
    UINT AddressLength;
    BYTE Address[MAX_ADAPTER_ADDRESS_LENGTH];
    DWORD Index;
    UINT Type;
    UINT DhcpEnabled;
    PIP_ADDR_STRING CurrentIpAddress;
    IP_ADDR_STRING IpAddressList;
    IP_ADDR_STRING GatewayList;
    IP_ADDR_STRING DhcpServer;
    BOOL HaveWins;
    IP_ADDR_STRING PrimaryWinsServer;
    IP_ADDR_STRING SecondaryWinsServer;
    time_t LeaseObtained;
    time_t LeaseExpires;
} IP_ADAPTER_INFO, *PIP_ADAPTER_INFO;
where IP_ADDR_STRING (for IpAddressList) is defined as:

typedef struct _IP_ADDR_STRING {
    struct _IP_ADDR_STRING* Next;
    IP_ADDRESS_STRING IpAddress;
    IP_MASK_STRING IpMask;
    DWORD Context;
} IP_ADDR_STRING, *PIP_ADDR_STRING;
where IP_MASK_STRING (for IpMask) is defined as:

typedef struct {
    char String[4 * 4];
} IP_ADDRESS_STRING, *PIP_ADDRESS_STRING, IP_MASK_STRING, *PIP_MASK_STRING;
If I can provide some more information, please let me know.

Regards,
Marcus.
Go to Top of Page

jpizzi
Tomato Guru

USA
642 Posts

Posted - Sep 19 2006 :  12:30:25 AM  Show Profile  Reply with Quote
Given those definitions, the tooltip is correct. String is an attribute of the unnamed structure that is typedef'd to IP_ADDRESS_STRING.

Still doesn't explain the coloring...

Joe Pizzi
Go to Top of Page

Admin
Whole Tomato Software

USA
74 Posts

Posted - Sep 19 2006 :  12:58:08 AM  Show Profile  Reply with Quote
kbh: What build of VA X?
Go to Top of Page

khb
Tomato Guru

Germany
337 Posts

Posted - Sep 19 2006 :  02:08:54 AM  Show Profile  Reply with Quote
1535. But it also appeared in 1534.

Regards,
Marcus.
Go to Top of Page

khb
Tomato Guru

Germany
337 Posts

Posted - Sep 25 2006 :  07:09:16 AM  Show Profile  Reply with Quote
Any more comment on this?

Regards,
Marcus.
Go to Top of Page

jpizzi
Tomato Guru

USA
642 Posts

Posted - Sep 27 2006 :  01:11:56 AM  Show Profile  Reply with Quote
If I paste those three definitions at the top of a code file, then paste your original code into a method near the bottom, (for me) String is not colored as you show it here.

Perhaps there is something else in the header or project that is confusing the parser?

Joe Pizzi
Go to Top of Page

khb
Tomato Guru

Germany
337 Posts

Posted - Sep 27 2006 :  02:52:55 AM  Show Profile  Reply with Quote
Yes, you are right. The class "String" exists in another project of the same workspace. However, it is not used/included in the project where the wrong coloring appears. And if I press Alt-G on the blue String then VA jumps to the correct location, i.e., to IPTypes.h and not to the file where the class String is declared.

Regards,
Marcus.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Oct 03 2006 :  08:07:46 AM  Show Profile  Reply with Quote
i see the same thing. it is enough to simply place your code snippet into a cpp file, and a String class into the matching .h file. i can see why this is confusing VA, since the colouring code has to run very quickly, to colour in real time, it is possible to confuse it.

case=2829

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

khb
Tomato Guru

Germany
337 Posts

Posted - Oct 04 2006 :  04:05:16 AM  Show Profile  Reply with Quote
Thank you for caring about this!

Regards,
Marcus.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Oct 05 2006 :  09:48:21 AM  Show Profile  Reply with Quote
I am here to help plus, I know from my own experience just how irritating these "little" bugs can be.

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

khb
Tomato Guru

Germany
337 Posts

Posted - Oct 06 2006 :  04:41:08 AM  Show Profile  Reply with Quote
Exactly, that's it! It's really a minor thing, but the wrong coloring always distracts me...

Regards,
Marcus.
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