Newbie at windows

N

netzorro

Hi people,
I'm new in the windows platform. Always worked in unix.

I have to add an existing project parametrization with an ini file.

Easy but the problem is the location of the ini file.

If I just open it with the name if detaults to the windows directory.

Is there a global variable the know where the application is and so I can
relatively locate the file?

The real app is an ISAPI DLL

I'm trying using a console app and using the GetPrivateProfileString()

Thanks
Diego
 
N

Noah Roberts

netzorro said:
Hi people,
I'm new in the windows platform. Always worked in unix.

I have to add an existing project parametrization with an ini file.

Easy but the problem is the location of the ini file.

If I just open it with the name if detaults to the windows directory.

Is there a global variable the know where the application is and so I can
relatively locate the file?

The real app is an ISAPI DLL

I'm trying using a console app and using the GetPrivateProfileString()

Study the standard function getenv() and use the appropriate,
implementation defined, environment variable to get your home or
configuration directory.
 
R

red floyd

netzorro said:
Hi people,
I'm new in the windows platform. Always worked in unix.

I have to add an existing project parametrization with an ini file.

Easy but the problem is the location of the ini file.

If I just open it with the name if detaults to the windows directory.

Is there a global variable the know where the application is and so I can
relatively locate the file?

The real app is an ISAPI DLL

I'm trying using a console app and using the GetPrivateProfileString()

And your C++ Language question is? GetPrivateProfileString() is part of
the Win32 API, not part of C++. ISAPI, DLL, "windows directory", and
"ini file" are not part of the C++ language.

Try an MS newsgroup, see the FAQ for this group, in particular FAQ 5.9:
http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.9
 
N

netzorro

Sorry so, Trying to find the best way to get the program location in
windows.

Wrong group so

Sorry

Diego
 
P

Phlip

netzorro said:
Hi people,
I'm new in the windows platform. Always worked in unix.

In future, find a good windows newsgroup. (And oodles of example code, real
open-source projects, and C++ wrapper libraries like WTL...) This newsgroup
is only qualified to discuss C++ the language. For example.
Is there a global variable the know where the application is and so I can
relatively locate the file?

Unfortunately yes. Given int main(int argc, char ** argv), argv[0] is the
name of your application, possibly with its path. Use _splitpath() to remove
the filename, and you may have the path.
The real app is an ISAPI DLL

I'm trying using a console app and using the GetPrivateProfileString()

The various ISS modules have their own systems to abstract application
paths, and to store persistent data.

Unfortunately, everything in this post is off-topic except 'main()'. That
means others here will not be able to tell if I have lead you astray. They
are quite familiar with this effect for C++ itself. Try another newsgroup.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,169
Latest member
ArturoOlne
Top