Problem with reference to System.Drawing

  • Thread starter Thread starter Ladvánszky Károly
  • Start date Start date
L

Ladvánszky Károly

Although I have added a reference to System.Drawing, the following
declaration produces a compile error:

System::Drawing::Bitmap* b; // error C2039: 'Drawing' is not a member of
'System'

This way I can get things working:

#using <System.Drawing.dll>

System::Drawing::Bitmap* b; // OK

Is it a misconcept that setting up a reference versus #using the appropriate
dll are equivalent?

Thanks for any help,

Károly
 
They should be equivalent.

Can you look at the generated command line for the compile in the build log?
Adding the reference should have added the assembly by the way of the /FU
(which stands for Force Using) switch.

Ronald Laeremans
Visual C++ team
 
Here is the command line:

/Od /AI "C:\Documents and Settings\lk\Dokumentumok\Visual Studio
Projects\TiffTest\Debug" /D "WIN32" /D "_DEBUG" /D "_WINDLL" /D "_MBCS" /FD
/EHsc /MTd /GS /Yu"stdafx.h" /Fp"Debug/TiffTest.pch" /Fo"Debug/"
/Fd"Debug/vc70.pdb" /W3 /nologo /c /Zi /clr /TP /FU
"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.dll" /FU
"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll"
 
I've just tried it within a new project and it works fine. My guess is it's
the attached legacy library (libtiff) that disturbs the compilation.Thanks
for your response.

Károly
 
Back
Top