Loading external dll
Moderators: Dorian (MJT support), JRL
Loading external dll
Hi,
Can i load external dll and use api's of that in my script?
If yes where can i find information on registering the dll to macros?
Can i load external dll and use api's of that in my script?
If yes where can i find information on registering the dll to macros?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
If the DLL uses the stdcall convention and requires nothing more complicated than strings and/or numerics, then, yes you can load it and call functions within it. To do so you need to use the following Macro Scheduler functions:
LibLoad
LibFunc
LibFree
LibLoad
LibFunc
LibFree
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Hi,
Thanks that answers my question. I am evaluating macro scheduler 10. I am more interested in the image recognition feature. Is there a help on what are all the commands of macro scheduler i can use for image recognition automation? Can i use waitWindowTitle>winImg.bmp? After this for verification, can i get the text inside the appeared image? Any information on this would be of great help.
Thanks that answers my question. I am evaluating macro scheduler 10. I am more interested in the image recognition feature. Is there a help on what are all the commands of macro scheduler i can use for image recognition automation? Can i use waitWindowTitle>winImg.bmp? After this for verification, can i get the text inside the appeared image? Any information on this would be of great help.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
The best place to get a good grounding on image recognition is probably:
http://www.mjtnet.com/blog/2007/02/20/h ... cognition/
http://www.mjtnet.com/blog/2007/02/20/h ... cognition/
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Hi Marcus,
I tried the following code to use a function in the external dll:
LibLoad>F:\myLib.dll,hnd
LibFunc>hnd,LibRegister,check,ref:MacroEngine,ref:Handle
MessageModal>check
LibFree>hnd
variable check should contain a string. But while running this code i got
"access violation error". I have previously used this dll with another tool so it is completely tested. Please let me know if i am using macro functions right?
I tried the following code to use a function in the external dll:
LibLoad>F:\myLib.dll,hnd
LibFunc>hnd,LibRegister,check,ref:MacroEngine,ref:Handle
MessageModal>check
LibFree>hnd
variable check should contain a string. But while running this code i got
"access violation error". I have previously used this dll with another tool so it is completely tested. Please let me know if i am using macro functions right?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Is the DLL using the stdcall calling convention? What are the parameter types? How many parameters? two? Strings or numbers? ref is used to pass numeric values by reference, but I don't see MacroEngine or Handle set to a numeric value. If you don't need them preset but want to get a value back just use 0:
LibFunc>hnd,LibRegister,check,ref:0,ref:0
Results will be in check, check_1 and check_2
If you can't get it working I would need to see the DLL docs or the DLL source to tell you whether it will work and what you need to do.
LibFunc>hnd,LibRegister,check,ref:0,ref:0
Results will be in check, check_1 and check_2
If you can't get it working I would need to see the DLL docs or the DLL source to tell you whether it will work and what you need to do.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Remove the "Ref:" which is for passing numbers by reference. These are char pointers, not numbers, and char pointers are references.
But - what is the calling convention? Is it stdcall?
But - what is the calling convention? Is it stdcall?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Hi Marcus,
I tried the following code:
LibLoad>myLib.dll,hLib
Remark>Registering with framework lib
LibFunc>hLib,LibRegister,rc,MacroEngine,Handle
If i debug the first line macro scheduler message box pops up saying
'Access violation at address 00000015.Read of address 00000015'
And if i place the debugger pointer at the 3rd line, i get the messages
'Unable to load the dll'. Yes dll is using stdcall calling convention and developed using visual studio 6. Also i have placed the dll in system32 folder so i am not giving the complete path.
Thanks for your support
I tried the following code:
LibLoad>myLib.dll,hLib
Remark>Registering with framework lib
LibFunc>hLib,LibRegister,rc,MacroEngine,Handle
If i debug the first line macro scheduler message box pops up saying
'Access violation at address 00000015.Read of address 00000015'
And if i place the debugger pointer at the 3rd line, i get the messages
'Unable to load the dll'. Yes dll is using stdcall calling convention and developed using visual studio 6. Also i have placed the dll in system32 folder so i am not giving the complete path.
Thanks for your support
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Something is wrong if it is crashing when you try to load it. What does the DLL try to do on initialization?
Are you able to send me the DLL and it's documentation (or even source code)? Send to my email address in my sig.
Are you able to send me the DLL and it's documentation (or even source code)? Send to my email address in my sig.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?