Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / November 2005

Tip: Looking for answers? Try searching our database.

COM Interface's GUID property in .NET

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
keith - 27 Oct 2005 03:27 GMT
Hi,

I have a COM interface definition which has a property set like this:

[propget, helpstring("property Prop")] HRESULT Prop([out, retval]
GuidType *pVal);
[propput, helpstring("property Prop")] HRESULT Prop([in] GuidType
newVal);

Where 'GuidType' is a typedef of GUID.

I wish to implement this as a .NET class and have done so successfuly
with other properties of the interface that are not GUIDs. But the
above GUID property gives the following message:

error CS0536: 'YourLibrary.YourClass' does not implement interface
member 'COMLib.COMInterface.Prop'. 'YourLibrary.YourClass.Prop' is
either static, not public, or has the wrong return type.

Obviously it's the return type that the compiler is having difficulty
with.

In the .NET class definition I have this:

public Guid Prop
{
  get {return m_Prop;}
  set {m_Prop = value;}
}

also

public COMLib.GuidType Prop
{
  get {return m_Prop;}
  set {m_Prop = value;}
}

but both result in this error. What return type am I supposed to use
here?

Sorry for the long post, but i'm totally stuck here.
Thanks in advance,

Keith
Phil Wilson - 28 Oct 2005 15:56 GMT
I suspect your client doesn't know what a Guid is because it's not one of
the standard COM types that can be marshaled without a custom type library.
Does it work if you use a string instead?
Signature

Phil Wilson
[Microsoft MVP-Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280

> Hi,
>
[quoted text clipped - 41 lines]
>
> Keith
keith - 04 Nov 2005 16:55 GMT
:(, You're right. I just looked it up. I'm so surprised that it's not a
standard type!

Thanks, I'll have to change them to strings and then I'm certain it'll
work.

Keith.

> I suspect your client doesn't know what a Guid is because it's not one of
> the standard COM types that can be marshaled without a custom type library.
[quoted text clipped - 50 lines]
> >
> > Keith

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.