Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB Components
|
VB Components Issues specific to components in VB.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Components section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 11th, 2005, 03:29 AM
Authorized User
 
Join Date: Feb 2005
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default VB dll/exe version compatibility

Hi,

In my project I am creating a dll application and calling it from a standard exe application. Now there was an error in the dll. I detected an corrected it.

I tried to replace it but it didn't work. running the same exe application give the error - ActiveX component not found.

I created a new exe with reference of new dll and it worked. But this need to replace the exe each time I make changes in the dll.

I tried to set the version compatibility. It was set to No compatibility. I set it to binary compatibility, but it require the reference of an existing dll. which dll it should be?? the same I created earlier!!!

 then i tried project compatibility. it worked. but compiling the dll is not allowing to overwrite the existing not it is letting to delete.

what do i do?
plz someone help me

Punkaj
__________________
punkaj
 
Old February 11th, 2005, 02:07 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

 welcome to dll hell.
Suggestion:
1) open the exe in VB, and remove the reference to the dll, close VB
2) open the dll in VB, set the project to no compatibility
3) build the dll
4) change the project to binary compatibility, and point to the newly built dll
5) open the exe, ans restore the reference.
Caveat: there is a bug in VB that prevent to release the dll once the application is run, so sometimes when you try to rebuild the dll you get permission denied. In that case, just reopen the project, that will release the dll
Tip: you can load both dll and exe projects in a group, to easily debug them together.
Marco
 
Old March 1st, 2005, 08:24 AM
Authorized User
 
Join Date: Feb 2005
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It did. Thank u very much.

Just one doubt, for a binary compatibility option why it is required to supply an existing dll?



punkaj
 
Old March 1st, 2005, 05:59 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

well, if you do not specif ANY dll... with what the new dll be compatible to? :)
The goal is: once a dll is created, ALL the others versions must be compatible.

Marco
 
Old March 10th, 2005, 12:52 AM
Authorized User
 
Join Date: Feb 2005
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Does it mean that it require a compatibility of GUID, CLID, IID etc that it will get in the reference dll??

OK it should be.

Thanks again

punkaj
 
Old March 10th, 2005, 05:45 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That is correct. The compiler looks the interfaces of the two dll's, and if they are the same it generates a new dll keeping the old CLID. If they are different and incompatible, it throws an error. If compatible, it keeps the same class ID and increases the release number (like 1.1, 1.2 etc)
Marco
 
Old July 19th, 2005, 01:23 PM
Registered User
 
Join Date: Jul 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is there a good document/site that explains Project vs Binary vs none?

Pros & Cons ??



 
Old July 19th, 2005, 08:11 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This chapter of MSDN explains basically everything, and it is well written for a change :)

http://msdn.microsoft.com/library/de...patibility.asp

In a nut shell: during development it is ok to use project compatibility (the default), but as soon as the component is created (ocx/dll/exe) presto change to binary compatibility.

Marco
 
Old July 20th, 2005, 12:14 PM
Registered User
 
Join Date: Jul 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Marco! I will go thru the MSDN pages you posted! Very helpful!






Similar Threads
Thread Thread Starter Forum Replies Last Post
existing dll version number arifsharif_2001 Visual Studio 2005 0 May 17th, 2007 02:21 AM
Version Compatibility config issue BrianWren Pro VB 6 19 November 14th, 2006 11:31 AM
Book compatibility with Version 1.1 .NET SDK/Frame aleahy BOOK: Beginning ASP.NET 1.0 5 February 1st, 2005 10:07 AM
Compatibility DLL size limit? Yehuda Pro VB 6 10 June 10th, 2004 04:36 PM
sqlsrv32.dll compatibility Jai SQL Server 2000 0 October 13th, 2003 09:37 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.