|
-
Apr 23rd, 2008, 03:24 PM
#1
Thread Starter
Fanatic Member
[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.
-
Apr 23rd, 2008, 03:42 PM
#2
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
-
Apr 23rd, 2008, 05:48 PM
#3
Thread Starter
Fanatic Member
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.
-
Apr 24th, 2008, 01:20 AM
#4
Thread Starter
Fanatic Member
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.
-
Apr 24th, 2008, 09:32 AM
#5
Re: [2005] Problems using custom VB6 controls
do you have no problems using this OCX in a VB6 application?
-
Apr 24th, 2008, 01:03 PM
#6
Thread Starter
Fanatic Member
Re: [2005] Problems using custom VB6 controls
 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.
-
Apr 24th, 2008, 01:13 PM
#7
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.
-
Apr 24th, 2008, 03:44 PM
#8
Thread Starter
Fanatic Member
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.
-
Apr 24th, 2008, 04:03 PM
#9
Re: [2005] Problems using custom VB6 controls
 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
-
Apr 25th, 2008, 12:51 PM
#10
Thread Starter
Fanatic Member
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.
-
Apr 25th, 2008, 01:08 PM
#11
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"
-
Apr 28th, 2008, 12:47 AM
#12
Thread Starter
Fanatic Member
Re: [2005] Problems using custom VB6 controls
Don't pay attention to this signature, it's contradictory.
-
Apr 28th, 2008, 09:01 AM
#13
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.
-
Apr 28th, 2008, 02:53 PM
#14
Thread Starter
Fanatic Member
Re: [2005] Problems using custom VB6 controls
 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.
-
Apr 28th, 2008, 02:56 PM
#15
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.
-
Apr 29th, 2008, 12:35 PM
#16
Thread Starter
Fanatic Member
Re: [2005] Problems using custom VB6 controls
 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|