Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB Components
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 11th, 2005, 03:29 AM
Authorized User
 
Join Date: Feb 2005
Location: Mumbai, Maharashtra, India.
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
Reply With Quote
  #2 (permalink)  
Old February 11th, 2005, 02:07 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Alameda, ca, USA.
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
Reply With Quote
  #3 (permalink)  
Old March 1st, 2005, 08:24 AM
Authorized User
 
Join Date: Feb 2005
Location: Mumbai, Maharashtra, India.
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
Reply With Quote
  #4 (permalink)  
Old March 1st, 2005, 05:59 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Alameda, ca, USA.
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
Reply With Quote
  #5 (permalink)  
Old March 10th, 2005, 12:52 AM
Authorized User
 
Join Date: Feb 2005
Location: Mumbai, Maharashtra, India.
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
Reply With Quote
  #6 (permalink)  
Old March 10th, 2005, 05:45 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Alameda, ca, USA.
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
Reply With Quote
  #7 (permalink)  
Old July 19th, 2005, 01:23 PM
Registered User
 
Join Date: Jul 2005
Location: East Hanover, NJ, USA.
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 ??



Reply With Quote
  #8 (permalink)  
Old July 19th, 2005, 08:11 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Alameda, ca, USA.
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
Reply With Quote
  #9 (permalink)  
Old July 20th, 2005, 12:14 PM
Registered User
 
Join Date: Jul 2005
Location: East Hanover, NJ, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 03:56 PM.


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