473,386 Members | 1,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

CS0536 Error

Hi All,

I'm trying to generate a C# wrapper for a Windows type library using the following command line ...

csc /target:library /doc:Interop.MyLibrary.xml /unsafe Interop.MyLibrary.cs >Interop.MyLibrary.log

And receiving the following error message ...

Interop.MyLibrary.cs(499,18): error CS0536: 'Interop.MyLibrary.IImpBaseCollection_SinkHelper' does not implement interface member 'Interop.MyLibrary.IImpBaseCollection.Item(object) '. 'Interop.MyLibrary.IImpBaseCollection_SinkHelper.I tem(object)' is either static, not public, or has the wrong return type.

Here's the code....

The line where the error occurs is in Bold Blue

Any ideas appreciated!! ;-)

Thanks,
Roland

-----------------
/// <summary><para><c>IImpBaseCollection</c> interface.</para></summary>
[Guid("5616A320-AB4D-11D0-8E2F-00A0C9050603")]

[ComImport]

[TypeLibType((short)4096)]

[DefaultMember("Item")]

[InterfaceTypeAttribute(ComInterfaceType.InterfaceI sIDispatch)]

public interface IImpBaseCollection: System.Collections.IEnumerable

{

/// <summary><para><c>Item</c> method of <c>IImpBaseCollection</c> interface.</para></summary>

/// <remarks><para>An original IDL definition of <c>Item</c> method was the following: <c>HRESULT Item (VARIANT nIndex, [out, retval] IDispatch** ReturnValue)</c>;</para></remarks>

// IDL: HRESULT Item (VARIANT nIndex, [out, retval] IDispatch** ReturnValue);

// VB6: Function Item (ByVal nIndex As Any) As IDispatch

[DispId(0)]

[return: MarshalAs(UnmanagedType.IDispatch)]

object Item (object nIndex);

/// <summary><para><c>_NewEnum</c> property of <c>IImpBaseCollection</c> interface.</para></summary>

/// <remarks><para>An original IDL definition of <c>_NewEnum</c> property was the following: <c>IUnknown* _NewEnum</c>;</para></remarks>

// IDL: IUnknown* _NewEnum;

// VB6: _NewEnum As IUnknown

object _NewEnum

{

// IDL: HRESULT _NewEnum ([out, retval] IUnknown** ReturnValue);

// VB6: Function _NewEnum As IUnknown

[DispId(-4)]

[return: MarshalAs(UnmanagedType.IUnknown)]

get;

}

/// <summary><para>Parent property of IImpBaseCollection interface.</para></summary>

/// <remarks><para>An original IDL definition of <c>Parent</c> property was the following: <c>IDispatch* Parent</c>;</para></remarks>

// IDL: IDispatch* Parent;

// VB6: Property Parent As IDispatch

[DispId(2)]

object Parent

{

[return: MarshalAs(UnmanagedType.IDispatch)]

get;

}

/// <summary><para>Count property of IImpBaseCollection interface.</para></summary>

/// <remarks><para>An original IDL definition of <c>Count</c> property was the following: <c>long Count</c>;</para></remarks>

// IDL: long Count;

// VB6: Property Count As Long

[DispId(3)]

int Count

{

get;

}

}

/// <summary><para>Delegate for handling <c>Item</c> event of <c>IImpBaseCollection</c> interface.</para></summary>

/// <remarks><para>An original IDL definition of <c>Item</c> event was the following: <c>HRESULT IImpBaseCollection_ItemEventHandler (VARIANT nIndex, [out, retval] IDispatch** ReturnValue)</c>;</para></remarks>

// IDL: HRESULT IImpBaseCollection_ItemEventHandler (VARIANT nIndex, [out, retval] IDispatch** ReturnValue);

// VB6: Function IImpBaseCollection_ItemEventHandler (ByVal nIndex As Any) As IDispatch

[return: MarshalAs(UnmanagedType.IDispatch)]

public delegate object IImpBaseCollection_ItemEventHandler (object nIndex);

/// <summary><para>Delegate for handling <c>_NewEnum</c> event of <c>IImpBaseCollection</c> interface.</para></summary>

/// <remarks><para>An original IDL definition of <c>_NewEnum</c> event was the following: <c>HRESULT IImpBaseCollection__NewEnumEventHandler ([out, retval] IUnknown** ReturnValue)</c>;</para></remarks>

// IDL: HRESULT IImpBaseCollection__NewEnumEventHandler ([out, retval] IUnknown** ReturnValue);

// VB6: Function IImpBaseCollection__NewEnumEventHandler As IUnknown

[return: MarshalAs(UnmanagedType.IUnknown)]

public delegate object IImpBaseCollection__NewEnumEventHandler () /* property get method */;

/// <summary><para>Declaration of events of <c>IImpBaseCollection</c> source interface.</para></summary>

[ComEventInterface(typeof(IImpBaseCollection),typeo f(IImpBaseCollection_EventProvider))]

[ComVisible(false)]

public interface IImpBaseCollection_Event

{

/// <summary><para><c>Item</c> event of <c>IImpBaseCollection</c> interface.</para></summary>

event IImpBaseCollection_ItemEventHandler Item;

/// <summary><para><c>_NewEnum</c> event of <c>IImpBaseCollection</c> interface.</para></summary>

event IImpBaseCollection__NewEnumEventHandler _NewEnum;

}

[ClassInterface(ClassInterfaceType.None)]

internal class IImpBaseCollection_SinkHelper: IImpBaseCollection

{

public int Cookie = 0;

public event IImpBaseCollection_ItemEventHandler ItemDelegate = null;

public void Set_ItemDelegate(IImpBaseCollection_ItemEventHandl er deleg)

{

ItemDelegate = deleg;

}

public bool Is_ItemDelegate(IImpBaseCollection_ItemEventHandle r deleg)

{

return (ItemDelegate == deleg);

}

public void Clear_ItemDelegate()

{

ItemDelegate = null;

}

void Item (object nIndex)

{

if (ItemDelegate!=null)

ItemDelegate(nIndex);

}

public event IImpBaseCollection__NewEnumEventHandler _NewEnumDelegate = null;

public void Set__NewEnumDelegate(IImpBaseCollection__NewEnumEv entHandler deleg)

{

_NewEnumDelegate = deleg;

}

public bool Is__NewEnumDelegate(IImpBaseCollection__NewEnumEve ntHandler deleg)

{

return (_NewEnumDelegate == deleg);

}

public void Clear__NewEnumDelegate()

{

_NewEnumDelegate = null;

}

void _NewEnum () /* property get method */

{

if (_NewEnumDelegate!=null)

_NewEnumDelegate();

}

}

Nov 15 '05 #1
1 1676
Hi

The compiler did not detect an interface member
implementation. A declaration may be present that almost
implements the interface member. Check for the following
syntax errors in the declaration for the interface
member:

public keyword is omitted.
Return type does not match.
static keyword is present.

HTH
Ravikanth[MVP]
-----Original Message-----
Hi All,

I'm trying to generate a C# wrapper for a Windows type library using the following command line ...
csc /target:library /doc:Interop.MyLibrary.xml /unsafe Interop.MyLibrary.cs >Interop.MyLibrary.log
And receiving the following error message ...

Interop.MyLibrary.cs(499,18): error CS0536: 'Interop.MyLibrary.IImpBaseCollection_SinkHelper'
does not implement interface
member 'Interop.MyLibrary.IImpBaseCollection.Item
(object)'. 'Interop.MyLibrary.IImpBaseCollection_SinkHelpe
r.Item(object)' is either static, not public, or has the
wrong return type.
Here's the code....

The line where the error occurs is in Bold Blue

Any ideas appreciated!! ;-)

Thanks,
Roland

-----------------
/// <summary><para><c>IImpBaseCollection</c> interface.</para></summary>[Guid("5616A320-AB4D-11D0-8E2F-00A0C9050603")]

[ComImport]

[TypeLibType((short)4096)]

[DefaultMember("Item")]

[InterfaceTypeAttribute (ComInterfaceType.InterfaceIsIDispatch)]
public interface IImpBaseCollection: System.Collections.IEnumerable
{

/// <summary><para><c>Item</c> method of <c>IImpBaseCollection</c> interface.</para></summary>
/// <remarks><para>An original IDL definition of <c>Item</c> method was the following: <c>HRESULT Item
(VARIANT nIndex, [out, retval] IDispatch** ReturnValue)
</c>;</para></remarks>
// IDL: HRESULT Item (VARIANT nIndex, [out, retval] IDispatch** ReturnValue);
// VB6: Function Item (ByVal nIndex As Any) As IDispatch

[DispId(0)]

[return: MarshalAs(UnmanagedType.IDispatch)]

object Item (object nIndex);

/// <summary><para><c>_NewEnum</c> property of <c>IImpBaseCollection</c> interface.</para></summary>
/// <remarks><para>An original IDL definition of <c>_NewEnum</c> property was the following: <c>IUnknown*
_NewEnum</c>;</para></remarks>
// IDL: IUnknown* _NewEnum;

// VB6: _NewEnum As IUnknown

object _NewEnum

{

// IDL: HRESULT _NewEnum ([out, retval] IUnknown** ReturnValue);
// VB6: Function _NewEnum As IUnknown

[DispId(-4)]

[return: MarshalAs(UnmanagedType.IUnknown)]

get;

}

/// <summary><para>Parent property of IImpBaseCollection interface.</para></summary>
/// <remarks><para>An original IDL definition of <c>Parent</c> property was the following: <c>IDispatch*
Parent</c>;</para></remarks>
// IDL: IDispatch* Parent;

// VB6: Property Parent As IDispatch

[DispId(2)]

object Parent

{

[return: MarshalAs(UnmanagedType.IDispatch)]

get;

}

/// <summary><para>Count property of IImpBaseCollection interface.</para></summary>
/// <remarks><para>An original IDL definition of <c>Count</c> property was the following: <c>long
Count</c>;</para></remarks>
// IDL: long Count;

// VB6: Property Count As Long

[DispId(3)]

int Count

{

get;

}

}

