[gme-users] GME Crash, custom decorator.

Peter Volgyesi peter.volgyesi at vanderbilt.edu
Tue Aug 24 23:36:45 CDT 2004


Your snippet looks good for me. Try to run GME (in the debugger) with the
'-d' option. In this case GME will not try to catch exceptions, so the
debugger will have a chance to find the correct location of the bug.
You can also post your entire decorator project (zipped directory contents
after build/clean).

--
peter

> -----Original Message-----
> From: gme-users-bounces at list.isis.vanderbilt.edu 
> [mailto:gme-users-bounces at list.isis.vanderbilt.edu] On Behalf 
> Of Stefan Marte
> Sent: Monday, August 23, 2004 7:01 PM
> To: gme-users at list.isis.vanderbilt.edu
> Subject: [gme-users] GME Crash, custom decorator.
> 
> I am probably getting annoying, but I have one last problem 
> in my decorator, which again stems from my inexperience with COM.
> 
> I am using the following code to create a new IMgaFCOs 
> collection, and add all children of the model. this seems to 
> work fine at first, but after returning to GME, a crash 
> follows. What am I missing?
> (The code is from the decorator kit, I added the try block 
> and everything inside). I assume I mess up the smart pointers 
> somewhere, but I don't get why. It works btw, when I remove 
> the coll->Append(...) call.
> 
> --- code follows ---
> 
> 	CComPtr<IMgaFCOs> coll;
> 	COMTHROW(coll.CoCreateInstance(OLESTR("Mga.MgaFCOs")));
>         try {
> 		CComQIPtr<IMgaModel> model(self->FCO());
> 		CComPtr<IMgaFCOs> children;
> 		long iter;
> 		long ccount;
> 		int retval;
> 
> 		retval = model->get_ChildFCOs(&children);
> 		retval = children->get_Count(&ccount);
> 		for (iter = 1; iter <= ccount; iter++) {
> 			CComPtr<IMgaFCO> child;
> 			retval = children->get_Item(iter,&child);
> 			retval = coll->Append(child);
> 		};
>         } catch (...){};
> 	*portFCOs = coll.Detach();		
> 
> 
> 	
> 		
> ___________________________________________________________
> Gesendet von Yahoo! Mail - Jetzt mit 100MB Speicher kostenlos 
> - Hier anmelden: http://mail.yahoo.de 
> _______________________________________________
> gme-users mailing list
> gme-users at list.isis.vanderbilt.edu
> http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users



More information about the gme-users mailing list