Jonathan Worthington <[EMAIL PROTECTED]> wrote: > Hi, > I currently have a file named win32.pasm containing the following:-
> saveall > loadlib P1, 'user32' > dlfunc P2, P1, 'MessageBoxA', 'llttl' > store_global 'MessageBox', P2 > # MANY MORE LINES LIKE THIS > restoreall > I compile that file to a .pbc file, which works out OK. In then have an imc > file that starts like this:- > .sub _MAIN > # Load Win32 library. > load_bytecode "win32.pbc" > # Look up MessageBox function. > find_global $P1, "MessageBox" > Executing that results in the following error:- > Global 'MessageBox' not found > in file '(unknown file)' near line -1 The loaded byte code isn't executed. Its not like .include "win32.pasm". We don't have automagic _init or _load functions yet, but finally it could be: .pcc_sub _init: loadlib P16, 'user32' dlfunc P17, P16, ... store_global ... P17 ... invoke P1 That is after load_bytecode C<_init> is invoked, if its present in the loaded file. For now, you have to call such initialisation manually. That is above init code and: load_bytecode ... find_global P0, "_init" pushtopp invokecc poptopp leo