Post by 1180michel on Feb 26, 2024 12:23:22 GMT -5
Hi !
I have a problem because i want to modify a DLL (VM167.dll) with Visual Studio 2022.
The original DLL from Velleman works fine with Liberty Basic, but I want to add some features.
I'm full beginner with C++ and DLL coding... So i try first simply to recompile the original files, and the new dll is named "Essai1.dll".
Of course, I have the source codes of the DLL (to drive a Velleman I/O card VM167),
you can find those in the attached .zip file.
1) I have to remove or rename the main.h and main.cpp wich are in the B-up directory, otherwise Visual Studio finds 2 main.h and 2 main.cpp, and he does'nt like !
2) If i do that (without changing any codes in the other files), VS compile, no errors in the Essai1.DLL, BUT BUT BUT Liberty Basic does'nt recognize this DLL ("Incorrect parameter").
Here are the comments from error.log :
Error log timestamp Monday 26/02/24 17:32:20
Runtime error: Paramètre incorrect. ( OS error 16r57 )
Error(Exception)>>defaultAction
Error(Exception)>>activateHandler: <anUndefinedObject>
Error(Exception)>>handle
Error(Exception)>>signal
Error class(Exception class)>>signal: <'Paramètre incorrect....'>
BasicProgram(Object)>>error: <'Paramètre incorrect....'>
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: <'Paramètre incorrect....'>
OperatingSystemInformation(Object)>>osError: <87>
OperatingSystemInformation(Object)>>osError
OperatingSystemInformation>>getErrorMessage: <193>
DynamicLinkLibrary class(Object)>>osErrorMessage: <193>
DynamicLinkLibrary class(Object)>>osError: <193>
DynamicLinkLibrary class(Object)>>osError
DynamicLinkLibrary class>>open: <'E:\Atmel\Essai1.dll'>
BasicDLL>>from: <'Essai1.dll'> mode: <'DLL'> handle: <'#dll'>
BasicDLL class(BasicFile class)>>from: <'Essai1.dll'> mode: <'DLL'> handle: <'#dll'> 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: <' open "Essai1.dll...'> 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
OK, it's more a problem for a Visual Studio or C++ forum, but if you can help, it should be very appreciated !
I have a problem because i want to modify a DLL (VM167.dll) with Visual Studio 2022.
The original DLL from Velleman works fine with Liberty Basic, but I want to add some features.
I'm full beginner with C++ and DLL coding... So i try first simply to recompile the original files, and the new dll is named "Essai1.dll".
Of course, I have the source codes of the DLL (to drive a Velleman I/O card VM167),
you can find those in the attached .zip file.
They are 2 problems :
2) If i do that (without changing any codes in the other files), VS compile, no errors in the Essai1.DLL, BUT BUT BUT Liberty Basic does'nt recognize this DLL ("Incorrect parameter").
Here are the comments from error.log :
Error log timestamp Monday 26/02/24 17:32:20
Runtime error: Paramètre incorrect. ( OS error 16r57 )
Error(Exception)>>defaultAction
Error(Exception)>>activateHandler: <anUndefinedObject>
Error(Exception)>>handle
Error(Exception)>>signal
Error class(Exception class)>>signal: <'Paramètre incorrect....'>
BasicProgram(Object)>>error: <'Paramètre incorrect....'>
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: <'Paramètre incorrect....'>
OperatingSystemInformation(Object)>>osError: <87>
OperatingSystemInformation(Object)>>osError
OperatingSystemInformation>>getErrorMessage: <193>
DynamicLinkLibrary class(Object)>>osErrorMessage: <193>
DynamicLinkLibrary class(Object)>>osError: <193>
DynamicLinkLibrary class(Object)>>osError
DynamicLinkLibrary class>>open: <'E:\Atmel\Essai1.dll'>
BasicDLL>>from: <'Essai1.dll'> mode: <'DLL'> handle: <'#dll'>
BasicDLL class(BasicFile class)>>from: <'Essai1.dll'> mode: <'DLL'> handle: <'#dll'> 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: <' open "Essai1.dll...'> 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
In other words : what is to change in the source codes to get re-compiled Essai1.dll to work with Liberty basic ?
Thanks a lot !
1180michel