Changes in OCX do miss instances in my application

C

Cesar Ronchese

Hello All.

I have one OCX made in VB6 that is used in my VB.Net application (Interops).
Recently, I did some changes in the OCX (adding one event) and, when I load
my application again, I've noted that all my OCX instances disappeared from
forms.

I've noted that same thing occur when I change a pure .Net UserControl.

Have some manner to avoid this problem?

Tks in advance!

Cesar
 
A

Armin Zingler

Cesar Ronchese said:
I have one OCX made in VB6 that is used in my VB.Net application
(Interops). Recently, I did some changes in the OCX (adding one
event) and, when I load my application again, I've noted that all my
OCX instances disappeared from forms.

I've noted that same thing occur when I change a pure .Net
UserControl.

Have some manner to avoid this problem?

At least you have to enable binary compatibility. Despite, if you add an
event, you create a new version of the type library (from 1.0 to 1.1)
because you changed the public interface. Due to this change, the "Identity"
of the reference changes and the library isn't found anymore.

I watched this when I just tried it, but I'm afraid, I don't have a solution
for you.


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
R

Ronchese

I already use binary compatibility to my COM component, and the .NET
UserControl I always have compiled with 1.0.0.1 version.
 
G

Guest

I think you need to rebuild the Interops before loading the application into VS.NET. These will be in the bin folder

tlbimp "myControl.ocx" /out:Interop.myControl.dll /namespace:myContro
aximp "myControl.ocx" /out:AxInterop.myControl.dll /rcw:Interop.myControl.dl

Hope this helps.
 
A

Armin Zingler

R

Ronchese

Hello.

I've tryied compile using the tlbimp, but when I try add reference the
UserControl to Components, the message saying "there are no UserControls in
this reference" appear.



Chris Podmore said:
I think you need to rebuild the Interops before loading the application
into VS.NET. These will be in the bin folder.
 
G

Guest

When you say you add a reference to the UserControl to Components do you mean the toolbox? If so then you must add the user actual user control (OCX) to the toolbox. tlbimp and aximp will only recreate the Interpos for you

I don't think there is anyway to avoid recreating the interops if the ocx changes, compatibility or new events added

----- Ronchese wrote: ----

Hello

I've tryied compile using the tlbimp, but when I try add reference th
UserControl to Components, the message saying "there are no UserControls i
this reference" appear



Chris Podmore said:
I think you need to rebuild the Interops before loading the applicatio
into VS.NET. These will be in the bin folder
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top