代码改变世界

Windows Phone 中Com组件调用示例下载

2012-03-05 14:07  kaure  阅读(666)  评论(0编辑  收藏  举报

主要是对 “在windows phone Mango中使用原生代码开发程序” 一文中描述程序的补充。有朋友没有明白,所以写了一个。

 1 [
2 object,
3 uuid(00A5B33F-1CED-455A-A688-958AFD3A8CE1),
4 dual,
5 nonextensible,
6 helpstring("ITestSample Interface"),
7 pointer_default(unique)
8 ]
9 interface ITestSample : IUnknown{
10 HRESULT TestMethod1();
11 HRESULT TestMethod2(BSTR InputString, BSTR* OutputString);
12 };
13 [
14 uuid(8E60F6EE-6CCE-4DC2-8D62-639BBBFF7C24),
15 version(1.0),
16 helpstring("ComNative 1.0 Type Library")
17 ]
18 library ComNativeLib
19 {
20 importlib("stdole2.tlb");
21 interface IDocHostUIHandlerDispatch;
22 interface IAxWinAmbientDispatchEx;
23 [
24 uuid(0B615DF3-49D9-4334-879F-A3484D0FD477),
25 helpstring("TestSample Class")
26 ]
27 coclass TestSample
28 {
29 [default] interface ITestSample;
30 };
31 };

注意红色GUID标识。

示例代码下载