Export function:
    exports procname

How to export variable in DLL?


thanks!
Posted on 2005-11-29 22:18:02 by northhh
Hi northhh,

Welcome on board.

You cannot export variables from DLLs but you can share them with your main application.
Posted on 2005-11-30 12:20:35 by Vortex
You can always create a function to return the address of the variable or the value of the variable.  ;)
Posted on 2005-11-30 12:23:19 by roticv
variable in MyDLL.DLL

.data
public c MyVar
MyVar db "Message From DLL",0

def file:

LIBRARY MyDLL
EXPORTS MyVar @1 NONAME; ordinal is optional

proto code in main program:

EXTERNDEF C _imp__MyVar:PTR BYTE
MyVar equ <_imp__MyVar>
includelib MyDLL.lib
.code
start:
invoke MessageBox,0,MyVar,MyVar,0

variable is defined like a func with no params

Posted on 2005-11-30 14:40:18 by drizz