佚名通过本文主要向大家介绍了atl组件,atl34砂轮,atl71.dll修复,atl方形动力电池,atl80.dll官方下载等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
问题: 100分求助:ATL组件开发和web调用问题
描述:
解决方案1:
++
LZ可以先用JS调用先,在用C#来写 解决方案2:
描述:
开发环境:windows7, vs2010
开发语言:C++,C#
运行环境:windows7,IE9.0
使用VS2010的ATL开发了一个控制打印机的组件(C++),在C#编写的网页中调用。遇到以下问题:
1、当不调用组件中控制打印机的功能时,运行正常。
2、当调用组件中控制打印机的功能时,运行到打开打印机的USB端口时,就会停止,在IE中会报“WebDev.WebSerber40.exe已停止工作”的信息。
请问大侠,应该如何解决这个问题?
非常感谢!
解决方案1:
++
LZ可以先用JS调用先,在用C#来写 解决方案2:
我正好刚写了一个打印机的组件,哈哈。
在winxp上测试的,没有win7测试。
[
object,
uuid(E631D513-6145-4945-BAAF-1D8D39707695),
dual,
helpstring("IStandardPrinter Interface"),
pointer_default(unique)
]
interface IStandardPrinter : IDispatch
{
[id(1), helpstring("method OpenDevice")] HRESULT OpenDevice([in]BSTR bstrPaperName,[in]PrinterOrientation orientation,[in]BSTR bstrMediaType,[out,retval]VARIANT_BOOL *pboolResult);
[id(2), helpstring("method BeginPage")] HRESULT BeginPage([out,retval]VARIANT_BOOL *pboolResult);
[id(3), helpstring("method AddText")] HRESULT AddText([in]BSTR content,[in]BSTR fontface,[in]long left,[in]long top,[in]VARIANT_BOOL bold,[in]long fontsize,[out,retval]VARIANT_BOOL *pboolResult);
[id(4), helpstring("method AddLine")] HRESULT AddLine([in]long left,[in]long top,[in]long right,[in]long bottom,[in]PenStyle style,[in]long width,[out,retval]VARIANT_BOOL *pboolResult);
[id(5), helpstring("method CommitPage")] HRESULT CommitPage([out,retval]VARIANT_BOOL *pboolResult);
[id(6), helpstring("method BeginJob")] HRESULT BeginJob([out,retval]VARIANT_BOOL *pboolResult);
[id(7), helpstring("method CommitJob")] HRESULT CommitJob([out,retval]VARIANT_BOOL *pboolResult);
[id(8), helpstring("method CancelJob")] HRESULT CancelJob([out,retval]VARIANT_BOOL *pboolResult);
[id(9), helpstring("method CancelAllJobs")] HRESULT CancelAllJobs([out,retval]VARIANT_BOOL *pboolResult);
[id(10), helpstring("method CloseDevice")] HRESULT CloseDevice();
};
[解决方案3:
uuid(2619C6FB-B793-455B-A8F4-E6C29C3CC412),
helpstring("_IStandardPrinterEvents Interface")
]
dispinterface _IStandardPrinterEvents
{
properties:
methods:
[id(1), helpstring("method ReturnStatus")] HRESULT ReturnStatus([in]StatusValue sCode);
};
[
uuid(DEB78E74-159C-4E93-A0FB-0AD7F15EB19E),
helpstring("StandardPrinter Class")
]
coclass StandardPrinter
{
[default] interface IStandardPrinter;
[default, source] dispinterface _IStandardPrinterEvents;
};
重新写一个简单的com调了试试,确定是不是打印机的功能有问题 还是接口本来就不对
解决方案4:你写的组件支持在html5中使用吗?
解决方案5:在自己机子上测试的还是在别人机子上测试的?