Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Wrong syntax coloring

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
khb Posted - Sep 15 2006 : 02:45:40 AM
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.
12   L A T E S T    R E P L I E S    (Newest First)
khb Posted - Oct 06 2006 : 04:41:08 AM
Exactly, that's it! It's really a minor thing, but the wrong coloring always distracts me...

Regards,
Marcus.
feline Posted - Oct 05 2006 : 09:48:21 AM
I am here to help plus, I know from my own experience just how irritating these "little" bugs can be.
khb Posted - Oct 04 2006 : 04:05:16 AM
Thank you for caring about this!

Regards,
Marcus.
feline Posted - Oct 03 2006 : 08:07:46 AM
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
khb Posted - Sep 27 2006 : 02:52:55 AM
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.
jpizzi Posted - Sep 27 2006 : 01:11:56 AM
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?
khb Posted - Sep 25 2006 : 07:09:16 AM
Any more comment on this?

Regards,
Marcus.
khb Posted - Sep 19 2006 : 02:08:54 AM
1535. But it also appeared in 1534.

Regards,
Marcus.
Admin Posted - Sep 19 2006 : 12:58:08 AM
kbh: What build of VA X?
jpizzi Posted - Sep 19 2006 : 12:30:25 AM
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...
khb Posted - Sep 18 2006 : 09:48:48 AM
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.
feline Posted - Sep 17 2006 : 1:32:11 PM
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.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000