Using VB 6.0 Interface in vb.net causes a problem

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Yatin Bhuta (ybuhta_at_comcast.net)
Date: 04/06/04


Date: Tue, 06 Apr 2004 03:34:47 GMT

Hi,

I have an interface in vb 6.0. It has a property set member, which takes a
parameter by reference. When I try to implement this interface in my vb.net
project it gives me an error saying that "cannot implement property set
because there is no matching property on interface". I think .NET does not
allow parameter to be passed ByRef in property statements.

here is my property set statement in vb 6.0 interface called IName

Property Set Name(ByRef objName as object)

End Property

VB.NET code looks like this

Public WriteOnly Property Name() as System.IntPtr implements IName.Name
  Set (ByVal value as System.IntPtr)

  end set
End Property

There is an underline below IName.Name. When I put my mouse over it then it
says "Cannot implement IName.Name because there is no matching property on
Interface IName". I tried changing the System.IntPtr to System.Object but it
gives the same result. I cannot change vb 6.0 interface to accept parameter
ByVal instead of ByRef because then, I have to change all other existing
components that already are implementing this interface.

Your help is appreciated.

Thanks



Relevant Pages

  • Question about Implementing VB 6.0 Interface in vb.net
    ... I have an interface in vb 6.0. ... project it gives me an error saying that "cannot implement property set ... here is my property set statement in vb 6.0 interface called IName ... Interface IName". ...
    (microsoft.public.dotnet.languages.vb)
  • Re: KsProxy interface aggregation.
    ... I don't remember that for sure, but I seems to me that the property set GUID ... must be equal to interface IID. ... IID and see if that helps. ...
    (microsoft.public.development.device.drivers)
  • Custom property interface for AVStream driver
    ... I've added a custom property set to my AVStream driver, and I can access it just fine from a test app which opens the driver and calls DeviceIoControl directly to do the IOCTL_KS_PROPERTY. ... Next I wrote a KsProxy plugin DLL using ATL, in order to wrap an interface around the property set, and also to implement a property page. ... VpcVideoPlugin.VpcAudioEncoding.1 = s 'VpcAudioEncoding Class' ... NoRemove System ...
    (microsoft.public.development.device.drivers)
  • Re: Custom property interface for AVStream driver
    ... it appeared that the registry allowed you to map the GUID of the property set to to any old CLSID. ... To get the IDL to compile, I had to remove the CoClass declaration from the IDL (because it wouldn't allow me to use the same GUID for both the interface and the coclass), and change the references to it's CLSID to be the IID of the interface instead. ... VpcVideoPlugin.VpcAudioEncoding.1 = s 'VpcAudioEncoding Class' ...
    (microsoft.public.development.device.drivers)