473,387 Members | 1,585 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Codebase/htmlHelp files problem

I seem to have a small problem using html help files in .NET.

I created a program.chm file, and this one is located at the same location
of the .NET program.exe.

So I want to use following code top point to my help file:
Assembly myAssembly = Assembly.GetExecutingAssembly();
string sCodeBase=myAssembly.CodeBase;
mHelpFile=Path.ChangeExtension(sCodeBase,"chm");

And use it like this:
helpProvider1.HelpNamespace=mHelpFile;

Help.ShowHelp(this,mHelpFile,HelpNavigator.TableOf Contents);
Help.ShowHelpIndex(this, mHelpFile);

Now comes the funny thing:

mHelpFile turns out to be something like this:
"file://D:/MyPath/program.chm"
Note the "file://" part!!!!

If I use winhlp files "file://D:/MyPath/program.hlp" then this works fine
but if I use the html v1.xx help files "file://D:/MyPath/program.chm" then
this does not show!
But if I remove the "file://" and have "D:/MyPath/program.chm" then it
works fine!

Does anyone know how to detect and extract this "file://" part?
The Path class does not seem to have a method to extract the "xxxx://"
parts.
I could create my own method but I prefer to use the .NET functions.


Jul 21 '05 #1
2 1198
>....
mHelpFile turns out to be something like this:
"file://D:/MyPath/program.chm"
Note the "file://" part!!!!

If I use winhlp files "file://D:/MyPath/program.hlp" then this works fine
but if I use the html v1.xx help files "file://D:/MyPath/program.chm" then this does not show!
But if I remove the "file://" and have "D:/MyPath/program.chm" then it
works fine!

Does anyone know how to detect and extract this "file://" part?
The Path class does not seem to have a method to extract the "xxxx://"
parts.


I have current not so nice fix that works:

Assembly myAssembly = Assembly.GetExecutingAssembly();
mHelpFile=myAssembly.CodeBase;
if (mHelpFile.ToLower().StartsWith("file:///")) {
mHelpFile=mHelpFile.Substring(8,mHelpFile.Length-8);
}
mHelpFile=Path.ChangeExtension(mHelpFile,"chm");
helpProvider1.HelpNamespace=mHelpFile;
I someone have a better sulution, please tell me. :-)
Jul 21 '05 #2
A new problem has emerged:

helpProvider1.HelpNamespace="\\Myserver/program files/skyscan/test.chm"

It doesn't want to open my help file if I use "\\Myserver"
It does open it if I have a drive mapping "q:/program
files/skyscan/test.chm"

Anyone have a sollution for this?
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Søren \Pengman\ Pedersen | last post by:
Dear all My setup is this: A RMI server application running with the codebase property as follows: -Djava.rmi.server.codebase=http://localhost/Java/Rmiserver/ this location contains the...
7
by: Ruslan Popov | last post by:
Hi, I am trying to prevent an assembly being loaded from GAC and instead want it loaded from the application's base directory. However, the assembly always gets loaded from GAC. How to have it...
0
by: Elaine | last post by:
I have a truly curious problem with HtmlHelp and Sibling Mode in Visual C++ ..Net 2003 in an MFC app. Sibling mode allows the help viewer to display on top of the app, but if the app is clicked,...
2
by: BentleyInc | last post by:
I wrote a DownloadRequestHandler to be used in http://server/DownloadDir and I've made the correct IIS settings for DownloadDir. Currently I'm having problem loading up some dependent assemblies....
2
by: | last post by:
I seem to have a small problem using html help files in .NET. I created a program.chm file, and this one is located at the same location of the .NET program.exe. So I want to use following...
2
by: Tim | last post by:
I have placed my assemblies in different folders (as per project req.). I am using config file with <codebase> option and registry with codebase option (COM Interop) to enable the runtime to locate...
2
by: xamman | last post by:
hi there, i am trying to use a .NET assembly from a Cscript.exe .vbs (i.e. from COM) and could not get my .vbs to use my .net dll (gives a 'file not found error') unless i used the /codebase...
0
by: Gauls | last post by:
Hi, I have webservice application that uses some assemblies whoes version number keeps changing and are stored in some folder on the same machine as my webservice. Every Time the assembly version...
1
by: G Gerard | last post by:
Hello I have written some help files using Html Help Workshop version 4.74.8702 I use the following code to launch the chm file Declare Function HtmlHelp Lib "HHCtrl.ocx" Alias "HtmlHelpA" _...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.