Solved

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

Posted on 2000-03-29
8
155 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
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:bhess1
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
ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…

810 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