Community
DWF
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Creating DWFModel object overwrites the calling object.

2 REPLIES 2
Reply
Message 1 of 3
RSGarrett
410 Views, 2 Replies

Creating DWFModel object overwrites the calling object.

void CDWFGen::Publish(CString DWFFileName)
{
try
{
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

2 REPLIES 2
Message 2 of 3
SilviaCao
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
PSEB-GE- ACRD PSEB
Autodesk, Inc.
Message 3 of 3
RSGarrett
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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

”Boost

 

”Tips

 

”Services