473,473 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

SafeArrayPutElement ??

Hi,

I am trying to create a safe array of shorts and I am having trouble
with SafeArrayPutElement. How is this used?

Here is my code...
SAFEARRAY* filter;
SAFEARRAYBOUND bound[1];
bound[0].lLbound = 0;
bound[0].cElements = 7;
filter = SafeArrayCreate(VT_I2, 1, bound);
long index[7];
/*
index[0] = 0;
index[1] = 1;
index[2] = 2;
index[3] = 3;
index[4] = 4;
index[5] = 5;
index[6] = 6;
*/
SafeArrayPutElement(filter, index, (void*)visSectionUser);
SafeArrayPutElement(filter, index, (void*)visSectionUser);
SafeArrayPutElement(filter, index, (void*)visRowUser);
SafeArrayPutElement(filter, index, (void*)visUserValue);
SafeArrayPutElement(filter, index, (void*)visSectionUser);
SafeArrayPutElement(filter, index, (void*)visRowUser);
SafeArrayPutElement(filter, index, (void*)visUserValue);
SafeArrayPutElement(filter, index, (void*)1);

When I initilize the index variable I get an unhandled exception when I
make my call to SafeArrayPutElement. But when I don't initilize it and
I go to use my SAFEARRAY things don't work correctly. Am I using
SafeArrayPutElement correctly?

Thanks,
Scott Metzger

Nov 16 '05 #1
0 1653

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

Similar topics

0
by: Channing Jones | last post by:
Hello everyone, I am trying to store data in a binary field of an SQL-Server table using ADODB. So far, I have managed to store a record but not any data in the binary field. I only get...
5
by: apm | last post by:
Any and all: Is there an efficient way to pass a large array from .NET to COM? Can references (or pointer) be passed from COM to NET and NET to COM without the object it refers to being copied?...
5
by: Tronster Hartley | last post by:
I've written an ATL 7.1 component and have a C# 1.1 client that is consuming it. The ATL component has a method with a that returns a SAFEARRAY of INTs, but my C# component chokes on it. The...
0
by: ChrisWoodruff | last post by:
I have a C++ function in a COM object that I am trying to implement in VB.NET (the functionality, NOT the COM object, I want to remove the requirement for the COM DLL) I am an experienced VB...
2
by: siddiq | last post by:
1)I want to play a file when someone dials my phone no 2) also to detect the digit pressed by the caller can i get any idea how to do this in VB.net using TAPI 3 MSDN provides code snippet of...
7
by: lakepeir | last post by:
Hello, I need help with my for loop. The loop does not end. It should end when i is one less than uBound. What happens is that when i is 1 less than uBound, the loop continues with a weird...
1
by: Brendan Grant | last post by:
I’ve got a C# library that I’ve built into a COM component that will be used from a VC++ 6 application and while the creation of the COM object side of things seem to be working fine, using the...
0
by: wmihelpme | last post by:
Hi All, I have written a WMI Program which changes the network settings like ip address, subnet mask, gateway and dns addresses for given adapter number. when I call that function for adapter...
3
by: FariborzNouri | last post by:
Need help with HEC-RAS Hello I am trying to run a COM application known as HEC-RAS from an unmanaged C++ program in Visual Studio. Classes have been added to the project by adding new MFC classes...
0
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,...
0
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...
1
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...
0
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,...
1
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...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.