Make PureBasic DLLs use EXE String and Object Manager

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
mback2k
Enthusiast
Enthusiast
Posts: 257
Joined: Sun Dec 02, 2007 12:11 pm
Location: Germany

Make PureBasic DLLs use EXE String and Object Manager

Post by mback2k »

This request is somehow related to this bug report.

I think it would be great if PureBasic DLLs could automatically use the String and Object Manager of the main PureBasic executable. PureBasic DLLs could export a special method or call a special method of the executable at the time it's attached. This should not break other DLLs or executables, it should just work if both binaries are compiled using PB. This would allow easy usage of string variables as return value and the DLLs, in my case plugins, could also access gadgets created by the executable.

What do you think? Maybe this could be enabled/disabled in the compiler options.
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: Make PureBasic DLLs use EXE String and Object Manager

Post by freak »

Its not just the string manager and object manager. For this to work properly, all of PB's internals would need to be designed to be shareable with dlls. Thats a huge amount of work (and extra code in every exe/dll) just for returning some strings from a dll.
quidquid Latine dictum sit altum videtur
User avatar
mback2k
Enthusiast
Enthusiast
Posts: 257
Joined: Sun Dec 02, 2007 12:11 pm
Location: Germany

Re: Make PureBasic DLLs use EXE String and Object Manager

Post by mback2k »

Oh, I thought that there are some base internals that all other heaps, etc. are based upon. Is it possible that this happens anytime? I just finished converting all my includes to DLLs/plugins that I can re-use in my projects. That allows me to easily update small portions of the code instead of the whole program.

Maybe there could be a special function to move a string, list, etc. pointer to another global heap? BTW-- Are the handles returned by gadget procedures used with #PB_Any global or also local as the custom IDs?
Post Reply