Results 1 to 4 of 4

Thread: ActiveX OCX placing DLL in Windows\system32

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2010
    Posts
    8

    Question ActiveX OCX placing DLL in Windows\system32

    I know this has been discussed but can't seem to find a resolution to my issue. I appreciate any advice!

    I have an ActiveX OCX that uses picformat32.dll for some image handling operations. I've packaged up my OCX and referenced components into a CAB for deployment via IE using the VB Package and Deployment Wizard. The browser picks up the OCX and attempts to execute, but fails because the ocx's API call expects picformat32.dll to be in the Windows\system32 folder, and it's not getting placed there.

    I've downloaded the Win SDK and handbuilt my INF and used cabarc to try and solve the problem, but nothing seems to work.

    How to I get the picformat32.dll file - which is included in the CAB - to get copied to the client's Windows\system32 directory?

    I don't want to have the users run a setup.exe program to install it, I was hoping that the browser could do it automatically.

    Sorry for the newbish question. Happy Holidays!

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: ActiveX OCX placing DLL in Windows\system32

    Welcome to the forums.

    1) A setup is the right way to go. It should require elevated privileges which would allow the dll to be installed/placed into the system folder.

    2) Otherwise, place the dll in the same folder as your exe. By default, that's the first path searched for DLLs (as general rule of thumb)

    You don't have issues registering the ocx? That may require elevated privileges also.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2010
    Posts
    8

    Re: ActiveX OCX placing DLL in Windows\system32

    my OCX registers fine, and the browser executes it correctly. The problem is, the part of my code that references picformat fails because that dll isn't in the client's Windows\system32 folder.

    Is there any way to have the browser automatically place the dll in the system32 folder? There are what appear to be lots of controls for this in the CAB INF, from registering DLL's to defining locations where they should be placed.

    PS - this is running in a LAN environment and the IIS server hosting the webpage is Trusted.

  4. #4
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: ActiveX OCX placing DLL in Windows\system32

    Here's another suggestion. Probably not ideal unless you reset the path.
    1) Have your ocx start with Sub Main()
    2) In sub main, make a call to SetDLLDirectory to append a path where the DLL can be found.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

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