Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Declaring DLL functions in WIN98 and WIN2000

Posted on 2002-07-05
9
Medium Priority
?
266 Views
Last Modified: 2010-05-02
Dear All,

I have a module which contains reference to DLL functions and subs. The problem is that my program should be used under WIN98 as well as WIN2000, the problem is the DLL exists in C:\windows\system when it is in WIN98 and C:\WINNT\system32 in WIN2000. I would like to declare the path of the function depending on the version of windows I am using.

Your help is appreciated.
0
Comment
Question by:khaledc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 100 total points
ID: 7132126
You shouldn't define the full path, as windows could be installed anywhere (also on other drives D:, E: etc).
What is your underlying problem?
0
 
LVL 1

Author Comment

by:khaledc
ID: 7132133
I would like to specify the path of the DLL depending on the vesion of windows. I am sure I had seen something similar done before but the problem is that I can't remember the syntax.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7132164
Not at all, Angel is correct. If you install that dll with an installer, the install program should knows where is located the system directory for each windows version.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:khaledc
ID: 7132171
What happened if the files do not exist in the system directory, I am aware of the common path specified of windows but I need to have control over the declaration path.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 7132175
You simply have to ensure that the dll is in the "PATH" (or in the application folder itself), otherwise you have to use LoadLibrary API, while then you cannot DECLARE the function as such.

CHeers
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 7132202
Comment
From: TimCottee  Date: 07/05/2002 07:32AM PST  
If it is in the system folder as described then there is no need to declare the path to it as this is automatically assumed.  

0
 
LVL 3

Expert Comment

by:PNJ
ID: 7132395
Can you use the API calls to get the Windows & System directories?

   Declare Function GetWindowsDirectory Lib "kernel32" _
      Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, _
      ByVal nSize As Long) As Long
     
   Declare Function GetSystemDirectory Lib "kernel32" Alias _
      "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long

Eg:
   Dim sBuffer As String
   Dim iReturn_Value As Long
   
   sBuffer = String$(200, " ")
   iReturn_Value = GetWindowsDirectory(sBuffer, 200)


   
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7138094
"C" grade!, Why?
0
 
LVL 1

Author Comment

by:khaledc
ID: 7139223
Simply because you were the first to answer but not quite what I want.. I was aware of the PATH issue and hence nothing was added to my knowledge, I guess "C" in this situation might have been adequate for just taking an effort.

Cheers.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question