Quote:
Originally Posted by Astralp
WDL_String* path;
pGraphics->PluginPath(path);
string globalFilePath = path->Get();
|
You are using an uninitialized pointer *path here. Whatever you may have done and has appeared to work will not really work, it's been pure chance if the code has appeared to run without crashing. You might want to read up on C++ basics, pointers, memory allocation and deallocation etc.
The implementation in IPlug of the PluginPath function is :
Code:
void IGraphicsWin::PluginPath(WDL_String* pPath)
{
GetModulePath(mHInstance, pPath);
}
Which does not allocate memory for the path WDL_String, you have to do it yourself, also cleaning up the string later.
Code:
WDL_String* path=new WDL_String;
...do stuff with *path...
delete path;
This may also be an error, but I am not sure, it's been months since I've last used the C++ stl strings.
string globalFilePath = path->Get();