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 / June 2005

Tip: Looking for answers? Try searching our database.

Managed C++ equivalent for Foo([in] VARIANT_BOOL b, [out, retval] VARIANT *ptr)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Boris - 29 Jun 2005 12:33 GMT
I have an interface in Managed C++ where one of the methods is this one:

Object *Foo(Boolean *b)

When I use tlbexp to check the IDL the line above is converted to:

HRESULT Foo([in, out] VARIANT_BOOL *b, [out, retval] VARIANT *ptr)

However I need:

HRESULT Foo([in] VARIANT_BOOL b, [out, retval] VARIANT *ptr)

What must the declaration of the method look like?

Thanks in advance,
Boris
Mattias Sjögren - 29 Jun 2005 13:10 GMT
>What must the declaration of the method look like?

Probably

Object *Foo(Boolean b)

Mattias

Signature

Mattias Sjögren [MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Boris - 29 Jun 2005 14:07 GMT
>> What must the declaration of the method look like?
>
> Probably
>
> Object *Foo(Boolean b)

Which is converted to this IDL:

HRESULT Foo([in] unsigned char b, [out, retval] VARIANT *ptr)

Any other idea?

Boris
Boris - 29 Jun 2005 14:21 GMT
I got it:

Object *Foo([MarshalAsAttribute(UnmanagedType::VariantBool)]Boolean b)

See
http://msdn.microsoft.com/library/en-us/cpguide/html/cpcondefaultmarshalingforbo
oleans.asp?frame=true
.

Boris

Rate this thread:







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.