Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

help file...

Posted on 1999-01-27
6
Medium Priority
?
229 Views
Last Modified: 2013-11-14
I open my programs helpfile like this:
x=shell("winhelp.exe myhelp.hlp",1)

Now my program somehow try open myhelp-file somewhere else than where my application is. How can I force it to open it where my application is (I don't wanna tell hole path, something like app.path&"myhelp....)?

Thanks in advance!
0
Comment
Question by:majala
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 

Expert Comment

by:Billaban
ID: 1470880
One method would be to use the registry, i.e., include a string value in your installation which you presumable would set to the app path or a subordinate directory.  At runtime you query the registry and build a fully qualified path&filename string - done.

Another would be if U always know where the help file is (relative to the exe) and it cohabitates with the exe (or in a subordinate dir) U can get the path the exe (assorted methods provide this result) ensure that your current path is set to that dir and then just build a relative path to the help files, e.g., "..\helpfiles\myhelp.hlp".

My preference would be to use the registry.  Using installation tools, e.g., InstallShield make this trivial.

HTH
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1470881
Don't bother with using SHELL to pop the help. THis is long way around the horn. Set up your project to reference the help file and it'll pop every time user hits <F1>. Include the help file in the Setup Wizard build and it'll find it automatically. If you *must* pop the help programmatically, don't use SHELL to do it. Use the CommonDialog.ShowHelp method instead. Omit the path and it'll default to the program application directory.

M

0
 

Expert Comment

by:Billaban
ID: 1470882
mark2150 is correct.  For help files you can wire it directly in the app.  Reserve the approach I proposed for other files that your application may need (if any).

I answered your question without pondering the task at hand.  I guess I should have my coffee before going to this web site in the morning.....


0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:majala
ID: 1470883
I put my help file in the projects properties and it did pop up nicely just like you told me. My program deals with databases and when I open database from some other directory than where my app is, somehow when I now press <F1> program tryes to open that help file from that directory. I don't understand why it's like that?
I checked before I opened help file what is value for App.Path and it wasn't changed but still it didn't work.
If I use that CommonDialog.ShowHelp method where I have to put that help files name or how can I set in a runtime (I tryed CommonDialog.InitDir... but didn't help)?
0
 

Expert Comment

by:Billaban
ID: 1470884
Well, I didn't exactly follow you discussion, but if you follow the registration approach that I described previously in order to always render fully qualified paths and filenames u shouldn't have any state dependency problems like (I think) u are describing.  

HTH
0
 
LVL 12

Accepted Solution

by:
mark2150 earned 90 total points
ID: 1470885
Pass App.Path to CommonDialog.ShowHelp. Also, when you select a different directory using the ShowOpen, specify the "NOCHANGEDIR" flag:

cdlOFNNoChangeDir      &H8       Forces the dialog box to set the current directory to what it was when the dialog box was opened.

This will keep the program running from the original application directory as it's default. The .FileName will still have the path to your data file, but the programs *default* will remain right where it was.

M

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…
Suggested Courses

661 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