设了断点只跑了一步就停了,显示对话框"No symbols are loaded for any call stack frame. The source code cannot be displayed."
我在windows mobile IE 上可以显示那个按钮的, 按下去后没有反应也没有报错
idl中未声明IGPSReader接口和GetGPSinfo函数,浏览器当然找不到这个函数了
不好意思没贴全. // GPS.idl : IDL source for GPS //// This file will be processed by the MIDL tool to // produce the type library (GPS.tlb) and marshalling code.import "oaidl.idl"; import "ocidl.idl";[ object, uuid(454F78B0-086F-4B81-88DD-55E43A6009F4), dual, nonextensible, helpstring("IGPSReader Interface"), pointer_default(unique) ] interface IGPSReader : IDispatch{ [id(1), helpstring("method GetGPSinfo")] HRESULT GetGPSinfo( [out,retval] LONG * m_gpsInfo); }; [ uuid(C9C53C58-3B3D-4A9B-8ED1-88FCFB5942C8), version(1.0), helpstring("GPS 1.0 Type Library") ] library GPSLib { importlib("stdole2.tlb"); interface IDocHostUIHandlerDispatch; interface IAxWinAmbientDispatchEx; [ uuid(53A7AFB1-E3EE-4D7A-90BF-3D466B12A4ED), helpstring("_IGPSReaderEvents Interface") ] dispinterface _IGPSReaderEvents { properties: methods: }; [ uuid(121573D2-480D-468C-ADB5-2935B440523E), helpstring("GPSReader Class") ] coclass GPSReader { [default] interface IGPSReader; [default, source] dispinterface _IGPSReaderEvents; }; };
不好意思没贴全. // GPS.idl : IDL source for GPS //// This file will be processed by the MIDL tool to // produce the type library (GPS.tlb) and marshalling code.import "oaidl.idl"; import "ocidl.idl";[ object, uuid(454F78B0-086F-4B81-88DD-55E43A6009F4), dual, nonextensible, helpstring("IGPSReader Interface"), pointer_default(unique) ] interface IGPSReader : IDispatch{ [id(1), helpstring("method GetGPSinfo")] HRESULT GetGPSinfo( [out,retval] LONG * m_gpsInfo); }; [ uuid(C9C53C58-3B3D-4A9B-8ED1-88FCFB5942C8), version(1.0), helpstring("GPS 1.0 Type Library") ] library GPSLib { importlib("stdole2.tlb"); interface IDocHostUIHandlerDispatch; interface IAxWinAmbientDispatchEx; [ uuid(53A7AFB1-E3EE-4D7A-90BF-3D466B12A4ED), helpstring("_IGPSReaderEvents Interface") ] dispinterface _IGPSReaderEvents { properties: methods: }; [ uuid(121573D2-480D-468C-ADB5-2935B440523E), helpstring("GPSReader Class") ] coclass GPSReader { [default] interface IGPSReader; [default, source] dispinterface _IGPSReaderEvents; }; };
用windbg,attach IE来调试,要配symbol server
<OBJECT ID="GPS" CLASSID="clsid:53A7AFB1-E3EE-4D7A-90BF-3D466B12A4ED" WIDTH=0 HEIGHT=0 > </OBJECT> 改成 var ret = new ActiveXObject("AXSample.AXSampleCtl");就行了没搞懂
clsid错了,
换成coclass GPSReader的uuid(121573D2-480D-468C-ADB5-2935B440523E)。
设了断点只跑了一步就停了,显示对话框"No symbols are loaded for any call stack frame. The source code cannot be displayed."
不好意思没贴全.
// GPS.idl : IDL source for GPS
//// This file will be processed by the MIDL tool to
// produce the type library (GPS.tlb) and marshalling code.import "oaidl.idl";
import "ocidl.idl";[
object,
uuid(454F78B0-086F-4B81-88DD-55E43A6009F4),
dual,
nonextensible,
helpstring("IGPSReader Interface"),
pointer_default(unique)
]
interface IGPSReader : IDispatch{
[id(1), helpstring("method GetGPSinfo")]
HRESULT GetGPSinfo( [out,retval] LONG * m_gpsInfo);
};
[
uuid(C9C53C58-3B3D-4A9B-8ED1-88FCFB5942C8),
version(1.0),
helpstring("GPS 1.0 Type Library")
]
library GPSLib
{
importlib("stdole2.tlb");
interface IDocHostUIHandlerDispatch;
interface IAxWinAmbientDispatchEx;
[
uuid(53A7AFB1-E3EE-4D7A-90BF-3D466B12A4ED),
helpstring("_IGPSReaderEvents Interface")
]
dispinterface _IGPSReaderEvents
{
properties:
methods:
};
[
uuid(121573D2-480D-468C-ADB5-2935B440523E),
helpstring("GPSReader Class")
]
coclass GPSReader
{
[default] interface IGPSReader;
[default, source] dispinterface _IGPSReaderEvents;
};
};
不好意思没贴全.
// GPS.idl : IDL source for GPS
//// This file will be processed by the MIDL tool to
// produce the type library (GPS.tlb) and marshalling code.import "oaidl.idl";
import "ocidl.idl";[
object,
uuid(454F78B0-086F-4B81-88DD-55E43A6009F4),
dual,
nonextensible,
helpstring("IGPSReader Interface"),
pointer_default(unique)
]
interface IGPSReader : IDispatch{
[id(1), helpstring("method GetGPSinfo")]
HRESULT GetGPSinfo( [out,retval] LONG * m_gpsInfo);
};
[
uuid(C9C53C58-3B3D-4A9B-8ED1-88FCFB5942C8),
version(1.0),
helpstring("GPS 1.0 Type Library")
]
library GPSLib
{
importlib("stdole2.tlb");
interface IDocHostUIHandlerDispatch;
interface IAxWinAmbientDispatchEx;
[
uuid(53A7AFB1-E3EE-4D7A-90BF-3D466B12A4ED),
helpstring("_IGPSReaderEvents Interface")
]
dispinterface _IGPSReaderEvents
{
properties:
methods:
};
[
uuid(121573D2-480D-468C-ADB5-2935B440523E),
helpstring("GPSReader Class")
]
coclass GPSReader
{
[default] interface IGPSReader;
[default, source] dispinterface _IGPSReaderEvents;
};
};
ID="GPS"
CLASSID="clsid:53A7AFB1-E3EE-4D7A-90BF-3D466B12A4ED"
WIDTH=0
HEIGHT=0
>
</OBJECT>
改成 var ret = new ActiveXObject("AXSample.AXSampleCtl");就行了没搞懂