By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,626 Members | 2,202 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,626 IT Pros & Developers. It's quick & easy.

Changes in OCX do miss instances in my application

P: n/a
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
Nov 20 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
"Cesar Ronchese" <ro******@smlinfo.com.br> schrieb

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

Nov 20 '05 #2

P: n/a
I already use binary compatibility to my COM component, and the .NET
UserControl I always have compiled with 1.0.0.1 version.

"Armin Zingler" <az*******@freenet.de> wrote in message
news:40*********************@news.freenet.de...
"Cesar Ronchese" <ro******@smlinfo.com.br> schrieb

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

Nov 20 '05 #3

P: n/a
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.
Nov 20 '05 #4

P: n/a
"Chris Podmore" <an*******@discussions.microsoft.com> schrieb
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:myControl
aximp "myControl.ocx"
/out:AxInterop.myControl.dll /rcw:Interop.myControl.dll

Right, but what I didn't know was what can be done to avoid this.
--
Armin

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

Nov 20 '05 #5

P: n/a
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" <an*******@discussions.microsoft.com> wrote in message
news:93**********************************@microsof t.com...
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:myControl
aximp "myControl.ocx" /out:AxInterop.myControl.dll /rcw:Interop.myControl.dll
Hope this helps.

Nov 20 '05 #6

P: n/a
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" <an*******@discussions.microsoft.com> wrote in messag
news:93**********************************@microsof t.com..
I think you need to rebuild the Interops before loading the applicatio

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.dl

/rcw:Interop.myControl.dl
Hope this helps


Nov 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.