|
Post by gidiom2 on Oct 6, 2019 4:58:23 GMT -5
Hi all, just returned to LB after a very long break, but only use linux/wine to run LB. Using standard windows dlls is no problem but trying image322.dll, nviewlib.dll and other dlls written for LB4, the dlls can not be found. The dlls are in the same folder as the LB program code and are registered in the wine configuration. I have also copied the dlls to the wine windows/system32 folder as well, but still fails.
Do any LB/wine users have the same problem and are the dlls not compatible with wine? Native LB451 code runs perfectly with wine but introducing non-standard dlls (which work with windows) causes problems.
TIA for any information.
|
|
|
Post by Rod on Oct 6, 2019 5:20:25 GMT -5
I don't have Linux but I know that John has used ImageMagic.dll without any problem. Here is his demo page. www.diga.me.uk/IMdemonstration.htmlI cant recall if folks have had problems with these .dlls before. Why not print DefaultDir$ and StartupDir$ as the first two lines of code in your program so we can see where Liberty thinks it is and so where the .dlls should be. Show us a line of code calling one of the .dlls
|
|
|
Post by gidiom2 on Oct 6, 2019 8:31:13 GMT -5
I don't have Linux but I know that John has used ImageMagic.dll without any problem. Here is his demo page. www.diga.me.uk/IMdemonstration.htmlI cant recall if folks have had problems with these .dlls before. Why not print DefaultDir$ and StartupDir$ as the first two lines of code in your program so we can see where Liberty thinks it is and so where the .dlls should be. Show us a line of code calling one of the .dlls Thanks for responding, but John does not call a dll in that program, he runs an ImageMagick exe.
Code below demonstrates that the dll can be opened for input from its current location but can not be opened as a dll.
Maybe someone with a deeper understanding of wine and/or compiling dlls will know the answer. Maybe I've made an obvious mistake that I can't see.
The outcome will determine if I remain with LB or return to Python.
print "DefaultDir$ = ";DefaultDir$ print "StartupDir$ = ";StartupDir$ ' Result ' DefaultDir$ = C:\Program Files (x86)\Liberty BASIC v4.5.1\LB451_programs\ImageEDITing ' this is where image322.dll is located ' StartupDir$ = C:\Program Files (x86)\Liberty BASIC v4.5.1\
open "image322.dll" for input as #tst 'file opens so path is found notice "image322.dll opened for input!" close #tst notice "#tst (image322.dll) closed!"
open "image322.dll" for dll as #im1 'Fails, Module not found close #im1
end
|
|
|
Post by metro on Oct 6, 2019 8:39:56 GMT -5
It's late here and I'm on my tablet I've been using Lb with wine for years with very few issues Can you attach the DLL here ill see if I have any luck.
|
|
|
Post by gidiom2 on Oct 6, 2019 9:01:51 GMT -5
It's late here and I'm on my tablet I've been using Lb with wine for years with very few issues Can you attach the DLL here illness if I have any luck. Thanks, the dll was written by Alyce and I see it is now image323.dll. Just change the reference in my code .
|
|
|
Post by Rod on Oct 6, 2019 14:19:03 GMT -5
I think the problem is that you are using program files directory which is heavily protected by windows. Put your program and the .dll in something simple like c:/basic/my program put the .dlls there too.
|
|
|
Post by metro on Oct 6, 2019 18:13:33 GMT -5
I am short on time ATM but initial testing throws an error. I have even used multiple copies I have of the Dll back to News Letter 129. same error.
EDIT: copied code and Dll to my Win10 laptop..... no error. so a Linux(Wine) issue.
Error log timestamp Monday 07/10/19 07:08:53 AM
Runtime error: Module not found. ( OS error 16r7E )
Error(Exception)>>defaultAction Error(Exception)>>activateHandler: <anUndefinedObject> Error(Exception)>>handle Error(Exception)>>signal Error class(Exception class)>>signal: <'Module not found. ( ...'> BasicProgram(Object)>>error: <'Module not found. ( ...'> BasicProgram>>terminateRun: <anError> [] in BasicProgram>>errorHandlerBlock ExceptionHandler>>evaluateResponseBlock: <aBlockClosure> for: <anError> [] in ExceptionHandler>>handle: ProtectedFrameMarker(BlockClosure)>>setUnwind: <aBlockClosure> BlockClosure>>invisibleEnsure: <aBlockClosure> ExceptionHandler>>handle: <anError> ExceptionHandler>>findHandler: <anError> Error(Exception)>>activateHandler: <anExceptionHandler> Error(Exception)>>handle Error(Exception)>>signal Error class(Exception class)>>signal: <'Module not found. ( ...'> DynamicLinkLibrary class(Object)>>osError: <126> DynamicLinkLibrary class(Object)>>osError DynamicLinkLibrary class>>open: <'C:\users\laurie\Appl...'> BasicDLL>>from: <'image323.dll'> mode: <'DLL'> handle: <'#im'> BasicDLL class(BasicFile class)>>from: <'image323.dll'> mode: <'DLL'> handle: <'#im'> owner: <aBasicProgram> length: <anUndefinedObject> [] in OpenCommand>>using: [] in BasicProgram>>begin ExceptionHandler>>evaluateProtectedBlock: <aBlockClosure> [] in ExceptionHandler>>activateDuring: ProtectedFrameMarker(BlockClosure)>>setUnwind: <aBlockClosure> BlockClosure>>invisibleEnsure: <aBlockClosure> ExceptionHandler>>activateDuring: <aBlockClosure> ExceptionHandler class>>handle: <anError class> with: <aBlockClosure> during: <aBlockClosure> BlockClosure>>on: <anError class> do: <aBlockClosure> BasicProgram>>begin BasicProgram>>run [] in BasicSourcePane>>run BasicCompiler class>>compileFromString: <'''Added March, 2004: ...'> notify: <aBasicSourcePane> ifSuccess: <aBlockClosure> BasicSourcePane>>run BasicSourceWindow>>run BasicEditorModel>>run: <aToolbarButton> BasicEditorModel(Object)>>perform: <#run:> with: <aToolbarButton> ToolbarButton>>triggerClickedEvent Message>>perform NotificationManager>>runPendingEvents NotificationManager>>runEventLoop Message>>perform Message>>evaluate Process>>safelyEvaluate: <aMessage> Process>>evaluate: <aMessage>
|
|
|
Post by Rod on Oct 7, 2019 1:19:37 GMT -5
Can’t test. But does / instead of \ and checking the exact capitalisation help. Windows cares not about / or \ or capitalisation, but what about Wine? Also my point about Program Files(x86) directory still stands. You should not be trying to place,read,or write files in that directory.
|
|
|
Post by gidiom2 on Oct 7, 2019 2:36:08 GMT -5
Can’t test. But does / instead of \ and checking the exact capitalisation help. Windows cares not about / or \ or capitalisation, but what about Wine? Also my point about Program Files(x86) directory still stands. You should not be trying to place,read,or write files in that directory. Thanks metro and Rod,
Had tried all of those to no effect, including creating C:\basic\ to place the program but wine does not seem to care.
|
|
|
Post by Chris Iverson on Oct 7, 2019 10:52:08 GMT -5
Just to confirm, does the DLL work if a full path is specified?
If so, then I think we're looking at a difference in the way the WINE layer handles the LoadLibrary API call(which is what actually loads the DLL).
|
|
|
Post by gidiom2 on Oct 7, 2019 11:36:26 GMT -5
Just to confirm, does the DLL work if a full path is specified? If so, then I think we're looking at a difference in the way the WINE layer handles the LoadLibrary API call(which is what actually loads the DLL).
Thanks for your input Chris,
Quoting the full path makes no difference - open "c:/windows/system32/image323.dll" for dll as #im1
I assume that's what you mean, error is still module not found. I had already tried that too but have checked again just to be sure. Oh, the dll is in system32 as well as the program path.
|
|
|
Post by tenochtitlanuk on Oct 8, 2019 17:09:29 GMT -5
Yup, I've never got other than the built-in Windows dlls to work on my Linux/Wine/LB installations. Use ImageMagick as an exe not the dll version. Tried the same file locations and addresses as you have. I have no code which relies on such nowadays- but I keep a Windows 10 installation for the odd task -eg running an interface to my weather station which needs a custom dll.
|
|
|
Post by gidiom2 on Oct 9, 2019 3:59:39 GMT -5
Yup, I've never got other than the built-in Windows dlls to work on my Linux/Wine/LB installations. Use ImageMagick as an exe not the dll version. Tried the same file locations and addresses as you have. I have no code which relies on such nowadays- but I keep a Windows 10 installation for the odd task -eg running an interface to my weather station which needs a custom dll. Thanks.
Having now looked at the dll in a hex editor, I see there are calls to other windows dlls which do not exist within wine (to be expected!) so I think it is not possible to use most, if not all of the dlls written for use with LB. Not what I wanted to see really but I will need to return to Python. The dll I chose for testing is not one that I actually need, it was chosen at random but it answers my question. I should have seen the light earlier. Sorry to responders for any wasted time.
|
|
|
Post by metro on Oct 9, 2019 5:27:51 GMT -5
Hi all, just returned to LB after a very long break, but only use linux/wine to run LB. Using standard windows dlls is no problem but trying image322.dll, nviewlib.dll and other dlls written for LB4, the dlls can not be found. The dlls are in the same folder as the LB program code and are registered in the wine configuration. I have also copied the dlls to the wine windows/system32 folder as well, but still fails.
Do any LB/wine users have the same problem and are the dlls not compatible with wine? Native LB451 code runs perfectly with wine but introducing non-standard dlls (which work with windows) causes problems.
TIA for any information. There are multiple 3rd party dlls that have worked for me over the years , I have been using Linux/Wine for maybe 8 years. still no expert but I get by.
lbbrowse3.dll, msghook.dll SdDataGrid.dll , SQ3_4_LB.dll to name a few. try adding these in the attached Zip to your folder, I think it was only the two that were required. if you still get an error let us know. (works for me now)
|
|
|
Post by gidiom2 on Oct 9, 2019 6:27:31 GMT -5
Thanks metro,
print "DefaultDir$ = ";DefaultDir$ print "StartupDir$ = ";StartupDir$ ' Result ' DefaultDir$ = C:\Program Files (x86)\Liberty BASIC v4.5.1\LB451_programs\ImageEDITing ' this is where image322.dll is located ' StartupDir$ = C:\Program Files (x86)\Liberty BASIC v4.5.1\
open "image323.dll" for input as #tst 'file opens so path is found notice "image323.dll opened for input!" close #tst notice "#tst (image323.dll) closed!"
open "image323.dll" for dll as #im1 notice "image323.dll opened for dll!" close #im1
end
Those two dlls existed in wine system32 (I think I added them in the past) but copying the ones from the zip, into the same folder as the program resulted in SUCCESS! I haven't checked the versions but I can progress now.
For anyone following thread, I've added a line indicating successful opening of dll.
|
|