473,480 Members | 2,379 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Error CS0536

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 /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....

(Line 499
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)]

// ***** THIS IS LINE 499 ********
public interface IImpBaseCollection: System.Collections.IEnumerable
{

[DispId(0)]
[return: MarshalAs(UnmanagedType.IDispatch)]
object Item (object nIndex);

object _NewEnum
{

[DispId(-4)]

[return: MarshalAs(UnmanagedType.IUnknown)]

get;

}

[DispId(2)]

object Parent

{

[return: MarshalAs(UnmanagedType.IDispatch)]

get;

}

[DispId(3)]

int Count
{
get;
}

}
[return: MarshalAs(UnmanagedType.IDispatch)]
public delegate object IImpBaseCollection_ItemEventHandler (object nIndex);
[return: MarshalAs(UnmanagedType.IUnknown)]
public delegate object IImpBaseCollection__NewEnumEventHandler () /*
property get method */;
[ComEventInterface(typeof(IImpBaseCollection),typeo f(IImpBaseCollection_Even
tProvider))]
[ComVisible(false)]

public interface IImpBaseCollection_Event

{
event IImpBaseCollection_ItemEventHandler Item;
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 2854
Hi Roland,

You inherit the following class:

IImpBaseCollection_SinkHelper

from IImpBaseCollection and therefore have to implement all methods and
properties declared in this interface. On the other hand, you have an Item
method in this class that is declared in the IImpBaseCollection interface,
but the IImpBaseCollection_SinkHelper.Item returns "void" while
IImpBaseCollection.Item should return "object". This causes a conflict the
compiler complains about:
'Interop.MyLibrary.IImpBaseCollection_SinkHelper.I tem(object)' is either
static, not public, or has the wrong return type. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Roland" <ro***************@sympatico.ca> wrote in message
news:XH*********************@news20.bellglobal.com ... 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 /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....

(Line 499
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)]

// ***** THIS IS LINE 499 ********
public interface IImpBaseCollection: System.Collections.IEnumerable
{

[DispId(0)]
[return: MarshalAs(UnmanagedType.IDispatch)]
object Item (object nIndex);

object _NewEnum
{

[DispId(-4)]

[return: MarshalAs(UnmanagedType.IUnknown)]

get;

}

[DispId(2)]

object Parent

{

[return: MarshalAs(UnmanagedType.IDispatch)]

get;

}

[DispId(3)]

int Count
{
get;
}

}
[return: MarshalAs(UnmanagedType.IDispatch)]
public delegate object IImpBaseCollection_ItemEventHandler (object

nIndex);

[return: MarshalAs(UnmanagedType.IUnknown)]
public delegate object IImpBaseCollection__NewEnumEventHandler () /*
property get method */;
[ComEventInterface(typeof(IImpBaseCollection),typeo f(IImpBaseCollection_Even tProvider))]
[ComVisible(false)]

public interface IImpBaseCollection_Event

{
event IImpBaseCollection_ItemEventHandler Item;
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 #2

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

Similar topics

2
4357
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
16206
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
8390
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
6568
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
1680
by: Roland | last post by:
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...
12
1359
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
4975
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
19389
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
2897
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
7054
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,...
0
7097
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6750
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5353
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4794
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
2993
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1307
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
567
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.