|
| VARIANT array |
|
|
|
|
| Messages |
|
Related Types |
This message was discovered on microsoft.public.dotnet.framework.sdk.
| Arr S |
| GOOD ANSWER |
I need to use a VARIANT array. But, I am not sure whether it's available in C#. I found a VARIANT API in the platform SDK (in the OleAuto.h file). Is this is the right one that I've to use? If so, how to include this .h file?
Thanks in advance, Arr S.
|
|
|
| |
|
|
| |
| |
| Andreas HÃ¥kansson |
| GOOD ANSWER |
Arr,
You should use an array of objects. The Object class is the base class for everything in .NET, just like Java uses.
object[] myArray = new object[10];
myArray[0] = 1; myArray[1] = "Something"; myArray[2] = true;
Not that implicit type casting is taking place. That is all of your other varaibles, be it an int, string, bool or anything else, will be converted into an object and if you need to get it back you will have to perform explicit type casting
int a = (int)myArray[0]; string b = (string)myArray[1]; bool c = (bool)myArray[2];
Hope this helps,
//Andreas
"Arr S" <Click here to reveal e-mail address> skrev i meddelandet news:Click here to reveal e-mail address... [Original message clipped]
Is this is the right one that I've to use? If so, how to include this .h file? [Original message clipped]
|
|
|
| |
|
|
| |
| |
| Arr S |
| GOOD ANSWER |
I am developing a DLL that will be used by applications. These applications pass the data as VARIANT array. In this case, I'll not be knowing the data type of the object sent. Only VARIANT array can help my problem,I suppose. Is their any other way?
Thanks Andreas.
|
|
|
| |
|
|
| |
|
|
|
|
|
|
|
|
|
BootFX
Reliable and powerful .NET application framework. |
|
|
|
|
|
|