CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2002
    Location
    Malaysia
    Posts
    70

    .ocx Component problem...help!!

    I have make my project to exe file and copy to other computer for testing purpose. But, i got the error message said that the computer lack of some .ocx component. Then, i try to copy the .ocx components to windows system folder and it works.

    I have a question..is that possible to call the .ocx components in the application folder but not from windows system folder?? so, i think the program can be executed in other computer as long as the application folder copied and paste on it...pls correct me if i am wrong....=)

    thanks in advance...

  2. #2
    Join Date
    Aug 2003
    Location
    London
    Posts
    515
    It's best practice to keep OCX and DLL files in the system directory but they don't have to live there.

    When you register a component using regsvr, a class key is created in the registry which will have an entry pointing to the executable code. So you could place the file in...

    D:\Test\OCX\OCXThing.ocx

    ...and from command line...

    regsvr32 D:\Test\OCX\OCXThing.ocx

    Any application that references the OCX would now create the object from the location it has been registered.

  3. #3
    Join Date
    Jan 2002
    Location
    Quebec/Canada
    Posts
    124
    You can drop your OCXs directly in the .exe folder, like if you want to have a vb autorun on a CD, all required ocx need to be in the same folder as the .exe.

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