473,397 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

COM Interop and Pointer to Array

A function in a COM DLL I use takes a pointer to the first element in
an array of short integers.

Foo(short* array)

COM interop provides this function to me in the .NET world by making
the parameter “ref short”.

Foo(ref short array)

It seems like no matter what I try, the COM DLL only sees the first
element in the array. Is there a way to get it to see the entire array
of values? Maybe some sort of marshalling I haven’t tried yet?

Thanks,
Mike
Oct 28 '08 #1
1 1375
"Mike" <ML****@hotmail.comwrote in message
news:f7**********************************@u57g2000 hsf.googlegroups.com...
A function in a COM DLL I use takes a pointer to the first element in
an array of short integers.

Foo(short* array)

COM interop provides this function to me in the .NET world by making
the parameter “ref short”.

Foo(ref short array)

It seems like no matter what I try, the COM DLL only sees the first
element in the array. Is there a way to get it to see the entire array
of values? Maybe some sort of marshalling I haven’t tried yet?

Thanks,
Mike
Assuming you are using C#, what happens happens if you change the parameter
type to Foo(ref short[] array)?

Oct 29 '08 #2

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

Similar topics

1
by: Nadav | last post by:
Hi, Introduction *************** I have a system build of a collection of 'Native COM objects' and '.NET COM interop' objects, all of the COM objects are managed through a 'Native COM' layer,...
3
by: Stefan Slapeta | last post by:
Hi all, I've no idea how to write the C# signatures for these four kinds of parameters of C++ (better: C) functions exported from a DLL: // i is ONLY out void f1(unsigned int *i); // ai...
3
by: cees | last post by:
Hi, I need to call an external C-function that accept an array of void pointers (void **). Each item can either be a single float,int,char or a C-array of these types. Is that possible and if so...
6
by: Nataraj1978 | last post by:
I have a requirement to use a dll written in Visual C++ 6.0 in my C# application. In order to establish the link between my application and the dll, I have written a ATL COM Component in Visual...
5
by: Richard Lewis Haggard | last post by:
I am trying to create multi-dimensioned arrays in conventional ASP pages and pass these arrays as arguments to functions that are in a C# interop assembly. ASP complains because it doesn't...
1
by: Don.Leri | last post by:
Hi, I have a logger.dll (unmanaged c++ dll compiled in vs2005). I have a C# interop to use that dll in managed code implemented in Interfaces.dll (used by other C# dlls). I also have a...
5
by: John | last post by:
I would like to ask a question that is obvious to all people porting applications from the "traditional" C\VB6 interop scheme choosing C# vs VB.NET. We have a math library in C which...
1
by: Mike | last post by:
A function in a COM DLL I use takes a pointer to the first element in an array of short integers. Foo(short* array) COM interop provides this function to me in the .NET world by making the...
0
by: Mike | last post by:
I am using a COM DLL function that takes a pointer to the first element in an array of short values. Foo(short* array) COM interop provides that function to me in the .NET world with a "ref...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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...
0
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,...
0
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...

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.