>This is already working since 7.3.16, but not documented ...
Hello Lutz,
Surprise!
(Still nice secrets inside newLISP!)
Does it work in the same way as the EXE?
Also I think it will not work with the runtime-packed version of the DLL,
which I deliver with hpwNewLISP-plugin.
I have tried it with a runtime-packed EXE and this does not work.
So is it this:
;; When importing a linked win32 dll from win32 programs other
;; then newlisp.exe, than the following statment should be executed
;; directly after importing functions and before any 'dllEvalStr'
;; statment: (dllName <name-of-dll>) where <name-of-dll> is the file
;; name of the linked win32 newlisp dll. This will enable the autoload
;; of linked newlisp source in the dll. When importing to newlisp.exe
;; this is not required.
Init.lsp is no more executed with the new DLL!
Last edited by HPW on Thu Nov 18, 2004 11:59 am, edited 4 times in total.
Is the return-value of dllName = 1 right?
dllName switch it on and the next EvalStr evaluate the attached code.
Should a linked lisp.dll work the same when called with
the normal calling commands? From a new test-plugin
it crashes the hole app. A unlinked renamed newlisp.dll
works at that point. So with linked dll's always call dllName first.
Last edited by HPW on Thu Nov 18, 2004 11:53 am, edited 1 time in total.
The return-value from 'dllName' (1) is an Integer and not a PChar.
When I call newlispEvalStr on a linked DLL without calling dllName first,
it crashed. When I call dllName first, everything works as expected.
When I free the DLL I have to call dllName at first again.
Last edited by HPW on Thu Nov 18, 2004 11:54 am, edited 1 time in total.
The DLL needs to know it's name for a GetModuleHandle() call to Win32. By default this name is "newlisp.dll". When the dll is renamed a call to 'dllName' must be the first call, so subsequent calls to 'newlispEvalStr' work correct. Yes, the return value of 'dllName' should be 1.newLISP does the call to dllName automatically.
The whole feature will stay undocumented. As you say: DLL users should pass source from the parent.
Until now the Dll-name is hardcoded in the wrapper-plugin.
I could also modify the prototype that it works only with a customised plugin named 'newlisp.dll'. (No parameter DllName)
After a second thought, there is no need for further improvment.
It will work with the current plugin, as long the user rename his customised DLL back to 'newlisp.dll'.
Then is there no need for 'dllName' and it work right out of the box. I just tested it.