Re: Can't fill a SafeArray of UDT in win64

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Can you post the _exact_ definition of your struct in IDL?

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

"Ayal" <ayal@xxxxxxxxxxxxxxxxx> wrote in message
news:exVW$%23SxGHA.4872@xxxxxxxxxxxxxxxxxxxxxxx
I have a problem to fill a SAFEARRAY of UDT in x64. The reason is the size
of struct in C++ is not the same as the size in COM.
When I type sizeof(MyStruct) I get a different number then what is
returned
by IRecordInfo->GetSize()
For example
struct MyStruct
{
VARIANT v;
}
sizeof(MyStructs) gives 24, but IRecordInfo->GetSize() return 16.

In WIN32 it's OK.
Did I miss something?

Ayal




.



Relevant Pages

  • Re: out parameter in COM method
    ... Microsoft MVP, MCSD ... HRESULT STDMETHODCALLTYPE IFace_GetStruct_Proxy(LPVOID pThis, struct ... TestStructType** ppStruct) ... Note I typed this based on the MIDL documentation after correcting ...
    (microsoft.public.vc.atl)
  • Re: recv function
    ... Alexander Nickolov ... > side, when windows is expecting a certain struct, the QNX is sending that ... >> Microsoft MVP, MCSD ... >> MVP VC FAQ: http://www.mvps.org/vcfaq ...
    (microsoft.public.win32.programmer.networks)
  • Re: Returning Structs and .NET Interop
    ... Microsoft MVP, MCSD ... typedef struct DataResult ... BSTR infoA; ...
    (microsoft.public.win32.programmer.ole)
  • Re: Returning Structs and .NET Interop
    ... I suggest you bring this question in the .NET interop group: ... Microsoft MVP, MCSD ... typedef struct DataResult ... BSTR infoA; ...
    (microsoft.public.win32.programmer.ole)
  • Re: Throwing a event with a nested UDT
    ... Microsoft MVP, MCSD ... >> struct within that VARIANT. ... Then I added the nested UDT to the struct, ...
    (microsoft.public.win32.programmer.ole)