COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 03-07-2010, 08:02 PM   #1
Astralp
Human being with feelings
 
Join Date: Dec 2009
Posts: 73
Default PluginPath unhandled win32 exception

Is anyone using this successfully on windows? This is a major stumbling block, upon further investigation I've discovered that the underlying win function getModuleFileName() is the cause of the crash, I've tried implementing my own function with it. I've spent hours now trying to figure out what the problem is, it seems like it isn't a valid dll in some way. I've also tried getting the plugin module handle and passing that in, but it makes no difference. Any ideas appreciated, or at the very least an 'It works for me'

WDL_String* path;
pGraphics->PluginPath(path);
string globalFilePath = path->Get();

UPDATE: I've now also tried with a clean copy of IPlug and the example project, and that causes a poof when the PluginPath is run... I hope I'm missing something simple.

Andy

Last edited by Astralp; 03-07-2010 at 08:23 PM.
Astralp is offline   Reply With Quote
Old 03-07-2010, 09:58 PM   #2
Astralp
Human being with feelings
 
Join Date: Dec 2009
Posts: 73
Default

Irrelevant panicking deleted...

Last edited by Astralp; 03-08-2010 at 06:52 AM.
Astralp is offline   Reply With Quote
Old 03-08-2010, 12:52 AM   #3
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by Astralp View Post
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();
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 03-08-2010, 06:48 AM   #4
Astralp
Human being with feelings
 
Join Date: Dec 2009
Posts: 73
Default

Oh my God, now i feel stupid, I thought I was long beyond that type of error... Stumbled by a pointer...

Thanks so much Xenakios!
Astralp is offline   Reply With Quote
Old 03-08-2010, 06:56 AM   #5
RRokkenAudio
Human being with feelings
 
RRokkenAudio's Avatar
 
Join Date: Jun 2009
Location: Buffalo, NY
Posts: 777
Default

I suggest you take a peek at some tutorials, heres a good one:

http://www.hitmill.com/programming/cpp/helloWorld.htm

hehehe j/k, yeah that sucks lol,

~Rob.
RRokkenAudio is offline   Reply With Quote
Old 03-08-2010, 06:59 AM   #6
Astralp
Human being with feelings
 
Join Date: Dec 2009
Posts: 73
Default

hahaha, thanks Rob I will do as soon as I've learned how to brush my teeth.
Astralp is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:07 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.