Memory Leak!
[quote user="HDR_Coder"]MSWCharP levelName; levelName = convertStringto_wchar_t(line); DgnModelRefP modelRef = mdlModelRef_getActive();[/quote]
Your conversion function allocates memory, but you never dealloate it.
Use the standard library to avoid that sort of problem!
std::wstring convertStringto_wchar_t(string s) { const size_t cSize = s.length () + 1; wchar_t* wc = new wchar_t[cSize]; mbstowcs(wc, s.c_str (), cSize); std::wstring converted (wc); delete [] wc; return converted; }
Usage...
const std::wstring& levelName = convertStringto_wchar_t (line); ... mdlLevel_getIdFromName(&levid,modelRef,LEVEL_NULL_ID, levelName.c_str ());