Embed a file into EXE file in VB6

后端 未结 1 525
时光说笑
时光说笑 2021-01-18 14:31

I am trying to make a setup program in VB6 that will install all the files that are required for the program.

I use a CSV file to store data and read it using:

相关标签:
1条回答
  • 2021-01-18 15:11
    1. Open the project, Add-Ins menu item, open the Add-In manager & double click the VB6 Resource Editor to load it, close manager.

    2. Click Project menu item then Add new Resource File at the bottom. Enter a file name for it & save it in the directory with your code files.

    3. From the Project Explorer tree double click XXX.RES from the new Related Documents node.

    4. Select Add Custom Resource from the toolbar in the window that pops up

    5. Browse to your .csv and add it, you should see it added as CUSTOM\101

    6. It will now be embedded into the exe at compile time. If the file changes, re-add it to the resource, there is a 64k limit per entry.

    7. To load it in code at runtime:

      strCSV = strconv(LoadResData(101, "CUSTOM"), vbunicode)

    0 讨论(0)
提交回复
热议问题