Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Help files .NET applications

Help files .NET applications

Scheduled Pinned Locked Moved C#
csharpjavahelpquestion
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sudhakar Pasupunuri
    wrote on last edited by
    #1

    What kind of help files does .NET support?? I am converting my application from java to C#.. In the older case i have a .hlp file for providing help..But i found C# doesnt support .hlp file..so i decided to convert this to .chm file.. So before i do this i want to know whether C# really doesnt support .hlp files or not??? I have tried MSDN and couldnt get any info saying it doesnt support .hlp..instead i found many articles on .chm.. Thanks in advance Sudhakar

    H 1 Reply Last reply
    0
    • S Sudhakar Pasupunuri

      What kind of help files does .NET support?? I am converting my application from java to C#.. In the older case i have a .hlp file for providing help..But i found C# doesnt support .hlp file..so i decided to convert this to .chm file.. So before i do this i want to know whether C# really doesnt support .hlp files or not??? I have tried MSDN and couldnt get any info saying it doesnt support .hlp..instead i found many articles on .chm.. Thanks in advance Sudhakar

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      It supports CHM, but you can use whatever help you want if you provide the implementation by handling the HelpRequested event (or overriding OnHelpRequested in derivative controls). IMO, CHMs are much better anyway. It's a better interface, easier to write for (you can use any HTML too and the HTML Help Workshop, where writing .hlp files is bit more of a pain).

      Microsoft MVP, Visual C# My Articles

      S 1 Reply Last reply
      0
      • H Heath Stewart

        It supports CHM, but you can use whatever help you want if you provide the implementation by handling the HelpRequested event (or overriding OnHelpRequested in derivative controls). IMO, CHMs are much better anyway. It's a better interface, easier to write for (you can use any HTML too and the HTML Help Workshop, where writing .hlp files is bit more of a pain).

        Microsoft MVP, Visual C# My Articles

        S Offline
        S Offline
        Sudhakar Pasupunuri
        wrote on last edited by
        #3

        Thanks Stewart.. I already had the code for the above events.. but i have the problem with the following.. -------- I have my old application in java(Microsoft VJ++) and this application uses winhelp file(.hlp) to provide help for the application. This application has a form and a help control on that..when i clicked it , it displays the help related to the form..Internally the code looks like this.. Help help = new Help(); help.showHelp(string helpfilename.hlp, string topic id); Ex; helpfilename looks like "x.hlp" Topic id as "906" --- I have converted the above application to .NET framework..I am using C# as the language.. So i want to know the equivalent function for the above.. I tried using the following code as a replacement for the above. HelpNavigator navigator = HelpNavigator.Topic; System.Windows.Forms.Help.ShowHelp(this, "helpfilename.hlp", navigator, "topic id"); So i used this code: HelpNavigator navigator = HelpNavigator.Topic; System.Windows.Forms.Help.ShowHelp(this, "x.hlp", navigator, "906"); But the above code is not poping up anything.. Can anyone plz help me.. Thanks Sudhakar

        H 1 Reply Last reply
        0
        • S Sudhakar Pasupunuri

          Thanks Stewart.. I already had the code for the above events.. but i have the problem with the following.. -------- I have my old application in java(Microsoft VJ++) and this application uses winhelp file(.hlp) to provide help for the application. This application has a form and a help control on that..when i clicked it , it displays the help related to the form..Internally the code looks like this.. Help help = new Help(); help.showHelp(string helpfilename.hlp, string topic id); Ex; helpfilename looks like "x.hlp" Topic id as "906" --- I have converted the above application to .NET framework..I am using C# as the language.. So i want to know the equivalent function for the above.. I tried using the following code as a replacement for the above. HelpNavigator navigator = HelpNavigator.Topic; System.Windows.Forms.Help.ShowHelp(this, "helpfilename.hlp", navigator, "topic id"); So i used this code: HelpNavigator navigator = HelpNavigator.Topic; System.Windows.Forms.Help.ShowHelp(this, "x.hlp", navigator, "906"); But the above code is not poping up anything.. Can anyone plz help me.. Thanks Sudhakar

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #4

          As I mentioned before, the help classes in .NET only work with HTML Help 1.x files (.chm). If you want to open a WinHelp file (.hlp), you should P/Invoke the WinHelp[^]:

          [DllImport("user32.dll", CharSet=CharSet.Auto)]
          private static extern bool WinHelp(
          IntPtr hWndMain, // Handle to main form: use form's Handle property
          string lpszHelp, // .hlp filename
          [MarshalAs(UnmanagedType.SysUInt)] IntPtr uCommand, // HELP enum constants
          [MarshalAs(UnmanagedType.SysUInt)] IntPtr dwData); // User-defined data

          The last two params are processor-dependent types, which is why they are defined each as an IntPtr. To pass these values correctly, you'd use whatever int or long (doesn't really matter) and pass them to the constructor for the IntPtr like so:

          IntPtr param1 = new IntPtr(/* some value */ 1);

          This doesn't make a pointer to one - just wraps the value 1 in a processor-dependent integer. This is for portability on 32- and 64-bit processors (something a lot of examples fail to take into account). You can find the enum constants (and what to pass into dwData depending on the constant used for uCommand) in the documentation for the WinHelp function at http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/functions/winhelp.asp[^]. These constants are defined in WinUser.h in the Platform SDK (installed by default with VS.NET).

          Microsoft MVP, Visual C# My Articles

          S 1 Reply Last reply
          0
          • H Heath Stewart

            As I mentioned before, the help classes in .NET only work with HTML Help 1.x files (.chm). If you want to open a WinHelp file (.hlp), you should P/Invoke the WinHelp[^]:

            [DllImport("user32.dll", CharSet=CharSet.Auto)]
            private static extern bool WinHelp(
            IntPtr hWndMain, // Handle to main form: use form's Handle property
            string lpszHelp, // .hlp filename
            [MarshalAs(UnmanagedType.SysUInt)] IntPtr uCommand, // HELP enum constants
            [MarshalAs(UnmanagedType.SysUInt)] IntPtr dwData); // User-defined data

            The last two params are processor-dependent types, which is why they are defined each as an IntPtr. To pass these values correctly, you'd use whatever int or long (doesn't really matter) and pass them to the constructor for the IntPtr like so:

            IntPtr param1 = new IntPtr(/* some value */ 1);

            This doesn't make a pointer to one - just wraps the value 1 in a processor-dependent integer. This is for portability on 32- and 64-bit processors (something a lot of examples fail to take into account). You can find the enum constants (and what to pass into dwData depending on the constant used for uCommand) in the documentation for the WinHelp function at http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/functions/winhelp.asp[^]. These constants are defined in WinUser.h in the Platform SDK (installed by default with VS.NET).

            Microsoft MVP, Visual C# My Articles

            S Offline
            S Offline
            Sudhakar Pasupunuri
            wrote on last edited by
            #5

            Thanks Stewart.. I have tried with the approach u mentioned and i am able to display my help successfully.. Initially i thought we can use .NET classes to display winhelp files.. But with ur comments i realized we have to use windows api's to display these files.. Thanks Once again.. Sudhakar

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups