none
Use Chm file from Resources RRS feed

  • Question

  • I want to use (chm) file from resources folder, I have applied this

    Process.Start(Application.StartupPath & "\Help.chm")               'This working

    Process.Start(Global.RMS.My.Resources.Help)      but i want this

     
    Saturday, December 21, 2019 9:42 AM

Answers

  • For example, with a resource named TestCHM :

    Dim sCHMFile = My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData + "\test.chm"
    Dim b As Byte() = My.Resources.TestCHM
    My.Computer.FileSystem.WriteAllBytes(sCHMFile, b, False)
    Process.Start(sCHMFile)

    • Marked as answer by CompuTechSide Sunday, December 22, 2019 2:03 PM
    Saturday, December 21, 2019 11:17 AM
  • Thankssssssssssssssssssssssssssssss resolved
    • Marked as answer by CompuTechSide Sunday, December 22, 2019 2:03 PM
    Sunday, December 22, 2019 2:02 PM

All replies

  • Hello,

    .chm help file needs to be extracted to run unlike say a image which can be loaded into memory without extracting. 


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Saturday, December 21, 2019 9:57 AM
    Moderator
  • Any example
    Saturday, December 21, 2019 10:14 AM
  • apply this not work

    Dim MemPointer As IntPtr = Runtime.InteropServices.Marshal.AllocCoTaskMem(My.Resources.Help.Length)
    Runtime.InteropServices.Marshal.Copy(My.Resources.Help, StartingIndex, MemPointer, My.Resources.Help.Length)
    Runtime.InteropServices.Marshal.FreeCoTaskMem(MemPointer)

    you have any example

    Saturday, December 21, 2019 10:20 AM
  • Any example

    Hello,

    I said it's not possible so why would I have an example ?


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Saturday, December 21, 2019 11:14 AM
    Moderator
  • For example, with a resource named TestCHM :

    Dim sCHMFile = My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData + "\test.chm"
    Dim b As Byte() = My.Resources.TestCHM
    My.Computer.FileSystem.WriteAllBytes(sCHMFile, b, False)
    Process.Start(sCHMFile)

    • Marked as answer by CompuTechSide Sunday, December 22, 2019 2:03 PM
    Saturday, December 21, 2019 11:17 AM
  • Thankssssssssssssssssssssssssssssss resolved
    • Marked as answer by CompuTechSide Sunday, December 22, 2019 2:03 PM
    Sunday, December 22, 2019 2:02 PM
  • Thankssssssssssssssssssssssssssssss resolved
    And here I thought you wanted to run from memory, not disk.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Sunday, December 22, 2019 2:21 PM
    Moderator