?
Solved

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

Posted on 2000-03-29
8
Medium Priority
?
189 Views
Last Modified: 2010-05-02
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:
'Client1.hlp>linkage',CL85
where Client1.hlp is the help file and CL85 is the help context string, if I were to change this to:

'HelpCall.exe>linkage',CL85
(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.
0
Comment
Question by:BarryTice
  • 4
  • 3
8 Comments
 
LVL 4

Accepted Solution

by:
gcs001 earned 200 total points
ID: 2667112
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.

Regards,
Grant.
0
 
LVL 7

Author Comment

by:BarryTice
ID: 2667147
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.
0
 
LVL 32

Expert Comment

by:Brendt Hess
ID: 2667209
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.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 7

Author Comment

by:BarryTice
ID: 2670813
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.
0
 
LVL 4

Expert Comment

by:gcs001
ID: 2670838
Glad it worked.
I'm willing to wait for the extra points.
Let me know when you have them available.

Regards,
Grant.
0
 
LVL 7

Author Comment

by:BarryTice
ID: 2673369
Adjusted points from 24 to 50
0
 
LVL 7

Author Comment

by:BarryTice
ID: 2673370
Here are some points and a nice grade for you, Grant. Thanks for the help! -- b.r.t.
0
 
LVL 4

Expert Comment

by:gcs001
ID: 2677150
Thanks Barry, glad I could help.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month14 days, 7 hours left to enroll

807 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