IDL文件如下:import "oaidl.idl"; import "ocidl.idl";[ object, uuid(9C0BADE3-30DB-4037-A655-24128EA50623), pointer_default(unique) ] interface ISGWorldObject : IUnknown{ [] HRESULT Open([in] BSTR ProjectURL); }; [ uuid(1B24D8D1-31CC-41BE-B35A-6AF4F955099C), version(1.0), ] library TSDI3DEngineLib { importlib("stdole2.tlb"); [ uuid(295A40CD-7B9C-480D-8958-1518AEB5D619) ] dispinterface _ISGWorldObjectEvents { properties: methods: [id(1), helpstring("This event occurs after TerraExplorer finishes loading a Fly file.")] HRESULT OnLoadFinished(void); [id(2), helpstring("This event indicates to the client the current status of the terrain analysis calculations.")] HRESULT OnAnalysisProgress([in] LONG CurrPos, [in] LONG Range, [in] VARIANT_BOOL* pbCancelled); [id(3), helpstring("This event occurs before a presentation step is activated to notify the client that the step is being activated.")] HRESULT OnBeforePresentationItemActivation([in] BSTR PresentationID, [in] IPresentationStep61* Step); [id(4), helpstring("This event occurs when a standard TerraExplorer menu command’s value is changed.")] HRESULT OnCommandValueChanged([in] LONG commandID, [in] VARIANT newVal); }; [ uuid(A4431A01-0FE6-488E-8E3C-40104FB4DB6B) ] coclass SGWorldObject { [default] interface ISGWorldObject; [default, source] dispinterface _ISGWorldObjectEvents; }; };
import "ocidl.idl";[
object,
uuid(9C0BADE3-30DB-4037-A655-24128EA50623),
pointer_default(unique)
]
interface ISGWorldObject : IUnknown{
[] HRESULT Open([in] BSTR ProjectURL);
};
[
uuid(1B24D8D1-31CC-41BE-B35A-6AF4F955099C),
version(1.0),
]
library TSDI3DEngineLib
{
importlib("stdole2.tlb");
[
uuid(295A40CD-7B9C-480D-8958-1518AEB5D619)
]
dispinterface _ISGWorldObjectEvents
{
properties:
methods:
[id(1), helpstring("This event occurs after TerraExplorer finishes loading a Fly file.")] HRESULT OnLoadFinished(void);
[id(2), helpstring("This event indicates to the client the current status of the terrain analysis calculations.")] HRESULT OnAnalysisProgress([in] LONG CurrPos, [in] LONG Range, [in] VARIANT_BOOL* pbCancelled);
[id(3), helpstring("This event occurs before a presentation step is activated to notify the client that the step is being activated.")] HRESULT OnBeforePresentationItemActivation([in] BSTR PresentationID, [in] IPresentationStep61* Step);
[id(4), helpstring("This event occurs when a standard TerraExplorer menu command’s value is changed.")] HRESULT OnCommandValueChanged([in] LONG commandID, [in] VARIANT newVal);
};
[
uuid(A4431A01-0FE6-488E-8E3C-40104FB4DB6B)
]
coclass SGWorldObject
{
[default] interface ISGWorldObject;
[default, source] dispinterface _ISGWorldObjectEvents;
};
};
其他类型不可,就会造成你这样的问题。