?
Solved

File path

Posted on 2003-02-28
5
Medium Priority
?
201 Views
Last Modified: 2010-04-01
Hello all,
How do I get the absolute path to the current library?
I want to get the absolute path add it to the file I want to use.
Thanks,
ofrit
0
Comment
Question by:ofritha
[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
  • 2
  • 2
5 Comments
 
LVL 1

Expert Comment

by:iRBIs
ID: 8042058
Use ::GetModuleFileName(), and then cut off filename itself - you get the path
0
 
LVL 4

Expert Comment

by:Demiurg
ID: 8042285
You mean Win32 dll module?

// Dll or application filename
char FileName[256];

GetModuleFileName( Handle, FileName, sizeof(FileName) - 1);
0
 

Author Comment

by:ofritha
ID: 8042301
Thanks iRBIs for your reply,
I did not understand how to use this method. In case my dll's name is LptDLL.dll how do I get its full path to use in the method LoadLibrary.
Thanks,
o
0
 
LVL 1

Accepted Solution

by:
iRBIs earned 80 total points
ID: 8042425
GetModuleFileName() returns full path actually
0
 

Author Comment

by:ofritha
ID: 8051105
Thanks for your help.
Ofrit
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
Suggested Courses

764 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