Revision history for KeyPgExport


Revision [21877]

Last edited on 2017-08-24 02:52:44 by fxm [Added in the syntax the "byref" optional specifier for returning by reference]
Additions:
{ [[KeyPgSub|sub]] | [[KeyPgFunction|function]] } //proc_name// ( //argumentlist// ) [ [ [[KeyPgByrefFunction|byref]] ] [[KeyPgAs|as]] [[DataType|datatype]] ] **Export**
Deletions:
{ [[KeyPgSub|sub]] | [[KeyPgFunction|function]] } //proc_name// ( //argumentlist// ) [ [[KeyPgAs|as]] [[DataType|datatype]] ] **Export**


Revision [21703]

Edited on 2016-11-15 04:49:10 by fxm [Rewording]
Additions:
(specifier to be put at procedure definition level, forbidden at procedure declaration line level)


Revision [20232]

Edited on 2016-02-10 16:00:09 by DkLwikki [Update link format]
Additions:
{ [[KeyPgSub|sub]] | [[KeyPgFunction|function]] } //proc_name// ( //argumentlist// ) [ [[KeyPgAs|as]] [[DataType|datatype]] ] **Export**
If a function is declared with this clause in a DLL, it is added to the public export table, so external programs can dynamically link to it using [[KeyPgDylibsymbol|Dylibsymbol]].
See the examples on the [[ProPgSharedLibraries|Shared Libraries]] page.
- Not available in the //[[CompilerOptlang|-lang qb]]// dialect unless referenced with the alias ##**""__Export""**##.
- ##[[KeyPgDylibload|Dylibload]]##
- ##[[KeyPgDylibsymbol|Dylibsymbol]]##
- ##[[KeyPgAlias|Alias]]##
Deletions:
{ [[KeyPgSub sub]] | [[KeyPgFunction function]] } //proc_name// ( //argumentlist// ) [ [[KeyPgAs as]] [[DataType datatype]] ] **Export**
If a function is declared with this clause in a DLL, it is added to the public export table, so external programs can dynamically link to it using [[KeyPgDylibsymbol Dylibsymbol]].
See the examples on the [[ProPgSharedLibraries Shared Libraries]] page.
- Not available in the //[[CompilerOptlang -lang qb]]// dialect unless referenced with the alias ##**""__Export""**##.
- ##[[KeyPgDylibload Dylibload]]##
- ##[[KeyPgDylibsymbol Dylibsymbol]]##
- ##[[KeyPgAlias Alias]]##


Revision [15274]

Edited on 2011-09-30 11:08:04 by DkLwikki [Link to ProPgSharedLibraries example instead of duplicating]
Additions:
See the examples on the [[ProPgSharedLibraries Shared Libraries]] page.
Deletions:
{{fbdoc item="filename" value="examples/manual/module/mydll.bas"}}%%(freebasic)
'' mydll.dll
'' in the DLL the function must be declared as export
Function AddNumbers Alias "AddNumbers" _
( _
ByVal operand1 As Integer, ByVal operand2 As Integer _
) As Integer Export
AddNumbers = operand1 + operand2
End Function
%%
{{fbdoc item="filename" value="examples/manual/module/export.bas"}}%%(freebasic)
'' create a function pointer, arguments must be the same type
'' as in the original function
Dim AddNumbers As Function ( ByVal As Integer, ByVal As Integer ) As Integer
Dim hndl As Any Ptr
hndl=DyLibLoad("mydll.dll")
'' find the proc address (case matters!)
AddNumbers = DyLibSymbol( hndl, "AddNumbers" )
'' then call it ...
Print "1 + 2 = " & AddNumbers( 1, 2 )
Sleep
%%


Revision [14533]

Edited on 2009-12-04 08:53:55 by DkLwikki [no need for cdecl, besides it was only in the DLL, not in the caller]
Additions:
'' in the DLL the function must be declared as export
Function AddNumbers Alias "AddNumbers" _
Deletions:
'' in the DLL the function must be declared as CDECL and export
Function AddNumbers cdecl Alias "AddNumbers" _


Revision [13130]

The oldest known version of this page was created on 2008-04-24 15:41:58 by JeffMarshall [no need for cdecl, besides it was only in the DLL, not in the caller]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode