New Member
2 Posts
0 Kudos
Registered: ‎12-13-2011
Post 1 of 3

Creating DWFModel object overwrites the calling object.

176 Views, 2 Replies
12-13-2011 08:45 AM

void CDWFGen::smileytongue:ublish(CString DWFFileName)
DWFModel oModel( "", "", "", "", "" );


As soon as oModel is instatiated, the this pointer becomes null.


I can move things around a bit and get past that, but it only changes the block of memory overwritten and therefore the line of code that the crash occurs on.


I tried upgrading from DWFToolkit 7.6 to 7.7, but it only changes the location of the crash ( in this case when we call addProperty.


I've never encountered a bug like this and my experience with accessing COM objects is limited so I am quite literally clueless now. Would anyone be able to offer me advice on resolving this problem or a different way of looking at it that might lead to a resolution?


Thank you,

Randy Garrett

136 Posts
3 Kudos
Registered: ‎06-07-2009
Post 2 of 3

Re: Creating DWFModel object overwrites the calling object.

12-19-2011 07:25 PM in reply to: RSGarrett

Thank you for your questions.


Do you mean as soon as the oModel is instatiated, the memory of the oModel is overwritten   or became null? Does the application use multi-thread? Could you please check the codes if there is any mistake of releasing memory.

Silvia Cao
SW Engineer
Autodesk, Inc.
New Member
2 Posts
0 Kudos
Registered: ‎12-13-2011
Post 3 of 3

Re: Creating DWFModel object overwrites the calling object.

12-20-2011 04:07 AM in reply to: SilviaCao

Thank you for the reply. I have since figured out the trouble. I apologize for not posting sooner.


When we upgraded to version 7.6 and promoted the changes to our version control, some of the files did not get updated. So the changes were only complete on the programmer's, who performed the update, PC. The server had a mix of 7.5 and 7.6 headers even though the libraries and DLLs were built exclusively with 7.6. The short of it, the header described a smaller size for a class than the object created by the DLL so insufficient memory was allocated to the new instance of DWFModel and portions of it overwrite existing data in memory causing the crash.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!