NEWBIE: usage of tagVARIANT ? 
Author Message
 NEWBIE: usage of tagVARIANT ?

Hello All,

I am writing this DLL to controll an archiving system client via COM.
The interface is clear enough execpt for this. This is the prototype
for the "login" method I need to use when connecting to the client:

   void Login(LPCTSTR user, const VARIANT& passwd);

The LPCTSTR type is familiar but how do I use the "const VARIANT&"
part? The VC documentation is a bit blurry when dealing with VARIANT
and tagVARIANT.

Can someone explain to me what I should pass as the second argument
(it should be a string somehow).

Thanks.

/Tobias A



Mon, 12 Sep 2005 10:37:33 GMT  
 NEWBIE: usage of tagVARIANT ?
Tobias
If you are using MFC - as I presume you are - easiest is, to use the
COleVariant class. Create an instance of this class, initialising it with
the required text, and pass this variable as argument in your function call
(the COleVariant object will be automatically cast to the VARIANT data
type).
Peter

--
Peter Aspey
-------------------------------------------------------
email: replace 6 by p


Quote:

> Hello All,

> I am writing this DLL to controll an archiving system client via COM.
> The interface is clear enough execpt for this. This is the prototype
> for the "login" method I need to use when connecting to the client:

>    void Login(LPCTSTR user, const VARIANT& passwd);

> The LPCTSTR type is familiar but how do I use the "const VARIANT&"
> part? The VC documentation is a bit blurry when dealing with VARIANT
> and tagVARIANT.

> Can someone explain to me what I should pass as the second argument
> (it should be a string somehow).

> Thanks.

> /Tobias A



Mon, 12 Sep 2005 20:36:20 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. newbie question with main() usage ?

2. Newbie- COleCurrency usage

3. tagVARIANT structure

4. CWnd in a tagVARIANT structure

5. Initialise tagVARIANT structure

6. tagVARIANT

7. MEM Usage and CPU Usage

8. Usage of MFC & Usage of Platform SDK or Usage of MF Framework

9. Usage of MFC & Usage of Platform SDK or Usage of MF Framework

10. NEWBIE NEWBIE

11. NEWBIE help NEWBIE

12. NEWBIE NEWBIE

 

 
Powered by phpBB® Forum Software