GlobalMultiUse component breaks its compatibility !!!
From: Bala (Bala_at_discussions.microsoft.com)
Date: 09/09/04
- Previous message: Gale Green: "Re: Help for my unused methods please"
- Next in thread: Mark Alexander Bertenshaw: "Re: GlobalMultiUse component breaks its compatibility !!!"
- Reply: Mark Alexander Bertenshaw: "Re: GlobalMultiUse component breaks its compatibility !!!"
- Reply: Ken Halter: "Re: GlobalMultiUse component breaks its compatibility !!!"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 9 Sep 2004 00:15:01 -0700
Hi,
I have a component (ActiveX dll) with only one class in it. The instancing
property of the class is set as GlobalMultiUse. The project compatibility is
set as Binary Compatible.
Problem: When a new property or procedure is added to this class and
compiled, even though the binary compatibility is set, a new UUID is
generated for the default interface for this class.
As the new UUID is generated for the default interface, it doesn't give any
warning about the compatibility breaks, but the compiled clients using this
components fails to load. It is giving the usual "Class does not support
expected interface..." error when the object of this component is refered...
Due to this, everytime this component is builded all the client applications
also needs to be compiled. Unfortunately, this component is a very base
component and referred in almost 250 odd components...
Question:Can any one know why this is happening and how we can avoid this???
I am using VB 6.0 and tested this in SP4, SP5 and SP6. OS: Win NT/ Win 2K/
Win XP
Create a ActiveX Dll project, and add a class to it. Set the Instancing
property of the class to GlobalMultiUse.
Add the below listed code to that class.
Option Explicit
Private m_String As String
Public Property Get MyStringProp() As String
MyStringProp = m_String
End Property
Public Property Let MyStringProp(ByVal vNewValue As String)
m_String = vNewValue
End Property
Compile the project. Using OLE View, get the IDL file for the compiled dll.
Save that as GMProject_V1.idl.
Set the binary compatibility of the project to the compiled dll. Remove the
existing code in the class and add the below mentioned code to that class.
Option Explicit
Private m_String As String
Private m_Long As Long
Public Property Get MyStringProp() As String
MyStringProp = m_String
End Property
Public Property Let MyStringProp(ByVal vNewValue As String)
m_String = vNewValue
End Property
Public Property Get MyLongProp() As Long
MyLongProp = m_Long
End Property
Public Property Let MyLongProp(ByVal vNewValue As Long)
m_Long = vNewValue
End Property
Compile the project. Using OLE View, get the IDL file for the compiled dll.
Save that as GMProject_V2.idl
If you compare both the idl files, you can see that the UUID of the default
interface would have changed. How to solve this?
Thanks in advance... Bala...
- Previous message: Gale Green: "Re: Help for my unused methods please"
- Next in thread: Mark Alexander Bertenshaw: "Re: GlobalMultiUse component breaks its compatibility !!!"
- Reply: Mark Alexander Bertenshaw: "Re: GlobalMultiUse component breaks its compatibility !!!"
- Reply: Ken Halter: "Re: GlobalMultiUse component breaks its compatibility !!!"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|