Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I'm in the process of learning VB6. I need to be able to specify an external EXE (iw3mp.exe) and set it's path as a variable, or write it's path to the registry. When the form loads, I would like it to check for the file's existence, if it's not found, prompt the user to browse to it, and set the selected file as a variable, and write it's path to the registry. On any subsequent loads of the form, I would like it to read that registry key, and determine if that file exists. If it does, do nothing, if it doesn't , prompt the user again.
Thanks,
Tony

I thought about an INI file as well. I just started learning VB6 last friday, and haven't used API's yet, but I'll have a look into the GetPrivateProfileString API.
Thanks

Using the Windows API's are a pain, as you need to define the functions and structs (or, as we're talking about VB, types) yourself, but if you need to use function X, chances are someone else has already done the grunt work.
If not, try to get a C/C++ programmer to do it.

Yeah, in that link you provided there was a sample module using that API. I'm playing with it now seeing how it works.
This is a more difficult task than I thought it was going to be.
What about reading the path from a plain text file? That would probably be easier than using an API to read an INI file.
Another thing I could do is read the registry value for the installpath key which contains the full path.

If you do a search on Google for the particular API you want you will find that someone else has already done it.
I have used a lot of API calls in VB6 and never yet failed to find an API example for VB6 using Google. Its all there if you look.
Stuart

I found an easier way to do it using app.path. I'll have the installer do the registry reading to find where the application is installed, and have it install to that directory. It may not be the best way to do it, but it certainly seems like the easiest.

![]() |
Script Convert Excel SS t...
|
Delete a row has two prim...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |