Extending DLL search path on WinXP?

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

Extending DLL search path on WinXP?

Postby AHodges » Wed Feb 13, 2008 9:17 pm

Hi,
I am using VA 7.5 on WinXP and our Smalltalk code makes use of PlatformFunction calls out to a DLL. I would like to be able to put this DLL where ever I like, rather than having to place it somewhere withing the existing DLL search path. Someone has informed me of a function call that can be used to extend the DLL search path:

BOOL WINAPI SetDllDirectory( __in_opt LPCTSTR lpPathName );

There must be a way I can call this function from my VA 7.5 smalltalk code but I have no idea how to do this? Would I use a PlatformFunction call out to a winapi DLL?
Thanks,
Andy
AHodges
 
Posts: 10
Joined: Tue Nov 14, 2006 9:46 am
Location: Minneapolis, MN

Re: Extending DLL search path on WinXP?

Postby marten » Thu Feb 14, 2008 12:49 am

Reading in the SDK from Microsoft, this call is located in kernel32.dll and is
only valid on platform XP-SP1 (and later ?) and Server 2003 (and later).

Just to play with it (using the ASCII call, not the unicode call):

Code: Select all
  | aPlatformFunction pArray |

  pArray := Array new: 6.
  pArray
    at: 1 put: 'c' ;
    at: 2 put: 'SetDllDirectoryA' ;
    at: 3 put: nil ;
    at: 4 put: 'kernel32.dll' ;
    at: 5 put: (Array with: 'pointer') ;
    at: 6 put: 'bool'.

aPlatformFunction := PlatformFunction fromArray: pArray.

aPlatformFunction callWith: 'c:\test' asParameter
Marten Feldtmann, Principal Smalltalk User, Private
SkypeMe callto://marten.feldtmann
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany

Re: Extending DLL search path on WinXP?

Postby AHodges » Thu Feb 14, 2008 10:24 pm

Thanks Marten! We'll give it a try.
- Andy
AHodges
 
Posts: 10
Joined: Tue Nov 14, 2006 9:46 am
Location: Minneapolis, MN


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest