473,804 Members | 3,469 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Handling VARIANT Arrays

Hi,

I want to access a VARIANT array returned by a method in VC++, that is
supposed to be a long array.

Can anybody suggest me a way of access this array and get the values
in it.

Following is a sample code:

m_ctrlCashDispe nserActX.GetLas tDispenseCounts ();

The method GetLastDispense Counts() returns a VARIANT array. So how can
I access those long values given in the array.

Is it possible with Safearrays? Give me some sample codes.

Thanks in advance.

Thilanga.
Jul 19 '05 #1
2 7371
Off-topic.

Jul 19 '05 #2
Thilanga wrote:
Hi,

I want to access a VARIANT array returned by a method in VC++, that is
supposed to be a long array.

Can anybody suggest me a way of access this array and get the values
in it.

Following is a sample code:

m_ctrlCashDispe nserActX.GetLas tDispenseCounts ();

The method GetLastDispense Counts() returns a VARIANT array. So how can
I access those long values given in the array.

Is it possible with Safearrays? Give me some sample codes.

Thanks in advance.

Thilanga.


You need to ask in a Visual C++ newsgroup.
The _standard_ C++ langauge, which is discussed in this
newsgroup, does not have a keyword "VARIANT".

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.l earn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3275
by: WSeeger | last post by:
When creating a new class, is it encouraged to always include error handling routines within your LET and GET procedures? It's seems that most text books never seem to include much about error handling within classes. Just hoping to hear some programmer's thoughts on error handling.
2
4426
by: Varun Singal | last post by:
Hi I am calling .NET components from my Classical ASPs. For this I strong named my assemblies, then registered them in the resistry ( using RegAsm), and put them in GAC (using GacUtil) . Everything worked fine and my ASPs were able to call and use them. The problem comes when my ASP code assigns an ASP object variable to a property of a class in the assembly like: oDotNetObject("Name") = Request("Name")
0
1913
by: Andrew S. Giles | last post by:
Helo all, I have a standalone unmanaged C++ application that makes a call on another standalone COM server, which raises an event that should be handled in C#. I am trying to send: unsigned long, double, BSTR, and VARIANT. The unsigned long, double, and BSTR (marshalled to System.String) work just fine and dandy.
34
2242
by: rawCoder | last post by:
I have read that Exception Handling is expensive performance wise ( other than Throw ) , but exactly how ? Please consider the following example ... ////////////////// Code Block 1 ////////////////////////////////// Try { for ( ... ){// Code that might throw exception} }catch(...){} //////////////////////////////////////////////////////////////////////////
0
1080
by: Michael Moreno | last post by:
Hello, I do not find the solution on how to convert this code into .Net public function MyFunc() as variant Dim R as Variant Redim R(0 to 10) as double MyFunc = R end function
2
2395
by: louis | last post by:
I often read a recordset (ADO) into a variant array so that the array can contain text, currency, boolean, etc. VB.Net does not allow variants and the object type gives errors during conversion from VB6. To complicate matters, I also like to make the array 2 dimensions so I can put multiple records into the array. This is a great way to pass recordset info in/out of a subroutine, but now it does not work. Any help most apreciated.
1
2257
by: gilnux | last post by:
Hi all I've got nearly 2 years experience programming in C and image processing. Now I have to migrate one of my applications to a MFC interface. I am having problems with the VARIANT variable. Let's see. I have been using Matrox Imaging Lybrary (MIL). With this library, I can load an image and pass this image into a C array using the function MbufGet() and perform all my calculations using C.
4
6004
by: buzzluck68 | last post by:
Hello, I am having trouble upgrading my VB apps to .net. When i started at my company there was a dll created here in vb6, and i need to use that dll for many functions that would take too much time to re-create for the limit that i am given. I have to create a new app in .net, per my instructions, but the dll uses variant arrays, and i keep getting an error whenever i pass an object array from my .net app to the vb6 dll which needs...
2
4148
by: Simply_Red | last post by:
I'm using VC6. i have a DLL written in VC6 and used by VB6( and VBA Excel), i use SafeArray as parameter, the array is created(declared), in VB and C++ fill it. now i need VC++ to get an array of array of different sizes, and VB can't know the size of these arrays, so the arrays will be 'created' in VC. here the code that i use(and it crashes):
0
9708
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9588
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10327
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7625
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
3
2999
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.