|
-
August 5th, 2008, 06:19 AM
#1
problem implementing a com component callback procedure
Hi
I am working with a com component, which I have added a reference to in my C#. I am using windows vista (32 bit) and VS2005.
I have to implement a callback object which handles data being returned from the com object, which derives from an interface called IDeviceEvents which is part of the com component, which I have attempted to do in my c# code:
Code:
unsafe class cFM2Notify : IDeviceEvents
{
public string m_CallbackEvent = "";
public void NotifyData(IFM2DeviceEvents CallbackData)
{
}
public string CallbackEvent
{
get
{
return m_CallbackEvent = CallbackEvent;
}
set
{
CallbackEvent = m_CallbackEvent;
}
}
}
This is a shortened version - there are actually a few more properties and methods that I am required to implement, other than the ones shown.
The code builds ok, however, it falls over when run, a StackOverflowException being generated.
My VB.net colleague has suggested that I make the class com visible by prefixing the cFM2Notify declaration with[ComVisible(true)]. However I still a StackOverflowException being generated.
Any ideas on what I am doing wrong?
Cheers
Simon
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|