why VARIANT,BSTR in ActiveX?
-
Hello, When we write an Activex using VC++ what are the data types we should use? In one sample code I saw VARIANT, BSTR datatypes used mostly. y we should use this datatypes? Is there any specific datatypes that we are supossed to use along with Activex? Kindly clarify. Regards, LG
lgatcodeproject
-
Hello, When we write an Activex using VC++ what are the data types we should use? In one sample code I saw VARIANT, BSTR datatypes used mostly. y we should use this datatypes? Is there any specific datatypes that we are supossed to use along with Activex? Kindly clarify. Regards, LG
lgatcodeproject
lgatcodeproject wrote:
. y we should use this datatypes?
They are automation data types, see, for instance [^]. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
Hello, When we write an Activex using VC++ what are the data types we should use? In one sample code I saw VARIANT, BSTR datatypes used mostly. y we should use this datatypes? Is there any specific datatypes that we are supossed to use along with Activex? Kindly clarify. Regards, LG
lgatcodeproject
VARIANT and BSTR get used because they are compatible with 'automation'. What this means in practice is the interfaces can be called from languages like Visual Basic which only have automatic marshalling and can be called from C++ without writing any marshalling code. BSTR is essentially the same as VBs internal String class so it can make using the control from VB easy enough that even a VB programmer might manage it. :-D What type you use in your interface when creating ActiveX controls really depends on what clients you need to support.
"The secret of happiness is freedom, and the secret of freedom, courage." Thucydides (B.C. 460-400)
-
VARIANT and BSTR get used because they are compatible with 'automation'. What this means in practice is the interfaces can be called from languages like Visual Basic which only have automatic marshalling and can be called from C++ without writing any marshalling code. BSTR is essentially the same as VBs internal String class so it can make using the control from VB easy enough that even a VB programmer might manage it. :-D What type you use in your interface when creating ActiveX controls really depends on what clients you need to support.
"The secret of happiness is freedom, and the secret of freedom, courage." Thucydides (B.C. 460-400)
Thanks for the reply. If my client is in C sharp that what types I am supossed to use? Regards, LG
lgatcodeproject
-
Thanks for the reply. If my client is in C sharp that what types I am supossed to use? Regards, LG
lgatcodeproject
You need to use BSTR only. And Client can use datatype compatible to it. for C# String class can be used. Intellisense will tell you about datatype need to be used by client.
-
Thanks for the reply. If my client is in C sharp that what types I am supossed to use? Regards, LG
lgatcodeproject
If I were you I'd ask a C# programmer, perhaps on the C# forum, I have NO idea, sorry.
"The secret of happiness is freedom, and the secret of freedom, courage." Thucydides (B.C. 460-400)
-
If I were you I'd ask a C# programmer, perhaps on the C# forum, I have NO idea, sorry.
"The secret of happiness is freedom, and the secret of freedom, courage." Thucydides (B.C. 460-400)
Thanks for the concern. Regards, LG
lgatcodeproject