Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. VB6.0 with Registered OCX control

VB6.0 with Registered OCX control

Scheduled Pinned Locked Moved Visual Basic
questioncomwindows-admin
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vhassan
    wrote on last edited by
    #1

    hi. Thanks for previous replies. I have registered control under Administrator privileges on window xp OS. My application use that control and it works fine. I use check if ocx control registered on machine then run otherwise show appropriate message. Now I have guest account (limited privileges) and I am unable to read/write registry values. So my application found no control registered and loads nothing. I want my application to show ocx control because it is already registered by administrator. Please tell me how can I access registered controls. Also tell can I use COM components in this regard?

    D J 2 Replies Last reply
    0
    • V vhassan

      hi. Thanks for previous replies. I have registered control under Administrator privileges on window xp OS. My application use that control and it works fine. I use check if ocx control registered on machine then run otherwise show appropriate message. Now I have guest account (limited privileges) and I am unable to read/write registry values. So my application found no control registered and loads nothing. I want my application to show ocx control because it is already registered by administrator. Please tell me how can I access registered controls. Also tell can I use COM components in this regard?

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      I already told you, the only way to can find out if the control is registered is to NOT use the designer to drop the control on the form. You can only see if the control is registered if you use CreateObject to try and create an instance of the control. You can catch the error by running the CreateObject code right after an On Error Resume Next line and checking for the value of Err.Number.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      V 1 Reply Last reply
      0
      • V vhassan

        hi. Thanks for previous replies. I have registered control under Administrator privileges on window xp OS. My application use that control and it works fine. I use check if ocx control registered on machine then run otherwise show appropriate message. Now I have guest account (limited privileges) and I am unable to read/write registry values. So my application found no control registered and loads nothing. I want my application to show ocx control because it is already registered by administrator. Please tell me how can I access registered controls. Also tell can I use COM components in this regard?

        J Offline
        J Offline
        Jon_Boy
        wrote on last edited by
        #3

        Ditto to Dave, quit asking the same question every day. If you need additional help, reply to your previous post.

        "There's no such thing as a stupid question, only stupid people." - Mr. Garrison

        1 Reply Last reply
        0
        • D Dave Kreskowiak

          I already told you, the only way to can find out if the control is registered is to NOT use the designer to drop the control on the form. You can only see if the control is registered if you use CreateObject to try and create an instance of the control. You can catch the error by running the CreateObject code right after an On Error Resume Next line and checking for the value of Err.Number.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008

          V Offline
          V Offline
          vhassan
          wrote on last edited by
          #4

          Respected replier. I am using RegOpenKeyEx(KeyRoot, KeyName, 0, KEY_ALL_ACCESS, hKey) to open registry key and check whether control is registered or not. Problem is that when I open registry from guest account I always get 5 return code instead of SUCCESS 0. Thank you.

          D 1 Reply Last reply
          0
          • V vhassan

            Respected replier. I am using RegOpenKeyEx(KeyRoot, KeyName, 0, KEY_ALL_ACCESS, hKey) to open registry key and check whether control is registered or not. Problem is that when I open registry from guest account I always get 5 return code instead of SUCCESS 0. Thank you.

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            I already told you, in your other post, that the Guest account has no rights to anything. The only part of the registry it can read in under CURRENT_USER, which won't have the component registration info.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups