Any way to build a plugin with BlitzMax?

BlitzMax Forums/BlitzMax Programming/Any way to build a plugin with BlitzMax?

JoshK(Posted 2006) [#1]
Is there any way to compile a module that the exexutable detects, opens, and calls like a dll?


N(Posted 2006) [#2]
You could use a script, but beyond that: no.


ozak(Posted 2006) [#3]
Or do a module for it perhaps? With a fixed interface to BMax, the module could load dll's (or so's) and provide them via the fixed interface.


FlameDuck(Posted 2006) [#4]
BlitzMAX does not support dynamic class loading. But like Noel says, you expose your functionality to a script. Lua perhaps.


GW(Posted 2006) [#5]
Ive successfully created a DLL in Bmax that defined a Type interface and used that type/methods in a Bmax host program.


Dreamora(Posted 2006) [#6]
Yeah and you broke the license with that, risking your BM license.
You are not allowed to create DLLs with BM unless you got a special license by BRL for that.


N(Posted 2006) [#7]
Dreamora is right. Do a search on it.

The other problem is that BlitzMax just wasn't made for it. Statically linking the garbage collector to the DLL and the application really shouldn't be done. Basically, you'll have some pretty bizarre problems with scope/referencing if you do.


GW(Posted 2006) [#8]
Dreamora: where exactly is the license? I cant find it.

Noel: Are you sure? have you experienced this firsthand?


N(Posted 2006) [#9]
GW: To answer your first question: /Your/Path/To/BlitzMax/doc/licenses/bssc.html

Second: Considering I'm the one who actually bothered to ask BRL about this and got a definitive answer, I'd say I'm right.

Edit: Also, probably worth noting that Dreamora is more half-right and 100% right. You're only in violation of the license if you distribute the DLLs created with BMax.


ozak(Posted 2006) [#10]
Wait a minute. You can't create a DLL with BlitzMax in it, but you can create a DLL that's used in blitzmax. And you don't have to use BMax for it. People could do C/C++ dlls instead.


Dreamora(Posted 2006) [#11]
Skidracer clearly stated it.
Thats why BM does not allow you to create DLL although it would only be a change of the GCC commandline options.

http://www.blitzbasic.com/Community/posts.php?topic=53607


N(Posted 2006) [#12]
Thats why BM does not allow you to create DLL although it would only be a change of the GCC commandline options.


There are other issues than simply changing the compiler options. Should do some research before saying things, Dreamora.

Wait a minute. You can't create a DLL with BlitzMax in it, but you can create a DLL that's used in blitzmax. And you don't have to use BMax for it. People could do C/C++ dlls instead.


Nobody said you couldn't use DLLs with BlitzMax, you just can't make them with it.

The plugins for my engine are written in C (obviously, you can use C++ under the hood, but the plugin's interface [one function, not that big of a deal] has to be C).


Dreamora(Posted 2006) [#13]
Noel: I did not say that such DLLs are of any usage as BM has no functionality do define exported functions.


JoshK(Posted 2006) [#14]
Working out a special license with BRL to distribute a dll would not be a problem. Please stick to the technical aspects of the problem.


N(Posted 2006) [#15]
I did manage to talk with Mark this week about dll support.

The problem is in my mind the garbage collector is used to
managing things from the bottom of the call stack so I think
you need to manually initialize and collect from the main of your C application.
He said something about locks on every call
but that sounded a bit heavy handed...