/// <summary><para>Delegate for handling <c>Item</c> event of <c>IImpBaseCollection</c>
interface.</para></summary>
/// <remarks><para>An original IDL definition of <c>Item</c> event was the following: <c>HRESULT
IImpBaseCollection_ItemEventHandler (VARIANT nIndex,
[out, retval] IDispatch** ReturnValue)
</c>;</para></remarks>
// IDL: HRESULT IImpBaseCollection_ItemEventHandler (VARIANT nIndex, [out, retval] IDispatch** ReturnValue);
// VB6: Function IImpBaseCollection_ItemEventHandler (ByVal nIndex As Any) As IDispatch
[return: MarshalAs(UnmanagedType.IDispatch)]

public delegate object IImpBaseCollection_ItemEventHandler (object nIndex);
/// <summary><para>Delegate for handling <c>_NewEnum</c> event of <c>IImpBaseCollection</c>
interface.</para></summary>
/// <remarks><para>An original IDL definition of <c>_NewEnum</c> event was the following: <c>HRESULT
IImpBaseCollection__NewEnumEventHandler ([out, retval]
IUnknown** ReturnValue)</c>;</para></remarks>
// IDL: HRESULT IImpBaseCollection__NewEnumEventHandler ([out, retval] IUnknown** ReturnValue);
// VB6: Function IImpBaseCollection__NewEnumEventHandler As IUnknown
[return: MarshalAs(UnmanagedType.IUnknown)]

public delegate object IImpBaseCollection__NewEnumEventHandler () /* property
get method */;
/// <summary><para>Declaration of events of <c>IImpBaseCollection</c> source
interface.</para></summary>
[ComEventInterface(typeof(IImpBaseCollection),typeo f (IImpBaseCollection_EventProvider))]
[ComVisible(false)]

public interface IImpBaseCollection_Event

{

/// <summary><para><c>Item</c> event of <c>IImpBaseCollection</c> interface.</para></summary>
event IImpBaseCollection_ItemEventHandler Item;

/// <summary><para><c>_NewEnum</c> event of <c>IImpBaseCollection</c> interface.</para></summary>
event IImpBaseCollection__NewEnumEventHandler _NewEnum;

}

[ClassInterface(ClassInterfaceType.None)]

internal class IImpBaseCollection_SinkHelper: IImpBaseCollection
{

public int Cookie = 0;

public event IImpBaseCollection_ItemEventHandler ItemDelegate = null;
public void Set_ItemDelegate (IImpBaseCollection_ItemEventHandler deleg)
{

ItemDelegate = deleg;

}

public bool Is_ItemDelegate (IImpBaseCollection_ItemEventHandler deleg)
{

return (ItemDelegate == deleg);

}

public void Clear_ItemDelegate()

{

ItemDelegate = null;

}

void Item (object nIndex)

{

if (ItemDelegate!=null)

ItemDelegate(nIndex);

}

public event IImpBaseCollection__NewEnumEventHandler _NewEnumDelegate = null;
public void Set__NewEnumDelegate (IImpBaseCollection__NewEnumEventHandler deleg)
{

_NewEnumDelegate = deleg;

}

public bool Is__NewEnumDelegate (IImpBaseCollection__NewEnumEventHandler deleg)
{

return (_NewEnumDelegate == deleg);

}

public void Clear__NewEnumDelegate()

{

_NewEnumDelegate = null;

}

void _NewEnum () /* property get method */

{

if (_NewEnumDelegate!=null)

_NewEnumDelegate();

}

}

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: AIM | last post by:
Error in msvc in building inheritance.obj to build hello.pyd Hello, I am trying to build the boost 1.31.0 sample extension hello.cpp. I can not compile the file inheritance.cpp because the two...
5
by: Tony Wright | last post by:
Hi, I am having a problem installing an msi for a web site. The error message I am getting is: "The specified path 'http://mipdev05/features/Fas2' is unavailable. The Internet Information...
1
by: Aravind | last post by:
we have two files: 1. rc4.c (defines one function "create_pin()") 2. MyImpl.c(calling the function "create_pin()"),This implements JNI method. 1.When I am trying to create .dll file with one...
13
by: deko | last post by:
I use this convention frequently: Exit_Here: Exit Sub HandleErr: Select Case Err.Number Case 3163 Resume Next Case 3376 Resume Next
1
by: Roland | last post by:
Sorry for Cross-Posting ^O^ Hi All, I'm trying to generate a C# wrapper for a Windows type library using the following command line ... csc /target:library /doc:Interop.MyLibrary.xml...
12
by: elvis_the_king | last post by:
Hi all, I'm still new to C# so maybe someone can explain me the rationale for CS0536: 'someClass' does not implement interface member 'some.Interface.Member()'. 'someClass.Member()' is either...
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.