ATL using struct in x64

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I have a ATL project using MFC in vs2008, and I defined two struct in .idl, then wrote a function to return it.
When I build it to win32, it works perfect, but when I build it to x64, the struct data will be strange.
szCompNum becomes null, and szTitle becomes szCompNum.
How do I solve situation?
thanks[
uuid(4E3933AC-E890-49C7-AF65-1117BACE3099),
version(2.0),
helpstring("Invoice variable")
]
typedef struct InvoiceInfo{
LONG nInstallmentPeriod;
LONG nFirstAMT;
LONG nEachAMT;
BSTR szCompNum;
BSTR szTitle;
BSTR szAddr;
} InvoiceInfo;

[
uuid(4E3933AC-E890-49C7-AF65-1117BACE3098),
version(2.0),
helpstring("Transaction variable")
]
typedef struct TransInfo{
LONG nInstallmentPeriod;
LONG nFirstAMT;
LONG nEachAMT;
InvoiceInfo invoice
BSTR szTransMode;
BSTR szInstallmentType;
BSTR szRedeemType;
} TransInfo;

[
object,
uuid(4E3933AC-E890-49C7-AF65-1117BACE302F),
dual,
nonextensible,
helpstring("IPOSQrPay Interface"),
pointer_default(unique)
]
interface IPay : IDispatch{
[id(8)] HRESULT ComResult([in] BSTR szSystemID, [out] TransInfo* info, [out,retval] LONG* returnVal);
}

View the full article
 
Back
Top