PC Review


Reply
Thread Tools Rate Thread

Can a variable be used when declaring an API call ?

 
 
=?Utf-8?B?TWlrZSBJYWNvdm91?=
Guest
Posts: n/a
 
      21st Jul 2007
Hi all

When declaring some API calls, is it possible to use a variable for the
"path" ? I have a standalone DLL that would be present in the directory the
worksheet / document is opened in that won't be registered on the system
locally... its functions can be accessed by pointing to the DLL - but I have
only even seen the path to the DLL hardcoded...

Private Declare Function FunctionName Lib "path" Alias "alias" (ByVal N As
Long) As Integer

TIA

Mike
 
Reply With Quote
 
 
 
 
Jim Rech
Guest
Posts: n/a
 
      21st Jul 2007
Have you tested whether you actually need a path? I'm pretty sure that the
current path is checked. If so just the dll's name would suffice.

--
Jim
"Mike Iacovou" <(E-Mail Removed)> wrote in message
news:E324D32D-6CCC-4C9D-98E9-(E-Mail Removed)...
> Hi all
>
> When declaring some API calls, is it possible to use a variable for the
> "path" ? I have a standalone DLL that would be present in the directory
> the
> worksheet / document is opened in that won't be registered on the system
> locally... its functions can be accessed by pointing to the DLL - but I
> have
> only even seen the path to the DLL hardcoded...
>
> Private Declare Function FunctionName Lib "path" Alias "alias" (ByVal N As
> Long) As Integer
>
> TIA
>
> Mike



 
Reply With Quote
 
=?Utf-8?B?TWlrZSBJYWNvdm91?=
Guest
Posts: n/a
 
      23rd Jul 2007
thanks jim

using the declaration with the DLL in the same folder fails with a "not
found" error... I guess it expects either a registered library or an absolute
path...
 
Reply With Quote
 
NickHK
Guest
Posts: n/a
 
      23rd Jul 2007
First you need to confirm if this is an ActiveX DLL or a standard Windows
DLL.
The former:
- Needs registering
- You access it with by create an instance of its exposed classes

The latter:
- Does not need registering
- You call functions with the Declare statement similar to that you have
shown.

As for the error, it may be because one/some files that this DLL requires
are missing. Get a copy of Dependency Walker to check.

NickHK

"Mike Iacovou" <(E-Mail Removed)> wrote in message
newsB57AAFB-4AB7-48B3-BF2A-(E-Mail Removed)...
> thanks jim
>
> using the declaration with the DLL in the same folder fails with a "not
> found" error... I guess it expects either a registered library or an

absolute
> path...



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: declaring variable Peter Morris Microsoft C# .NET 3 15th Jun 2008 07:53 PM
Declaring a Variable =?Utf-8?B?R2FyeSBEb2xsaXZlcg==?= Microsoft Access Form Coding 3 18th Sep 2007 02:26 PM
Declaring a tab name as a variable =?Utf-8?B?dGltbXVsbGE=?= Microsoft Excel Programming 0 25th Jan 2007 03:26 AM
Re: Declaring a variable Allen Browne Microsoft Access Form Coding 1 15th Dec 2006 05:26 PM
Declaring a variable? pgoodale Microsoft Excel Programming 2 2nd Jan 2004 03:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:27 PM.