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 / .NET Framework / .NET SDK / March 2004

Tip: Looking for answers? Try searching our database.

VARIANT array

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Arr S - 23 Mar 2004 12:11 GMT
 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 - 23 Mar 2004 12:29 GMT
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

>   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.
Arr S - 24 Mar 2004 07:11 GMT
  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

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.