Questions tagged [safearray]

145 questions
0
votes
1 answer

SafeArrayPutElement method throws System.AccessViolationException

I am trying to pass an array of ints from C# to C++/CLI. Here's my code: // SafeArrayTesting_PlusPlus.cpp #include "stdafx.h" #include using namespace System; namespace SafeArrayTesting_PlusPlus { public ref class…
user181813
  • 1,861
  • 6
  • 24
  • 42
0
votes
1 answer

SAFEARRAY* to QByteArray

I'm get through c++ invoke(...) method result at type VARIANT * var. var is .bmp image. qDebug() << var.vt; //8209 ~ VT_ARRAY|VT_UI1 ~ SAFEARRAY(BYTE) How convert it from SAFEARRAY(BYTE) to QByteArray? Or how get QImage (QPixmap, QBitmap)? Thanks/.
magrif
  • 396
  • 4
  • 20
0
votes
1 answer

How work with SAFEARRAY ** in Qt ActiveX

How work with SAFEARRAY ** in Qt ActiveX? What kind of type SAFEARRAY ** in Qt?
0
votes
1 answer

WCF Com Interop GetRecordInfoFromGuids Returns Old Format Or Invalid Type Library

I have a struct in a WCF Service defined in C# as [DataContract] [StructLayout(LayoutKind.Sequential), Serializable] [ComVisible(true)] public struct MyData { [DataMember] public int data1; [DataMember] public…
TimR75
  • 379
  • 2
  • 13
0
votes
2 answers

Create SAFEARRAY of Strings in Python

I'm trying to call a COM method that requires a SafeArray of Strings to be passed as reference, which is then filled up with the method results. This is the code in VBA, which works flawlessly: dimr RC as New RAS41.HECRASController RC.Project_Open…
0
votes
0 answers

Why does SafeArrayUnaccessData throws debug assertion failed

Below is my code int _tmain(int argc, _TCHAR* argv[]) { CComSafeArray sa; vector vec; for (int i = 0; i<3 ; i++ ) { func(&(sa.m_psa)); long* pVals; HRESULT hr = SafeArrayAccessData(sa,…
samnaction
  • 1,194
  • 1
  • 17
  • 45
0
votes
1 answer

How to call a .NET COM method with an array from delphi using PSafeArray?

I have an .NET (4.0) interface which is implemented with a ServicedComponent COM+ class: interface DotNetIface { void MethodRef(var System.Guid guid); void MethodArray(System.Guid[] guids, params object[] parameters); void…
Sebastian
  • 6,293
  • 6
  • 34
  • 47
0
votes
1 answer

How do I pass an array of structs (containing std:string or BSTR) from ATL to C#. SafeArray? Variant?

I have an ATL COM object that I am using from C#. The interface currently looks like: interface ICHASCom : IDispatch{ [id(1), helpstring("method Start")] HRESULT Start([in] BSTR name, [out,retval] VARIANT_BOOL* result); ... [id(4),…
Dave
  • 8,095
  • 14
  • 56
  • 99
0
votes
1 answer

E_INVALIDARG exception passing a SAFEARRAY of UDT from Managed to COM

a similar problem is posted many times here but I cannot figure out why I get this COM Exception. I have an IDL file like: typedef [uuid(A6F30630-53F5-4688-829A-C084BA1C7DC0)] enum EMaskActions { .... }EMaskActions; typedef…
Barzo
  • 1,039
  • 1
  • 11
  • 37
0
votes
0 answers

Python -COMMETHOD ,No return value obtained

I am very new to COM programming, Our project requires the Python script to make communication with a COM dll which is written in C#. The generated COM signature in Python is as below COMMETHOD([dispid(1610743820)], HRESULT, 'test', (…
Sanju
  • 1,974
  • 1
  • 18
  • 33
0
votes
1 answer

How do you get the underlying SAFEARRAY from a CComSafeArray?

I tried the GetSafeArrayPtr() method which returns a LPSAFEARRAY* that a typedef defined as: typedef /* [wire_marshal] */ SAFEARRAY *LPSAFEARRAY; I thought I would be able to directly assign this to a SAFEARRAY* variable but the compiler gives this…
bobbyalex
  • 2,681
  • 3
  • 30
  • 51
0
votes
0 answers

SafeArray of objects

I want to pass a SafeArray to a function in C++ COM. I have an object of MetadataListEntity class that I have initialized IMetadataListEntityPtr metadataListEntity = NULL; hr = CoCreateInstance( __uuidof(MetadataListEntity), NULL, …
Gags
  • 827
  • 2
  • 13
  • 29
0
votes
1 answer

Merge two SAFEARRAY's - SafeArrayPutElement memory access violation

I am getting some memory access violation while execute the following code: UINT cDims = 1; SAFEARRAYBOUND rgsabound[1]; long lLbound = 0; long lUbound = 0; rgsabound[0].lLbound = 0; rgsabound[0].cElements = pList1->rgsabound[0].cElements +…
0
votes
1 answer

Equivalent of _variant_t in Qt

I am trying to translate a Visual-C++ code to Qt. Is there an equivalent of _variant_t? The code is: // // Get safarray containing all vectors from multibuffer // _variant_t vaArray(function->GetAllValues(TRUE)); // Take ownership of the variant -…
Maxbester
  • 2,435
  • 7
  • 42
  • 70
0
votes
2 answers

C++ COM [in, out] safearrays

I need to call a COM function in C++ that returns a reference to a SAFEARRAY(BSTR). According to this document, it should be: QAxObject object = new QAxObject(...); QStringList list; for(int i=0; i
Maxbester
  • 2,435
  • 7
  • 42
  • 70
1 2 3
9
10