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 / Languages / Managed C++ / April 2006

Tip: Looking for answers? Try searching our database.

invalid variant

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vigj - 14 Apr 2006 09:16 GMT
Hi all,
I'm working on an interoperability project
I have a huge c++ MFC application that supports a plug-in interface
I'm developing a plug in in C#

sometimes the c++ pass invalid variants to the plug-in interface.
between the c++ and c# i have a dll (in c++ ) that instances the objects in
C# code
and does some pre-processing actions on the parameters. I would like in this
dll to check the variant parameters that will be passed to C# in order to
avoid passing invalid variants to .net.

Is there a simple function or procedure in the c++ libraries that can tell
me if a variant is invalid? so that i can avoid passing it to C#?

thanks!
Bruno van Dooren - 14 Apr 2006 09:35 GMT
> I'm working on an interoperability project
> I have a huge c++ MFC application that supports a plug-in interface
[quoted text clipped - 11 lines]
> Is there a simple function or procedure in the c++ libraries that can tell
> me if a variant is invalid? so that i can avoid passing it to C#?

maybe this can be of help:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/automat/html/f0
940eea-077f-4b68-9dac-d49e3fc62e43.asp


here is another one:
http://blogs.msdn.com/adam_nathan/archive/2003/06/11/56710.aspx
where the blogger describes this technique:
To determine if a VARIANT is valid, the CLR calls the OLE Automation
VariantCopy API, passing the VARIANT in question as the source to be copied.
If the function returns S_OK, then the CLR assumes it is valid.

Signature

Kind regards,
   Bruno van Dooren
   bruno_nos_pam_van_dooren@hotmail.com
   Remove only "_nos_pam"

Vigj - 14 Apr 2006 11:06 GMT
Thanks Bruno..
I'll try to go for the VariantCopy way...

anyway I cannot see the blog...something like the page does not exist anymore

> > I'm working on an interoperability project
> > I have a huge c++ MFC application that supports a plug-in interface
[quoted text clipped - 21 lines]
> VariantCopy API, passing the VARIANT in question as the source to be copied.
> If the function returns S_OK, then the CLR assumes it is valid.
Vigj - 20 Apr 2006 10:17 GMT
It worked! thanks Bruno

> > I'm working on an interoperability project
> > I have a huge c++ MFC application that supports a plug-in interface
[quoted text clipped - 21 lines]
> VariantCopy API, passing the VARIANT in question as the source to be copied.
> If the function returns S_OK, then the CLR assumes it is valid.

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.