Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Controls / July 2008



Tip: Looking for answers? Try searching our database.

Updateing a created control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike - 28 Jul 2008 20:06 GMT
Hello,

I have created a ActiveX control to use with an application.  I create
the .ocx file and in the Component tab of the end application I add
the ocx file into the toolbar.  When I make a change to the ActiveX
control and re-create the ocx file and open the end project VB
complaines about the ocx file and changes all instanses of the the
control to pictureboxes.

How do I update the ocx file without having to recreate all of the
controls in my end project?

Thanks.

Mike
MikeD - 28 Jul 2008 21:26 GMT
> Hello,
>
> I have created a ActiveX control to use with an application.  I create
> the .ocx file and in the Component tab of the end application I add
> the ocx file into the toolbar.

I think you mean Components dialog box and toolbox.  <g>

> When I make a change to the ActiveX
> control and re-create the ocx file and open the end project VB
[quoted text clipped - 3 lines]
> How do I update the ocx file without having to recreate all of the
> controls in my end project?

You need to set binary compatibility in your ActiveX Control project.

Create a folder named, for example, Compatibility.  Copy your OCX file to this folder.  Now, in VB with your ActiveX Control project
opened, open the Project Properties dialog box and click on the Component tab. In the Version Compatibility frame, select Binary
Compatibility and choose the file you just copied. Recompile your OCX.

In your app which uses this OCX, you'll have to reset instances of it one more time, but after that you should be fine (unless you
change something in your OCX which breaks binary compatibility, but VB will warn you if you do this when you run or compile the
OCX).

For more information, read up on binary compatibility in VB's Help.  The following KB article may also be of help:

How To Use Project and Binary Compatibility
http://support.microsoft.com/kb/161137/en-us

The reason to make a copy of the OCX is to avoid a permission denied error. When VB checks binary compatibilitiy, it opens the
specified compatibility file. If this is the same as the file you're attempting to recompile, you may get a permission denied error
because the file is already in use and therefore can't be overwritten.

I also highly recommend reading what Ken Halter has to say at http://www.vbsight.com/BinaryComp.htm.

Signature

Mike
Microsoft Visual Basic MVP

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.