because "a" is a pointer and it get the adresse of cgm.o->m_metafileVersion.... so unless I woke up in a parallel world, where the C++ rules would be different, "long *a" should be equal to "&(cgm.o->m_metafileVersion)"... and it's not (!!!)
errh, the object "o" points to a data structure, a class, from the library I use (it's a lib to read cgm files)
Do you think the lib has a problem? or my EDI (Visual Studio)?
Microsoft Visual Studio 2010
Version 10.0.40219.1 SP1Rel
Microsoft .NET Framework
Version 4.0.30319 SP1Rel
Installed Version: Ultimate
....
Microsoft Visual C++ 2010 01019-532-2002102-70738
Microsoft Visual C++ 2010
....
Hotfix for Microsoft Visual Studio 2010 Ultimate - ENU (KB2548139) KB2548139
This hotfix is for Microsoft Visual Studio 2010 Ultimate - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/2548139.
Hotfix for Microsoft Visual Studio 2010 Ultimate - ENU (KB2565057) KB2565057
This hotfix is for Microsoft Visual Studio 2010 Ultimate - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/2565057.
Microsoft Visual Studio 2010 SharePoint Developer Tools 10.0.40219
Microsoft Visual Studio 2010 SharePoint Developer Tools
Microsoft Visual Studio 2010 Ultimate - ENU Service Pack 1 (KB983509) KB983509
This service pack is for Microsoft Visual Studio 2010 Ultimate - ENU.
If you later install a more recent service pack, this service pack will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/983509.
Security Update for Visual Studio 2010 Shell (Isolated) - ENU (KB2644980) KB2644980
This security update is for Visual Studio 2010 Shell (Isolated) - ENU.
If you later install a more recent service pack, this security update will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/2644980.
I dont see what I have to do with your links.
I tested the lib in a new simple main program, and I have the error too. So Maybe it comes from the lib, but how? The error seems to come from the IDE, nevertheless, right?
Just compare it with your VS2010 installation data.
Originally Posted by ArnaudCas
I tested the lib in a new simple main program, and I have the error too. So Maybe it comes from the lib, but how? The error seems to come from the IDE, nevertheless, right?
The error seems to come from the IDE, nevertheless, right?
what error ? we can have no idea if it is a program bug ( highly plausible ), a compiler bug ( highly unplausible ) or a debugger glitch by just looking at a single line of apparently correct code.
BTW, note that this forum is for visual studio bugs, not yours. As said above, it's highly implausible that the compiler breaks such a basic statement. It's highly plausible that you made a mistake somewhere in your program that reproduces the observed behavior, or that you're improperly using the debugger.
Now, to exclude the possibility of a debugger viewer bug, place an "_ASSERT( a == &(cgm.o->m_metafileVersion) );" at the break point. If this gives a runtime error, ask a moderator to move the thread to the Visual C++ Programming forum; then, post the smallest but complete piece of code capable of reproducing the problem.
doesn't work as it should be, that's why I try to find help here. I don't understand.
I've got a class with a pointer to an object from the lib I use to read CGM files :
Code:
class CGM
{
public:
CCgmObjects *o;
public :
CGM():o(NULL){}
~CGM(){if(o)delete o;}
int load(const char* pFilename);
};
I load it with that function :
Code:
int CGM::load(const char* pFilename){
CConfig *pConfig = new CConfig();
if (pConfig != 0)
{
// create a CgmObjects instance and Load the CGM file
o = new CCgmObjects(pConfig, NULL);
if (o != 0)
{
std::string userFontsDir = ".";
// Load the CGM file
error = o->LoadFile(pFilename);
if (error != 0)
{
printf("cannot open the file");
}
}
}
but, again, it's not a programing problem. It's like if it is a Visual C++'s bug. The visual installation seems to be good...
Maybe there is a param or something in the project configuration?
Bookmarks