DrKnS wrote:Sure it didn't, if you returned address of a local variable.
As mentioned in PluginMenuItem description, all pointers passed through this structure must be valid after returning from GetPluginInfoW, so you can't use local variables. Use static or global ones.
I think I'm starting to understand, thanks.
Now you have a memory leak.
But it works, trallalalla
HelloWorld plugin has a working example of how to do it. MenuGuid is a global variable defined in a separate header, guid.hpp, all you had to do is replace numbers there.
As I'm defining the GUID in Python, and sending it via a function to C++ I can't change and use the defined MenuGuid, right?
So would this work then?
Code: Select all
static GUID *MenuId = new GUID[1];
Or would that be too optimistic?
Code: Select all
linking final.32W.gcc/PythonFAR.dll
d:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../..\libmingw32.a(tlsthrd.o):(.text+0x10): undefined reference to `EnterCriticalSection@4'
d:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../..\libmingw32.a(tlsthrd.o):(.text+0x54): undefined reference to `LeaveCriticalSection@4'
d:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../..\libmingw32.a(tlsthrd.o):(.text+0xbd): undefined reference to `EnterCriticalSection@4'
d:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../..\libmingw32.a(tlsthrd.o):(.text+0xda): undefined reference to `LeaveCriticalSection@4'
d:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../..\libmingw32.a(tlsthrd.o):(.text+0x128): undefined reference to `EnterCriticalSection@4'
d:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../..\libmingw32.a(tlsthrd.o):(.text+0x158): undefined reference to `LeaveCriticalSection@4'
d:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../..\libmingw32.a(tlsthrd.o):(.text+0x17c): undefined reference to `LeaveCriticalSection@4'
d:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../..\libmingw32.a(tlsthrd.o):(.text+0x1ea): undefined reference to `DeleteCriticalSection@4'
d:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../..\libmingw32.a(tlsthrd.o):(.text+0x218): undefined reference to `InitializeCriticalSection@4'
ertr000001.o:(.rdata+0x0): undefined reference to `_pei386_runtime_relocator'
collect2.exe: error: ld returned 1 exit status
../makefile_gcc_target_inc:35: recipe for target 'final.32W.gcc/PythonFAR.dll' failed
mingw32-make.EXE: *** [final.32W.gcc/PythonFAR.dll] Error 1
So that didn't work too well.
So how do I declare a variable that is acceptable? I don't want to waste another day trying to figure this out.
jonib