Issue with Visual Studio 6

Discussion in 'Mixed Languages' started by pottzman, Oct 19, 2022.

  1. pottzman

    pottzman MDL Member

    Dec 8, 2009
    143
    105
    10
    Like others on here I too have used VS6 to produce small programs that will be compatibile with the majority of Windows OSs. I have taken a program that I had previously written in Visual Studio 2005 and have reproduced it in Visual Studio 6. However I have an issue that I can not seem to work out. the original program (VS2005) had a progress bar control however I can not seem to get visual studio 6 to work when I try to add a progress bar. It does not even matter if the progress bar does anything or not, just the fact that I added a progress bar using the resource editor makes the program not run (or more specifically it runs but exits immediately with code 0). If I remove the progress bar then the program starts running correctly. Has anyone ever used progress bars with VS6? Is there more to it than what is involved in VS2005?
     
  2. kebabstorm

    kebabstorm MDL Junior Member

    Aug 3, 2016
    94
    121
    0
    I've definitely 100% had this work on VS6 in some old project of mine, just make sure of these two things:
    a) in "resource.rc" file, check that the control is named "msctls_progress32" and style is "PBS_SMOOTH | WS_BORDER" (other styles probably work too, but this is what I used and known to work)
    b) make sure to include a ".manifest" file as a resource (type 24, id 1) so the common controls are initialized.

    example app.exe.manifest:
    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> 
      <assemblyIdentity version="1.0.0.0"
         processorArchitecture="*"
         name="MyApp"
         type="win32"/> 
      <description>My App Description</description> 
      <!-- Identify the application security requirements. -->
      <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
        <security>
          <requestedPrivileges>
            <requestedExecutionLevel
              level="asInvoker"
              uiAccess="false"/>
            </requestedPrivileges>
           </security>
      </trustInfo>
    <dependency>
        <dependentAssembly>
            <assemblyIdentity
                type="win32"
                name="Microsoft.Windows.Common-Controls"
                version="6.0.0.0"
                processorArchitecture="*"
                publicKeyToken="6595b64144ccf1df"
                language="*"
            />
        </dependentAssembly>
    </dependency>
    </assembly>
    example line in "resource.rc" after including manifest
    Code:
    IDR_RT_MANIFEST         24      DISCARDABLE     "app.exe.manifest"
    and "resource.h"
    Code:
    #define IDR_RT_MANIFEST                 1
     
  3. kebabstorm

    kebabstorm MDL Junior Member

    Aug 3, 2016
    94
    121
    0
    here is a very simple vs6 project example for a dialog with a progress bar.
     

    Attached Files: