External linkage attribute for public data located in DLL's

Extern Import symbolname[( subscripts)] [ alias "aliasname"] [ as DataType] [, ...]

Is used only on Win32 platforms with the Extern keyword and is needed to access global variables in DLLs. This is due to the level of indirection on any such access: an implicit pointer dereference.

/* mydll.c :
    compile with
      gcc -shared -Wl,--strip-all -o mydll.dll mydll.c

__declspec( dllexport ) int MyDll_Data = 0x1234;

/'  import.bas :
    Compile With
      fbc Import.bas
#inclib "mydll"

Extern Import MyDll_Data Alias "MyDll_Data" As Integer

Print "&h" + Hex( MyDll_Data )

' Output:
' &h1234

Dialect Differences:
Differences from QB:
See also:
Back to Modularizing
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki phatcode