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

x
?
Solved

How can I register/unregister ActiveX controls without administrator privileges programatically?

Posted on 2007-12-03
3
Medium Priority
?
1,430 Views
Last Modified: 2008-02-01
Our old C++/VFP application is setup to allow updating of the individual modules programmatically upon startup.  Some of these modules are ActiveX controls and the process works by calling DllUnregisterServer, replacing the ActiveX control and then calling DllRegisterServer entry points within each DLL.    The initial install works fine upon initial install and  registers the new files.  (even under Vista)

On subsequent updates to these modules however, Vista now brings up the annoying dialog requesting "elevation" for permission and will not update these files.   If I have the user run as Administrator, then none of these problems exist but the application now does not recognize some of the other ActiveX controls and returns a "Class not Registered" error when accessing them.  

So it appears as if I have no good alternative.... so any suggestions you have would be helpful.

Gregg Peele
0
Comment
Question by:GreggPeele
[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
3 Comments
 

Author Comment

by:GreggPeele
ID: 20404984
I think I've solve this issue after much research..  Hopefully it will help others that are attempting to accomplish this...

 

1. The programs that actually registers/unregisters the files can be elevated by using ShellExecuteEx instead of CreateProcess.  Using "runas" as the verb causes the use to be able to allow or reject execution at the elevated status.  This avoids the elevation error.  The following link supplied the way to do this with ShellExecute. I just modified it to use ShellExecuteEx.

 

http://weblogs.asp.net/kennykerr/archive/2006/09/29/Windows-Vista-for-Developers-_1320_-Part-4-_1320_-User-Account-Control.aspx

 

2. It was important that the execution of the program finish before continuing to the next line of code.   Using ShellExecuteEx provides a processID that can be used by WaitforSingleObject to wait for the process to complete before continuing.

 

Note that the user must still approve the escalation but at least it is possible to continue successfully.  

 

Gregg
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 20560253
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

In a recent article here at Experts Exchange (http://www.experts-exchange.com/articles/18880/PaperPort-14-in-Windows-10-A-First-Look.html), I discussed my nine-month sandbox testing of the Windows 10 Technical Preview, specifically with respect to r…
I'm a big fan of Windows' offline folder caching and have used it on my laptops for over a decade.  One thing I don't like about it, however, is how difficult Microsoft has made it for the cache to be moved out of the Windows folder.  Here's how to …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

636 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