Using dlls

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
rraghul
Newbie
Posts: 10
Joined: Tue May 12, 2009 9:13 am

Using dlls

Post by rraghul » Tue May 12, 2009 9:34 am

I have to access a function in a dll using the macro script. I tried using the 'LibFunc' to get that function in the dll, but it return a message 'Unable to load the dll'. I tried usiong the below given code snippet

LibLoad>C:\Program Files\DM\dm_1.dll,hIE
If>hIE=0
MessageModal>Could not load dm_1.dll, make sure it is in the path or edit the LibLoad line.
Goto>end_script
else
MessageModal>Loaded
LibFunc>hIE,getSequenceID,r
MessageModal>%r%
LibFree>hIE
EndIf
Label>end_script

The 'getSequenceID' is a method in the dll.Please help

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue May 12, 2009 9:46 am

Are you able to send me the DLL?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

rraghul
Newbie
Posts: 10
Joined: Tue May 12, 2009 9:13 am

Post by rraghul » Tue May 12, 2009 10:09 am

We are really sorry.we were not able to send the dll

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue May 12, 2009 10:17 am

Then it is hard for me to comment.

Which version of Macro Scheduler are you using? Is the path correct? What was used to create the DLL? Are you able to load it from other languages, e.g. C++ or VB?

The LoadLibrary function is used by Macro Scheduler to load the DLL. The MSDN documentation may give you some clues:
http://msdn.microsoft.com/en-us/library ... S.85).aspx

If you want me to take a look, you will need to send me the DLL.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

rraghul
Newbie
Posts: 10
Joined: Tue May 12, 2009 9:13 am

Post by rraghul » Tue May 12, 2009 11:04 am

The path of the dll seems to be right and we are using Macro scheduler 11.1. The dll we are calling is created in vb.net 2003.

rraghul
Newbie
Posts: 10
Joined: Tue May 12, 2009 9:13 am

Post by rraghul » Wed May 13, 2009 5:23 am

We are having a class within the dll and the function resides within the class. So could you please help us how to access the functions in the class from Macro Scheduler.(The dll is created in vb.net).

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed May 13, 2009 6:27 am

Sounds like you have created a COM component, not a regular DLL.

LibLoad is for regular C style DLLs. If you can load your DLL with LoadLibrary in any other language then you can load it with Macro Scheduler.

I don't even know if you can create regular DLLs with VB.NET. If you have created a COM component then you might be able to use it with VBScript using CreateObject.

Really without seeing your code I can only guess.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

Provide non-sensitive sample code.

Post by gdyvig » Wed May 13, 2009 10:35 am

Hi rraghul,

Would you be allowed to create a sample dll using the same technique?

Marcus may be able to provide a solution using the sample instead of your real code.

Gale

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts