Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2011-03-25
14
Medium Priority
?
1,325 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 83

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

Independent Software Vendors: 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!

Question has a verified solution.

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

Make the most of your online learning experience.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
This Micro Tutorial will give you a basic overview of Windows Live Photo Gallery and show you various editing filters and touches to photos you can apply. This will be demonstrated using Windows Live Photo Gallery on Windows 7 operating system.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Suggested Courses

618 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