Re: Running VB6 exe on Windows 7 64bit

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Second repost, the others did not went thru.
Removed some words.


Hi,

Mike Williams schrieb:
> ... I've Googled around and discovered what data needs to go into the manifest to signify that your app is dpi-aware, but I don't know how to embed the manifest into the compiled VB exe file as MMM can do with its RegFree COM manifests. ...

The manifest file has to be embedded as a resource into the exe. You could use one of the tools (eg xxx or mt) that allows to embed files as resources into the compiled exe. Or you can do this by using the VB Ide and the VisualStudio resource compiler (rc.exe):

- Create a text file with the exension .rc, eg. xyz.rc.
- Put some content in it specifying the resource to embed and
under what name/type.
- Compile the .rc file using rc.exe, tell rc.exe to name the result
with the extension .res, eg. xyz.res
- In the VB6 IDE press Ctl-D or open Project menu and tick "Add file..."
May be its named in other way, because I only have a german version,
where it is called "Datei hinzufügen..."
- Select the xyz.res file in the following dialog and you are done.
From now on the compiled resource from the .res file is embedded
in the compiled exe on every compilation. If you want a changed
.res file, just alter the .rc file and compile it again.

Now for the hard part: what to put into the .rc file. Basically the .rc file among other things (like string tables, version information and so on) can tell the resource compiler which files to include in the compiled resource file. For our manifest we need therefore the file name/path. Thats easy. However for manifests the .rc file also must tell under which name/number and under which type the file shall be embedded (they are special for manifests). Name and type can be get by eg. using xxx: open an exe, that has an embedded manifest, and look with xxx how its named and which type it has.

Ok, and then we need to know in which format this information has to be set in the .rc file (which is a plain text file).

I will do some research, results follow later. In the meantime perhaps Google (eg. "Resource file for embedding manifests") could help.

Oops, just did this myself and got under:

<http://blogs.msdn.com/cheller/archive/2006/08/24/718757.aspx>

The .rc file has to contain following three lines:

#define RT_MANIFEST 24
#define APP_MANIFEST 1
APP_MANIFEST RT_MANIFEST ExeName.exe.manifest

where ExeName.exe.manisfest is the name of the manifest file. One could condense above three lines to one line:

1 24 ExeName.exe.manifest

I believe 1 is the number that tells the resource compiler to embed the file as the *first* resource, and 24 is the type number.

> ... Anyway, here's the manifest (watch for newsgroup text wrap on line 2). I'm not sure whether all of it is required, but I'll test that over the next few days. All I need to do now is figure out how to embed it into my compiled execs and then I won't need to distribute the manifest file with my apps :-)
>
> <asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
> <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings";>
> <dpiAware>true</dpiAware>
> </asmv3:windowsSettings>
> </asmv3:application>
> ...

Thanks for that.

--
Ulrich Korndoerfer

VB tips, helpers, solutions -> http://www.proSource.de/Downloads/
.



Relevant Pages

  • Re: license files
    ... embedding it as a Win32 resource, ... as it doesn't support this (but the command line compiler does). ... > If I compile it from command prompt and include the compiled license file as> an embedded resource it works file, however if I include the compiled> license file in visual studio as an embedded resource and remove the licx> file it throws a system.componentmodel.licenseexception> ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: XP styles on an MFC app
    ... >UNICODE doesn't seem to make a difference. ... It does for VS2003 if you're embedding the manifest in the resource. ...
    (microsoft.public.vc.language)
  • Re: Running VB6 exe on Windows 7 64bit
    ... I've Googled around and discovered what data needs to go into the manifest to signify that your app is dpi-aware, but I don't know how to embed the manifest into the compiled VB exe file as MMM can do with its RegFree COM manifests. ... The manifest file has to be embedded as a resource into the exe. ... Basically the .rc file among other things can tell the resource compiler which files to include in the compiled resource file. ... In the meantime perhaps Google (eg. "Resource file for embedding manifests") could help. ...
    (microsoft.public.vb.general.discussion)
  • Re: HLA v2.x and / or LASM suggestion: Win32 Resources
    ... > With Microsoft's RC compiler, I've just noticed that it's less capable ... > binary resource converted into readable, ... selecting the particular assembler syntax you want to output for. ... > are using that RC compiler via HLA or whatever;)... ...
    (alt.lang.asm)
  • HLA v2.x and / or LASM suggestion: Win32 Resources
    ... With Microsoft's RC compiler, I've just noticed that it's less capable ... binary resource converted into readable, ... possible to create an icon or bitmap on-the-fly in the actual program ... make a separate tool and then all of them can share ...
    (alt.lang.asm)