views:

194

answers:

1

Is it possible to change the syntax coloring for a new file type (let's call it .XYZ files) in Visual Studio (VC++) 6, and if so, how?

I see where you can edit the color for comments, numbers, operators, etc. in Tools/Options/Format, but it seems to apply only to known filetypes like .C, .H, .CPP, .HPP, etc.

In this particular case, XYZ are really C++ under the covers, so i really just need to be able to apply C++ formatting rules to .XYZ.

+1  A: 

Have a look at the registry under:

HKEY_CURRENT_USER\Software\Microsoft\Devstudio\6.0\Text Editor\Tabs/Language Settings\C/C++] "FileExtensions"="cpp;cxx;c;h;hxx;hpp;inl;tlh;tli;rc;rc2"

and just add your extension to the end. Close VC6 first though.

Vince
@Vince - +1, that makes sense, but i added it and it didn't work. However, i found HKCU\Software\Microsoft\DevStudio\6.0\Build System\Components\Platforms\Win32 (x86)\Tools\32-bit C/C++\Input_Spec and added `.XYZ`. Restarting VC6 hilighted XYZ as CPP (good) but wanted to compile them as CPP (bad, we have a custom build step for XYZ). But after removing `.XYZ` from Input_Spec the build was fixed and hilighting was still CPP style. So, accidentally it worked. I suspect the changed forced a change in the OPT file (or somewhere) that wasn't reverted by undoing the reg change.
bill weaver
Wish there was a better method than "by accident."
bill weaver