CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2009
    Posts
    26

    Question How to register an ActiveX ocx file

    Hello All,

    I am registering an ActiveX as follows:

    Code:
    		CString ocxFile = L" /s \"" + ocxFile + L"\""; // for silent install 
    
    		HINSTANCE hInstance = ::ShellExecute(NULL, L"open", L"regsvr32.exe", ocxFile, NULL, SW_HIDE);
    It works fine when user has admin rights . If user does not have admin rights then it can not register. Any solution of it ?
    I am developing in XP and testing in xp and win7
    Last edited by rahul.kulshreshtha; March 10th, 2010 at 01:34 AM.

  2. #2
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: How to register an ActiveX ocx file

    Any solution of it ?
    Make sure the user has admin rights. AFAIK you always need admin rights to register ocx files.

  3. #3
    Join Date
    Nov 2009
    Posts
    26

    Arrow Re: How to register an ActiveX ocx file

    Quote Originally Posted by Skizmo View Post
    Make sure the user has admin rights. AFAIK you always need admin rights to register ocx files.
    Thanks Skizmo,

    I know that it requires admin-rights.
    For that I changed configuration of my MFC project to use UAC that worked but it will run the application in admin mode. So applicaiton will use admin's application data folder and I don't want this. Because my application is user specific so I want if any user is running the application then application should use current user's application data folder.

    Do you have any experience using UAC just for few statements of code instead of whole application level.

    Thanks,
    Rahul

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured