Solved

VB6 Impersonation in Windows 7

Posted on 2011-03-14
12
1,841 Views
Last Modified: 2012-05-11
Hi,

I have a legacy application that contains some VB6 impersonation code on startup.

I am trying to make the application function on Windows 7.  I've tried creating a SHIM and also used the Standard User Analyzer to 'mitigate' issues, with no success.

To be clear, I am right-clicking the application and selecting 'run as administrator'.  There is a chance the application is calling another application, but I'm sure if the first app is run as 'admin' then the rest would follow?

The error message:

ImpersonationVB6:
CreateProcessWithLogonW() failed with error 740

I don't require the application to process the impersonation seqment and simply want the error to go away!

Any ideas?
0
Comment
Question by:jamie77777
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
12 Comments
 
LVL 32

Expert Comment

by:_
ID: 35133531
What about Right-click, run in XP Compatibility Mode?
0
 

Author Comment

by:jamie77777
ID: 35133621
Thanks for the vey quick response, but no, unfortunately that doesn't work...
0
 
LVL 35

Expert Comment

by:torimar
ID: 35134798
Try creating a manifest file for your application.

Here's a sample that I think should work:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <assemblyIdentity version="1.1.0.24" processorArchitecture="X86" name="MyApplication" type="win32"/>
    <description>This is my VB6 application</description>
    <dependency>
        <dependentAssembly>
            <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" 
             version="6.0.0.0" processorArchitecture="X86" 
             publicKeyToken="6595b64144ccf1df" language="*"/>
        </dependentAssembly>
    </dependency>
    <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
        <security>
            <requestedPrivileges>
                 <requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />
            </requestedPrivileges>
        </security>
    </trustInfo>
</assembly>

Open in new window


Copy the above into a text file, adjust the "name" and "description" tags to fit your application, call the file like your application and add a '.manifest', i.e. "myapp.exe.manifest". Copy that manifest file into the application's installation folder next to the executable. Then try launching the program again.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:jamie77777
ID: 35134957
That didn't work, thanks anyway :)  I'm thinking I need to 'fool' the OS into thinking the VB6 impersonation code is working... any more ideas anyone?
0
 
LVL 35

Expert Comment

by:torimar
ID: 35159075
Just came across this one application virtualizer: http://www.evalaze.de/en/Evalaze-Softwarevirtualisierung-Evalazer/

It promises to be able to run "old applications" (even 16-bit ones) under modern operating systems.
Maybe that will also apply to your problem program.
0
 

Author Comment

by:jamie77777
ID: 35159764
Hi torimar, thanks but virtualising the app isn't an option...
0
 

Author Comment

by:jamie77777
ID: 35358648
I'd still really like some help with this. It's to the point of the vendor reengineering the app, a very expensive project..
0
 
LVL 5

Accepted Solution

by:
BrianVSoft earned 500 total points
ID: 35361707
My apologies for responding with a totally non-helpful comment..
But I think you - like us - are out of luck. Microsoft is determined to close all VB6 functionality within a few years and are refusing to "fix" any aspect of VB6 that has already ceased to work.
Our company is facing the expense of re-writing millions of lines of VB6 code (maybe $100,000?)
Every other software language on the planet has had major upgrades - but always in backwards compatible steps that involved an expense of just a few percent of project value.
The approx 30% impost of converting VB6 to DotNet is worthy of a class action by the 10s of thousands of programmers affected. I saw (and joined) a link to such a class action at www vs2020.com - see article on "Microsoft Issues"
0
 

Author Closing Comment

by:jamie77777
ID: 35362740
Yep, figured as much.  I guess the only plus side is the amount of work it'll generate in the industry (I'm clutching at straws here...).  Thanks the information, interesting site.
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month10 days, 19 hours left to enroll

631 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question