|
Post by DJLinux on Jun 27, 2011 10:21:01 GMT -5
Download: ApiPlugin.zipAPI Plugin
Param descriptors:
API_INT API_STRING API_ARRAY Load a library *.dll (or *.exe) with exported function and / or methods
lib% = Import( libname$ ) Define a function or method.
function% = Define ( lib%, CDECL (TRUE / FALSE), return type, name$, Set params for the function or method (optional).
SetInt ( param% ) SetFloat ( param# ) SetString ( param$ ) SetArray ( params%() ) Call a function or method.
Call( function% ) Get a return value from function (optional)
Value% = GetInt() Value# = GetFloat() Value$ = GetString() Values%() = GetArray(nItems%) Helpers (advanced)
Get address (*int) of integer.
pointer% = IntPtr(var%) Get address (*char) of string.
pointer% = StrPtr(var$) Get string from pointer (*char).
var$ = PtrStr(pointer%) Get integer from pointer on pointer (**int).
value% = IntPtrPtr(pointer%)
Example:' original MessageBox declaration from "user32.dll" ' int MessageBoxA(HWND hWnd,LPCTSTR lpText,LPCTSTR lpCaption,UINT uType)
const MB_OK = 0 const MB_ICONERROR = 16 const MB_ICONQUESTION = 32 const MB_ICONINFORMATION = 64
dim hUser32% = Import("user32.dll") dim hMessageBox% = Define(hUser32%, FALSE, API_INT, "MessageBoxA", API_INT, API_STRING, API_STRING, API_INT, 4) SetInt(0) ' hWnd SetString("Text") ' lpText SetString("Caption") ' lpCaption SetInt(MB_ICONQUESTION) ' uType Call(hMessageBox%)
dim Result% = GetInt()
|
|
lal7777
Posts

if all.knowledge = orange then: seed = mankind.knowledge: grow(seed,time): endif
Posts: 88
|
Post by lal7777 on Jun 27, 2011 18:15:24 GMT -5
Do you think that you could add a checkbox feature?
|
|
|
Post by Wayne Rayner on Mar 16, 2012 8:58:48 GMT -5
Could this be used to use a library like SDL?
|
|
|
Post by DJLinux on Mar 17, 2012 9:27:53 GMT -5
Could this be used to use a library like SDL? NO but it's only the half of the story. Primary you can load any dynamic lib and call every CDECL o STDCALL exported function or sub. The problem are all the different types of arguments. I don't see the right point for mixing Basic4GL with SDL. If you need SDL it's recomment to write a pure SDL plugin. This plugin is a tiny workaround to load a WINDOWS dll and call few functions. For example hide the mouse, move the window ... Why do you need SDL with Basic4GL ? Joshy
|
|
|
Post by Darkjester on Jul 2, 2012 20:48:19 GMT -5
This is badass.
|
|