Pass value to non-running VB program (more points to come)

Sorry for the low points. With EE's server change, I lost about 20 of them. I'll up it as I get more over the coming days.

I have a series of help files called from a large program. The way the program is set up, it requires that the help files be in a specific directory relative to the application, and I can't change that.

I also provide, within the help files, a link as a means to allow the clients to write their own help files to supplement the help files I provide. Each help screen in my file (there are about 15,000) makes a call to the client-created help file, passing the help context string that matches the calling screen.

Given that different clients at different sites have different configurations, these links require that the client's help files appear in the same directory as the help file we provide (or at least a consistent relative path). This irks the clients, as it requires that, when they update their help files, each new help file must be distributed to the proper directory on hundreds (if not thousands) of user PCs.

It would be (relatively) easy to change my 15,000 links to invoke a vb program (or other executable), and have that call the client's customized help file from some central server. But I don't know how to pass that context string value to the vb app so that the vb app can then invoke the correct help screen.

Given that the call to the client's customized help file is:
where Client1.hlp is the help file and CL85 is the help context string, if I were to change this to:

(or some variation thereof), where HelpCall.exe is the vb app, what would I do when writing HelpCall to capture the CL85, so I could pass it as a context string to the custom help file?

In a worst-case scenario, I could modify my help files to write the context string to a text file (or ini or something) and then invoke the vb application, which would read the file to determine the context string to call. But that's a performance issue I don't want to have to face.

Any help would be appreciated and rewarded accordingly (as soon as I get more points!).

-- b.r.t.
Who is Participating?
gcs001Connect With a Mentor Commented:
I'm not sure that I understand your question correctly, but it seems that you want to be able to pass a command line parameter to a VB program.

To access this parameter in your VB program all you need to do is call the
Command() function - this returns any command line parameters you may have passed to the program.

as in:
Dim ContextString as String
ContextString = Command()

You could put this either in your Form Load event or your Sub Main, whichever you're using.

BarryTiceAuthor Commented:
Grant --
It sounds like that's what I'm looking for.

In the context of a DOS command line (if anybody remembers those), I'm looking for the parameters that would have followed the initial command.

If I were to launch my vb program from a DOS command line, passing extra parameters at the end, those parameters are what I want to capture.

If the Command() function will give them to me, that's exactly what I'm looking for.  Thanks! -- b.r.t.
Brendt HessSenior DBACommented:
gcs has it - Command returns a string containing all command line parameters.  It's up to you to parse the string, but that's pretty easy, after all.
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

BarryTiceAuthor Commented:
Grant --
It worked exactly as you said it would. Thanks!

If you're in a hurry to collect points, I'll grade you on this at the current point level. If you're in no hurry, I'll wait until EE gets its point distribution working again, and take this up to 50. (By my count, I should have 49 today. But I only have 24, and they're all devoted to this question.)

Thanks again! -- b.r.t.
Glad it worked.
I'm willing to wait for the extra points.
Let me know when you have them available.

BarryTiceAuthor Commented:
Adjusted points from 24 to 50
BarryTiceAuthor Commented:
Here are some points and a nice grade for you, Grant. Thanks for the help! -- b.r.t.
Thanks Barry, glad I could help.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.