?
Solved

How should I properly compile VB6 programs to run on Windows 7?

Posted on 2011-03-25
14
Medium Priority
?
1,316 Views
Last Modified: 2012-05-11
I have run into an issue with my vb6 applications on windows 7.  Because I am using the Intuit SDK, I need to compile using x86 and need to run the programs under a standard user account NOT with 'run as administrator'.

I'm not sure what I am doing wrong,  but I have 2 problems with this:

1 - I can't figure out where to set the project to compile using x86.
2 - When I compile my programs and then try to run under a standard user account, there is a windows security shield on my icon, indicating it will run as administrator, and when I run, it does as for the admin password.  I can't figure out how to get around this.

Thanks for any help you can offer on either issue!

Lynn
0
Comment
Question by:lthames
[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
  • 7
  • 6
14 Comments
 
LVL 5

Accepted Solution

by:
MedievalWarrior earned 2000 total points
ID: 35217399
Hi,

1) All VB6 programs compile for 32 bit. There is nothing you have to do to change this so rule out this option.
2) Double check and make sure your executable name doesn't contain keywords like Setup, Install because UAC uses keywords for compatability with installers that were developed without the new manifests.

To resolve problem two you want to create a manifest for your application that uses uses "AsInvoker" this will disable virtualization and ensure your executable always runs with standard privileges.

Step 6: Create and Embed an Application Manifest (UAC)
http://msdn.microsoft.com/en-us/library/bb756929.aspx
<?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="X86"
     name="IsUserAdmin"
     type="win32"/> 
  <description>Description of your application</description> 
  <!-- Identify the application security requirements. -->
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel
          level="AsInvoker"
          uiAccess="false"/>
        </requestedPrivileges>
       </security>
  </trustInfo>
</assembly>

Open in new window

0
 

Author Comment

by:lthames
ID: 35217579
I clicked on your link and it has instructions listed as for Vista. . . can I assume this is relative to Windows 7 as well?

Thanks!!!!!!!
0
 

Author Comment

by:lthames
ID: 35217621
Also, I am not seeing instructions for VB6 . . . only Visual Studio.  

0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 5

Expert Comment

by:MedievalWarrior
ID: 35217623
Yes the concept is the same for Vista or later...

Lets assume your executable is named Project1.exe then you want to create manifest file in the same location as your executable and add the code.

Ex.
C:\App\Project1.exe
C:\App\Project1.exe.manifest

Add the code into Project1.exe.manifest file using notepad.
<?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="X86"
     name="Project1"
     type="win32"/> 
  <description>Description of your application</description> 
  <!-- Identify the application security requirements. -->
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel
          level="AsInvoker"
          uiAccess="false"/>
        </requestedPrivileges>
       </security>
  </trustInfo>
</assembly>

Open in new window

0
 

Author Comment

by:lthames
ID: 35217701
THANKS!   Trying that now.
0
 

Author Comment

by:lthames
ID: 35218402
I tried this and I'm not sure if it DIDN'T work, or if it worked but exposed another problem.

Now when I try to run the program (which DOES NOT have the security shield on the icon), it says "The requested operation requires elevation"

Any thoughts?
0
 

Author Comment

by:lthames
ID: 35218436
Could it be that some component of my application requires elevated permissions?  Hmmm that would be a problem because Intuit QB SDK's require you NOT to have required elevations!

Thanks again for all of your help.
0
 
LVL 5

Expert Comment

by:MedievalWarrior
ID: 35218464
Yes. It sounds like the UAC cache behavior so have you tried moving your files to another location or performing log off/ log on / reboot.
0
 

Author Comment

by:lthames
ID: 35218512
log off/log on/reboot several times.  

moving the files to a public location maybe?  They are currently on a c:\clients folder.



0
 
LVL 5

Expert Comment

by:MedievalWarrior
ID: 35218525
Sorry. I meant to try either log off and back on or reboot not all three ;)
0
 
LVL 5

Expert Comment

by:MedievalWarrior
ID: 35218622
Did you change line 5 of the manifest code to reflect the name of your executable file without the .exe extension.
name="Project1" <--- name of your exectuable

Open in new window

0
 
LVL 82

Expert Comment

by:David Johnson, CD, MVP
ID: 35219170
have you ever tried to use visual studio express to compile your applications?
0
 

Author Comment

by:lthames
ID: 35222652
Warrior,

The manifest worked . . . . I just had some offending code in a module of my application that I wasn't even using.  I decided to delete everything from a public utilities module that I wasn't using and it solved ALL of my problems!

Thanks so much for all of your help.

Lynn
0
 
LVL 5

Expert Comment

by:MedievalWarrior
ID: 35222746
Great! Good luck with your project
0

Featured Post

Introducing Priority Question

Increase expert visibility of your issues by participating in Priority Question, our latest feature for Premium and Team Account holders. Adjust the priority of your question to get emergent issues in front of subject-matter experts for help when you need it most.

Question has a verified solution.

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

By default the complete memory dump option is disabled in windows . If we want to enable the complete memory dump for a diagnostic purpose, we have a solution for it. here we are using the registry method to enable this.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Introduction to Processes
Suggested Courses

770 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