Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

RE: [v8i MDL C++] MDL works in Debugging-mode, but crashes outside of Debugging!?

$
0
0

Please follow the MicroStation Programming forum best practices.

Code Syntax Highlighting

When you post code, use the Forum advanced editor's syntax highlighting tool. That's the icon that resembles a pencil:  Syntax Highlighter

Memory Allocation

In general, use the C++ allocators and deallocators.  You need only use the MDL dlmSystem_api when MicroStation allocates memory for you.  For example...

FindFileInfo* pFileInfo = 0;
mdlFile_findFiles (&pFileInfo, ..., ...);
// Do something with pFileInfo
dlmSystem_mdlFree (pFileInfo);

[quote user="Ines Wieland"]

//pBasic[i]=new CTriangle; //C++ 
pBasic[i] = (CTriangle*) dlmSystem_mdlCalloc(1, sizeof(CTriangle)); //v8i-MDL 
(static_cast<CTriangle*>(pBasic[i]))->operator = (static_cast(*psurf.pBasic[i])); //here it crashes, although this worked fine in C++
break; [/quote]
How is psurf.pBasic[i] allocated?


Viewing all articles
Browse latest Browse all 7260

Trending Articles