Solved

VB Express 2010 - Error with COM object

Posted on 2011-03-01
4
1,660 Views
Last Modified: 2012-05-11
I get an error when I attempt to Debug my app, the error occurs when I try to reference the COM object with this line of code:

Dim jb As New JBRequestProcessor()


The error is:

Retrieving the COM class factory for component with CLSID {0685ACEC-94F4-4828-99FB-DD2AA787E703} failed due to the following error: 800702e4 The requested operation requires elevation. (Exception from HRESULT: 0x800702E4).
0
Comment
Question by:JMO9966
  • 2
4 Comments
 
LVL 8

Expert Comment

by:PagodNaUtak
ID: 35014045
0
 
LVL 12

Accepted Solution

by:
Hairbrush earned 500 total points
ID: 35016154
I presume your application is running on either Windows Vista or Windows 7.  These operating systems come with UAC (User Account Control) which prevents certain operations being carried out by a "standard" user.  If you start VB Express 2010 by right-clicking on the icon and selecting "Run as Administrator" then the code should run fine in your debugger.

It is likely that the application you are developing may need to be run as Administrator when you have finished coding and want to run your .EXE.  The same approach can be used when the user starts the EXE.

It would be a good idea to rewrite your code as follows:

Dim jb as JBRequestProcessor
Try
     jb = New JBRequestProcessor
Catch ex as System.Runtime.InteropServices.COMException
     'handle the error, e.g. display a message box saying that the user should restart the application, running it as Administrator
End Try
0
 

Author Comment

by:JMO9966
ID: 35043516
Thanks, I did have the com object's executable to Run As Administrator, but was still getting the error.

I ended up turning off User Control permissions and now it runs fine.  Not a long term solution but I'm good for now.
0
 
LVL 12

Expert Comment

by:Hairbrush
ID: 35043661
Glad that's worked for you.  Please don't forget to close the question ;o)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

829 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