Computing.Net > Forums > Programming > VB6 question

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

VB6 question

Reply to Message Icon

Name: tonysathre
Date: March 3, 2008 at 14:39:26 Pacific
OS: XP x64
CPU/Ram: AMD X2 6400+ 4GB
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: March 3, 2008 at 17:39:16 Pacific
Reply:

I'd suggest using something like .ini files instead of regisrty entries, but it's your call.


0

Response Number 2
Name: tonysathre
Date: March 3, 2008 at 19:28:35 Pacific
Reply:

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


0

Response Number 3
Name: Razor2.3
Date: March 3, 2008 at 19:55:18 Pacific
Reply:

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.


0

Response Number 4
Name: tonysathre
Date: March 3, 2008 at 20:19:40 Pacific
Reply:

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.


0

Response Number 5
Name: StuartS
Date: March 4, 2008 at 02:25:41 Pacific
Reply:

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


0

Related Posts

See More



Response Number 6
Name: tonysathre
Date: March 4, 2008 at 14:44:50 Pacific
Reply:

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.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Script Convert Excel SS t... Delete a row has two prim...



Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: VB6 question

easy VB6 questions www.computing.net/answers/programming/easy-vb6-questions/5807.html

Simple VB6 question www.computing.net/answers/programming/simple-vb6-question/14752.html

VB6 Question www.computing.net/answers/programming/vb6-question/7840.html