編譯器錯誤 C2348
'type name': 不是 C 樣式匯總,無法匯出內嵌 IDL
若要將 放在struct
具有 export 屬性的 .idl 檔案中,struct
必須只包含數據。
下列範例會產生 C2348:
// C2348.cpp
// C2348 error expected
[ module(name="SimpleMidlTest") ];
[export]
struct Point {
// Delete the following two lines to resolve.
Point() : m_i(0), m_j(0) {}
Point(int i, int j) : m_i(i), m_j(j) {}
int m_i;
int m_j;
};