Results 1 to 16 of 16

Thread: [2005] Problems using custom VB6 controls

  1. #1

    Thread Starter
    Fanatic Member alkatran's Avatar
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    860

    [2005] Problems using custom VB6 controls

    I am trying to use some vb6 controls in a vb2005 app. Whenever I try to add the control to a form I get an error box "Failed to import the ActiveX control. Please ensure it is properly registered."

    Oddly, I can use other custom controls. It seems to be an issue with this particular ocx. I tried recompiling the ocx but that had no effect. What are common reasons for this to happen?
    Last edited by alkatran; Apr 24th, 2008 at 01:20 AM. Reason: [2005] not included by the option button, apparently
    Don't pay attention to this signature, it's contradictory.

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Problems using custom VB6 controls

    try copying the given OCX file to the system32 directory on your machine. Then run regsvr32 from a command prompt on the OCX file (this registers it for COM).

    Then see if you can add the control in VB.NET

  3. #3

    Thread Starter
    Fanatic Member alkatran's Avatar
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    860

    Re: Problems using custom VB6 controls

    I still get the same error when I try to add it to a form after doing that.

    I unregistered the dll, made a copy in system32, registered it there, added one of its control to .net, then tried to place it (error!).

    If it helps, the reference keeps appearing twice in the project references. The first seems fine, but the second says <The system cannot find the reference specified>. Deleting any combination of the references doesn't change the outcome (they just come back).
    Last edited by alkatran; Apr 23rd, 2008 at 06:12 PM.
    Don't pay attention to this signature, it's contradictory.

  4. #4

    Thread Starter
    Fanatic Member alkatran's Avatar
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    860

    Re: Problems using custom VB6 controls

    Do I need to reference all the controls' dependencies as well, or something? This is incredibly confusing to me. It should work.
    Don't pay attention to this signature, it's contradictory.

  5. #5
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2005] Problems using custom VB6 controls

    do you have no problems using this OCX in a VB6 application?

  6. #6

    Thread Starter
    Fanatic Member alkatran's Avatar
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    860

    Re: [2005] Problems using custom VB6 controls

    Quote Originally Posted by kleinma
    do you have no problems using this OCX in a VB6 application?
    None at all. I'm prototyping moving a wizard from VB6 to vb.net, to see what type of compatibility issues come up (like this one).
    Last edited by alkatran; Apr 24th, 2008 at 01:08 PM.
    Don't pay attention to this signature, it's contradictory.

  7. #7
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2005] Problems using custom VB6 controls

    I haven't had any problems consuming ActiveX controls (dll or ocx) in my VB applications.

    If you can post the OCX file, I can have a look at it. If its something you can't post, then im not sure what other advise I can give.

  8. #8

    Thread Starter
    Fanatic Member alkatran's Avatar
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    860

    Re: [2005] Problems using custom VB6 controls

    The control actually has a quite a few dependencies; the fastest way would probably just be to install the application and get it that way. I can email a link to you.

    Of course... There's always the "Would you like to try my snake game?" aspect of installing software. lol
    Don't pay attention to this signature, it's contradictory.

  9. #9
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2005] Problems using custom VB6 controls

    Quote Originally Posted by alkatran
    The control actually has a quite a few dependencies; the fastest way would probably just be to install the application and get it that way. I can email a link to you.

    Of course... There's always the "Would you like to try my snake game?" aspect of installing software. lol

    I install everything in virtual machines... I don't take those sort of risks

  10. #10

    Thread Starter
    Fanatic Member alkatran's Avatar
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    860

    Re: [2005] Problems using custom VB6 controls

    I pmed you a link.

    Incidentally, how do you usually import controls? The only way I seem to be able to do it is by going to 'Choose Items' in the toolbox's context menu and selecting them there. But doing that takes FOREVER (it seems to refresh the list every time) and seems to add the controls as an option globally.
    Last edited by alkatran; Apr 25th, 2008 at 12:55 PM.
    Don't pay attention to this signature, it's contradictory.

  11. #11
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2005] Problems using custom VB6 controls

    yeah that is how I do it, and yes the items you add to the toolbox persist until you right click and say "reset toolbox"

  12. #12

    Thread Starter
    Fanatic Member alkatran's Avatar
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    860

    Re: [2005] Problems using custom VB6 controls

    Any results?
    Don't pay attention to this signature, it's contradictory.

  13. #13
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2005] Problems using custom VB6 controls

    I had no problems adding the activeX controls to the toolbox from your ocx files. From there I had no problems adding controls from the toolbox onto the form.

    Not sure if it would matter, but my test environment is Visual Studio 2008, however I did make the application to target .NET 2.0, which is on par with VS 2005. Also I am running Vista, however I don't think either of these should matter to give me a different result than you were getting.

  14. #14

    Thread Starter
    Fanatic Member alkatran's Avatar
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    860

    Re: [2005] Problems using custom VB6 controls

    Quote Originally Posted by kleinma
    I had no problems adding the activeX controls to the toolbox from your ocx files. From there I had no problems adding controls from the toolbox onto the form.

    Not sure if it would matter, but my test environment is Visual Studio 2008, however I did make the application to target .NET 2.0, which is on par with VS 2005. Also I am running Vista, however I don't think either of these should matter to give me a different result than you were getting.
    I was afraid this would happen. Can you point me at a 'for dummies' tutorial on this so I can check that I haven't missed anything obvious?
    Don't pay attention to this signature, it's contradictory.

  15. #15
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2005] Problems using custom VB6 controls

    Honestly, there was no magic I did here.

    I installed your application on the system. I then opened up Visual Studio and started a new winforms project.

    When the form came up, I right clicked on the toolbox and selected "choose items". When that screen came up, I clicked on the COM tab, and when the list loaded I saw many of the controls from your various OCX files listed. I checked off a few of the controls, and clicked OK. This added these checked controls to the toolbox, which I then added to the form. When you add them to the form, this makes VS automatically add the needed references to the project itself.

  16. #16

    Thread Starter
    Fanatic Member alkatran's Avatar
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    860

    Re: [2005] Problems using custom VB6 controls

    Quote Originally Posted by kleinma
    Honestly, there was no magic I did here.

    I installed your application on the system. I then opened up Visual Studio and started a new winforms project.

    When the form came up, I right clicked on the toolbox and selected "choose items". When that screen came up, I clicked on the COM tab, and when the list loaded I saw many of the controls from your various OCX files listed. I checked off a few of the controls, and clicked OK. This added these checked controls to the toolbox, which I then added to the form. When you add them to the form, this makes VS automatically add the needed references to the project itself.
    Did you try the anything from e1_itemcontrols.ocx, especially the item box? The controls from the other files seemed to work.
    Don't pay attention to this signature, it's contradictory.

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