Solved

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

Posted on 2000-03-29
8
143 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 50 total points
Comment Utility
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
Comment Utility
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:bhess1
Comment Utility
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
 
LVL 7

Author Comment

by:BarryTice
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 4

Expert Comment

by:gcs001
Comment Utility
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
Comment Utility
Adjusted points from 24 to 50
0
 
LVL 7

Author Comment

by:BarryTice
Comment Utility
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
Comment Utility
Thanks Barry, glad I could help.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

762 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now