Questions tagged [safearray]

145 questions
0
votes
1 answer

how do I overload a function in IDL based on array parameter item type?

suppose I had this function defined in IDL like this: [propget, id(6), helpstring("property MyArray")] HRESULT MyArray([out, retval] SAFEARRAY(myEnum)* pVal); and I wanted to create an overload for that function defined in IDL like this: [propget,…
mtijn
  • 3,610
  • 2
  • 33
  • 55
0
votes
1 answer

Do I need to call SafeArrayUnLock in this code?

I'm new member of the team and I read code below. I wonder do I need to call SafeArrayUnLock in the dctor? I tried to search on web without clear clue. So really appreciate your help! Code: class Trasaction { private: CComSafeArray…
Roy
  • 81
  • 3
  • 10
0
votes
2 answers

Marshaling a SAFEARRAY of Managed Structures by COM Interop

i am trying to pass an array of struct exported from a c# library to c++ code. the objective is to pass SAFEARRAY of struct from c++ to c#. I have followed instructions from…
TrustyCoder
  • 4,749
  • 10
  • 66
  • 119
0
votes
2 answers

COM: Access violation making a SafeArray of BSTRs

The following code worked just fine thank you with one COM client, but with a new client (the updated version of the same software) string_array_to_bstr_safearray_variant throws an access violation and everything dies. Can anyone tell me if I'm…
Sideshow Bob
  • 4,566
  • 5
  • 42
  • 79
-1
votes
1 answer

SAFEARRAY data to unsigned char*

I am trying to convert a SAFEARRAY data pointer to unsinged char*. However I am not getting the expected data. Here is a snippet. SafeArrayLock(psaFrameData); psaFrameData->rgsabound->cElements; int nCount = psaFrameData->rgsabound->cElements - …
Ilian Zapryanov
  • 1,132
  • 2
  • 16
  • 28
-1
votes
1 answer

C++ SafeArrayLock/Unlock creates undefined reference

Whenever trying to use SafeArrayLock/Unlock I keep getting the message "undefined reference to 'SafeArrayLock@4'. I'm using Code::Block and just copy/pasting the default microsoft example for…
efnfast
  • 47
  • 1
  • 4
-1
votes
1 answer

How to convert PVOID to int?

I got a function : SAFEARRAY FAR* pArray = NULL; and I get that function : pServer1->GetDirectMemory(dwAddrBegin, dwAddrEnd, wDisplayWidth, &pArray); I want to get information from pArray, if i look the structure of it, I have PVOID pvData; that…
Fred37b
  • 822
  • 2
  • 10
  • 29
-1
votes
1 answer

COM method return correct value only when it invoked with pause intervals

I have COM object, which I initialize it at once: ISTIPositionPtr _position; CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); _position.CreateInstance(__uuidof(STIPosition)); Next I have function, that invoke method of this COM object: LPSAFEARRAY…
Eldar Agalarov
  • 4,849
  • 4
  • 30
  • 38
-1
votes
1 answer

How to implement a SAFEARRAY(long) parameter?

I currently have a C# method in an interface that has the following parameters when viewed in ITypeLib HRESULT _stdcall SomeMethod ([in] Is_interface* inst, [in] SAFEARRAY(long) bid); The above method is in an interface and is defined…
Rajeshwar
  • 11,179
  • 26
  • 86
  • 158
-2
votes
1 answer

SafeArray of SafeArrays? Help to transfer VBA code to C++

FieldInfo:=Array(Array(1, 2), Array(2, 2), Array(3, 2), Array(4, 2), Array(5, 2)) such code from above I have at VBA macros. Now the same thing I should create in a C++ code. As far as I could understand till now - I should use SAFEARRAY type. But…
graphElem
  • 123
  • 2
  • 10
1 2 3
9
10