invalid variant

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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!
 
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#?

maybe this can be of help:
http://msdn.microsoft.com/library/d...html/f0940eea-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.

--

Kind regards,
Bruno van Dooren
(e-mail address removed)
Remove only "_nos_pam"
 
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
 
It worked! thanks Bruno

Bruno van Dooren said:
maybe this can be of help:
http://msdn.microsoft.com/library/d...html/f0940eea-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.

--

Kind regards,
Bruno van Dooren
(e-mail address removed)
Remove only "_nos_pam"
 
Back
Top