Torque::UUID
by ArchieMD User · in Torque 3D Professional · 04/15/2010 (1:06 pm) · 3 replies
Can you possibly rename this class? There is already a windows type UUID. Visual studio has a fit trying to reconcile the two.
#2
04/15/2010 (2:33 pm)
you know you could refactor this stuff yourself if it bothers you that much, ive never had any problem with it, thats why we have the namespaces concept in the first place, perhaps you should take that C++ 101 course :p
#3
And my comp sci education credentials are actually pretty good, Mr. smartypants.
04/15/2010 (2:37 pm)
Like I said, no need to refactor if the code was written correctly in the first place, which it wasn't. But since I'm such a nice guy, I fixed your bad code for free... don't complain. And my comp sci education credentials are actually pretty good, Mr. smartypants.
Torque 3D Owner ArchieMD User
ArchieMD
You really shouldn't have an issue with Torque::UUID and ::UUID, though I don't see the need to tempt compile errors by redefining a Windows type.
The reason that VS freaks out the minute you try to use any Windows specific code or Windows libs within Torque is that there are a bunch of header files that have "using namespace Torque". Please tell your interns about C++ 101: Never use namespace in a header file!
Here's the fix, which unravels a whole bunch of spaghetti by removing one ill-placed line in core/resourceManager.h:
core/resourceManager.h contains "using namespace Torque"
This then gets included in a dozen other files. Using namespace in the header is the only reason these dozen other files ever compiled, sweet!
1) remove "using namespace Torque" from core/resourceManager.h
2) add "using namespace Torque" to:
sfx/sfxprofile.cpp
postfx/posteffect.cpp
terrain/terrimport.cpp
gfx/bitmap/gbitmap.cpp
gfx/gfxtexturemanager.cpp
forest/ts/tsforestitemdata.cpp
gfx/d3d9/grfd3d9shader.cpp
t3d/tsstatic.cpp