Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, July 7, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: How do I Declare /import DLL library in VBScript. Use to be able to do it in Legacy script.
Harry
Posts: 13
 
How do I Declare /import DLL library in VBScript. Use to be able to do it in Legacy script.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Jul 10 12:27 PM
I was able to declare Kernel32 in Legacy script but I am not able to do it in VB scripting-? Any suggestion would be greatly appreciated.

Private Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)


Thank you
H
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: How do I Declare /import DLL library in VBScript. Use to be able to do it in Legacy script.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Jul 10 6:55 AM
You can't use Declares on VB Script the same way as within the Legacy Script.
Now, are you trying to use the Sleep function or is this just an example of what you are trying to do?


What I have done in the Past is wrap any API calls in Legacy Scripts, passing any Input and Output parameters via Global Variables and then launching them via Invokes, but I wouldn't do that for a "Sleep" call.


[Reply][Quote]
Harry
Posts: 13
 
Re: How do I Declare /import DLL library in VBScript. Use to be able to do it in Legacy script.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Jul 10 10:13 AM
Hi Raul,
Actually I have used the Declares in Legacy script and they have worked perfectly for me. Sleep was just an example. But you can test it yourself

If you declare it directly below Option explicti it works perfectly in Legacy scripting.
Now I am starting to wonder if there is any kind of hidden book ("Secrets of SLX SDK") somewhere I can get my hands on, where it uncoveres all the unkown -?

---------------------------------------------------------------
option explicit
Private Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)

sub main
.....


Thank you
H
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: How do I Declare /import DLL library in VBScript. Use to be able to do it in Legacy script.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Jul 10 10:33 AM
Quote:
Originally posted by Harry

Hi Raul,
Actually I have used the Declares in Legacy script and they have worked perfectly for me. Sleep was just an example. But you can test it yourself

If you declare it directly below Option explicti it works perfectly in Legacy scripting.
Now I am starting to wonder if there is any kind of hidden book ("Secrets of SLX SDK") somewhere I can get my hands on, where it uncoveres all the unkown -?

---------------------------------------------------------------
option explicit
Private Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)

sub main
.....


Thank you
H


Harry:

As per my previous reply, Indeed you can access API functions this way within Legacy Scripts, your question was about the current VBScript (which is just plain VB Script).
So, if you need to use such a Function in VB Script, you could then:
- Declare the function in LEgacy, with Code to Retreive any needed parameters from Globals, and code to send any return values via Globals.
- From the VB Script, set your Globals, call your Legacy Script via a DoInvoke, and once it returns, check the Results from Global variables.

The other alternative is to create a COM DLL that wraps the API Calls, then from VB Script just instantiate the Object and work with it.

[Reply][Quote]
Harry
Posts: 13
 
Re: How do I Declare /import DLL library in VBScript. Use to be able to do it in Legacy script.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Jul 10 11:19 AM
LoL, Sorry my coffee had not kicked in yet.
Got it! Thx!
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 7/7/2025 12:36:16 PM