Questions tagged [safearray]

145 questions
0
votes
0 answers

Why is my variant showing as VT_EMPTY despite containing a safearray

I am trying to return an array which is a portion of a vector to VBA. The vector is just an array of data from a test file stored as an std::string. I would like to pass a Row variable to the DLL and have this return the given data from that line…
0
votes
1 answer

I tried to add a new template helper function to my class and now I get a LNK2001 error. How to fix?

I asked a couple of questions recently on StackOverflow to see if I could consolidate some functions into one by making use of templates. Those questions were: Can these methods that convert safe arrays into std::list objects be turned into a…
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
0
votes
1 answer

How to pass single element safearray to COM function in MATLAB

I have an out of process COM server which provides a function f with the following signature: f = void f(handle, int32, SafeArray(int32), SafeArray(int32)) When I try h = actxserver('Server.Object.1'); x0=int32([0 0]); y0=int32([0…
MiB_Coder
  • 865
  • 1
  • 7
  • 20
0
votes
0 answers

Passing a byte array to WMI provider class in C++

I have an implementation of WMI client application in C++. I am looking to call ProtectKeyWithExternalKey method of the Win32_EncryptableVolume class. It takes a byte array as parameter (ExternalKey). uint32 ProtectKeyWithExternalKey( [in,…
ank
  • 79
  • 7
0
votes
1 answer

Passing SAFEARRAY value to COM client

I am trying to Automate a Tool via win32com.client module which expects the Input to be in the following format,The format shown below if specific to MATLAB. HRESULT StaticStokesParameters([in] SAFEARRAY(double) newVal) I have no clue what does…
Ashesh Nair
  • 317
  • 5
  • 21
0
votes
0 answers

C#: Reading SafeArray wrapped in Variant from C++ COM

I'm struggling with using a COM-Object in C#. I referenced the dll, and I'm able to call all the functions that return basic data types. But one function that returns a larger data object always throws a SEHException. The function is defined as…
juju
  • 1
0
votes
0 answers

How can I free the memory of a c++ safearray in c#

I need to pass data from a C++ dll to a C# environment. Therefore I use a 2d SafeArray of doubles. This function passes the data from C++ to C#: void GetIndividualExposures(SAFEARRAY*& data) { SAFEARRAYBOUND bounds[2]; bounds[0].lLbound =…
JKlein
  • 31
  • 8
0
votes
0 answers

CComSafeArray - type mismatch error when filling array passed from C#

I am trying to pass an array of UINT32 from a C# client to C++ ATL COM service. The IDL declaration is: [propput, id(1)] HRESULT ThingyData([in] SAFEARRAY(UINT32) newVal); The C# code that calls it is: thingy.ThingyData = new UInt32[] { (UInt32)1…
smead
  • 1,768
  • 15
  • 23
0
votes
1 answer

Passing a SAFEARRAY variant to vba from a c++ dll

I have in a DLL the following code, which is supposed to take some input from a routine written in VBA, do some stuff with it, and return two 2D-arrays back (so a function is not really doable, besides, if I wanted to return an array containing the…
Noldor130884
  • 974
  • 2
  • 16
  • 40
0
votes
0 answers

How to pass COM parameter of type SAFEARRAY** from C#

I'm trying to call a COM interface function from C# code. This is an aggregated COM interface where I load the implementing COM interface by ProgID and I have to declare the interface myself. The c++ function definition looks…
forother
  • 39
  • 4
0
votes
1 answer

How to pass a list of COleDateTime objects as a SAFEARRAY*

This is my method definition: IMSAToolsLibraryInterface : IUnknown { // // Raw methods provided by interface // virtual HRESULT __stdcall SetPathXML ( /*[in]*/ BSTR strPathXML, /*[out]*/ __int64 * iResult ) = 0; …
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
0
votes
1 answer

Passing array as out parameter from c# using COM

I want to call, using COM, a function with the following signature: void GetCompoundList(ref object compIds, ref object formulae, ref object names, ref object boilTemps, ref object molwts, ref object casnos) I have no access to the implementation,…
seb007
  • 488
  • 3
  • 19
0
votes
0 answers

CComSafeArray alignment of of pvData

In VS c++ I am allocating a CComSafeArray and need the data array behind to be 32 byte aligned. How do I do that. It is not a solution to align the CComSafeArray itself because that does not align the data array behind.
0
votes
4 answers

trouble using unmanaged c++ from c# using dllimport

i am having trouble importing c++ unmanaged dll into C# [winform]. Can someone help? Basically i am just trying to create a safearray of strings in c++ and trying to send it to C#. Here is my c++ code. extern "C" __declspec(dllexport) BOOL…
Alag20
  • 161
  • 1
  • 8
0
votes
1 answer

Passing an array of interfaces from C# to C++/CLI

I am trying to pass an array of interfaces from C# to C++/CLI. Here is the code: // *** SafeArrayTesting_PlusPlus.cpp *** #include "stdafx.h" #include using namespace System; using namespace…
user181813
  • 1,861
  • 6
  • 24
  • 42