Click here to Skip to main content
16,016,168 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: __property oddity Pin
James T. Johnson2-May-02 14:23
James T. Johnson2-May-02 14:23 
GeneralRe: __property oddity Pin
Nish Nishant2-May-02 14:29
sitebuilderNish Nishant2-May-02 14:29 
GeneralRe: __property oddity Pin
James T. Johnson2-May-02 14:34
James T. Johnson2-May-02 14:34 
GeneralRe: __property oddity Pin
Tom Archer2-May-02 14:33
Tom Archer2-May-02 14:33 
GeneralRe: __property oddity Pin
Nish Nishant2-May-02 14:47
sitebuilderNish Nishant2-May-02 14:47 
GeneralRe: __property oddity Pin
Tom Archer2-May-02 15:06
Tom Archer2-May-02 15:06 
GeneralRe: __property oddity Pin
James T. Johnson2-May-02 14:37
James T. Johnson2-May-02 14:37 
GeneralRe: __property oddity Pin
Neil Van Note2-May-02 20:45
Neil Van Note2-May-02 20:45 
Actually, depending on how you arrange this code, it comes back with varying results.

If you move the variable declarations to the top of the class, most of the problems disappear. This doesn’t give me a whole lot of faith in MC++. There seems to be a conflict here though, but nothing is jumping out at me as anything being wrong with the class structure.

Note: Variable names should not start with an underscore in C/C++; those are reserved for compiler vendors.

The following compiles.

public __gc class OptimizedBitmap : public IDisposable
{
private:
	bool		disposed;
	HDC		hdc;
	HBITMAP		hbitmap;
	Graphics	*graphics;
	Bitmap		*bitmap;

	OptimizedBitmap()
	{
	}

public:
	OptimizedBitmap(Graphics *g, Bitmap *bmpToCopy ) :
	  disposed(false)
	{
		// Copy bitmap
	}
	~OptimizedBitmap(void)
	{
		Dispose();
	}
	void Dispose() {
		// Free resources
	}
	__property Graphics* get_Graphics()
	{
		return Graphics::FromImage(bitmap);
	}
	__property Bitmap* get_Bitmap()
	{
#if 0
		return dynamic_cast<System::Drawing::Bitmap*>(bitmap->Clone());
#else	// or
		return new System::Drawing::Bitmap(bitmap);
#endif
	}
};

GeneralRe: __property oddity Pin
James T. Johnson2-May-02 20:50
James T. Johnson2-May-02 20:50 
GeneralRe: __property oddity Pin
Neil Van Note2-May-02 21:26
Neil Van Note2-May-02 21:26 
GeneralRe: __property oddity Pin
Tom Archer3-May-02 4:14
Tom Archer3-May-02 4:14 
GeneralRe: __property oddity Pin
James T. Johnson3-May-02 4:44
James T. Johnson3-May-02 4:44 
GeneralRe: __property oddity Pin
Rama Krishna Vavilala3-May-02 4:28
Rama Krishna Vavilala3-May-02 4:28 
GeneralRe: __property oddity Pin
James T. Johnson3-May-02 4:48
James T. Johnson3-May-02 4:48 
GeneralRe: __property oddity Pin
Neil Van Note3-May-02 7:41
Neil Van Note3-May-02 7:41 
GeneralGeneral MC++ Info Pin
Brian Delahunty1-May-02 4:17
Brian Delahunty1-May-02 4:17 
GeneralRe: General MC++ Info Pin
Albert Pascual1-May-02 7:06
sitebuilderAlbert Pascual1-May-02 7:06 
GeneralRe: General MC++ Info Pin
Brian Delahunty1-May-02 7:31
Brian Delahunty1-May-02 7:31 
GeneralRe: General MC++ Info Pin
Albert Pascual1-May-02 7:34
sitebuilderAlbert Pascual1-May-02 7:34 
GeneralRe: General MC++ Info Pin
Brian Delahunty1-May-02 7:39
Brian Delahunty1-May-02 7:39 
GeneralRe: General MC++ Info Pin
Albert Pascual1-May-02 7:40
sitebuilderAlbert Pascual1-May-02 7:40 
GeneralRe: General MC++ Info Pin
Brian Delahunty3-May-02 2:21
Brian Delahunty3-May-02 2:21 
GeneralRe: General MC++ Info Pin
Michael P Butler1-May-02 22:51
Michael P Butler1-May-02 22:51 
GeneralRe: General MC++ Info Pin
Brian Delahunty3-May-02 2:22
Brian Delahunty3-May-02 2:22 
GeneralRe: General MC++ Info Pin
Tom Archer1-May-02 14:40
Tom Archer1-May-02 14:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.