在本地用网页调用ACTIVEX的问题,请看源代码...

desert0 2001-08-31 10:18:00
我做了个ATL,然后放在网页中。虽然编译通过,而且网页可以调出,但是ATL的函数并没有起作用,不知在什么地方出了差错,大家帮忙看看。
ATL中接口内的函数,我单独编EXE程序运行是正常的,所以排除函数的逻辑错误。
IDL文件源代码:
#include <olectl.h>
#include "DispIDs.h"

// produce the type library (Iece.tlb) and marshalling code.
import "oaidl.idl";
import "ocidl.idl";

[
object,
uuid(11111111-1111-1111-1111-111111111111),
dual,
helpstring("IIeceControl Interface"),
pointer_default(unique)
]
interface IIeceControl : IDispatch
{
// properties
//
// [propget, id(DISPID_IECE_IMAGE)] HRESULT Image([out, retval] long * plValue);
// [propput, id(DISPID_IECE_IMAGE)] HRESULT Image([in] long lValue);
[id(1)] HRESULT ATLTV_HMOVE([in] int changenumber); //TVADJUST.DLL里的函数
[id(2)] HRESULT ATLTV_VMOVE([in] int changenumber);
[id(3)] HRESULT ATLTV_HAMPLIFY([in] int changenumber);
[id(4)] HRESULT ATLTV_VAMPLIFY([in] int changenumber);
[id(5)] HRESULT ATLTV_DEFAULT();
[id(6)] HRESULT ATLEPROM_READ([in] int iindex, [out, retval] short *ivalue); //EEPROM.C里的函数
[id(7)] HRESULT ATLEPROM_WRITE([in] int iindex, [in] short ivalue);
};
[
uuid(22222222-2222-2222-2222-222222222222),
version(1.0),
helpstring("IeceControl 1.0 Type Library")
]
library IECELib
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");
[
uuid(33333333-3333-3333-3333-333333333333),
helpstring("Event Interface for IeceControl")
]
dispinterface _IeceEvents
{
properties:
methods:
// for some reason OLE_XPOS_PIXELS AND OLE_YPOS_PIXELS cause a compile error
[id(DISPID_MOUSEDOWN)]
void OnMouseDown(short Button, short Shift, long x, long y);
[id(DISPID_MOUSEMOVE)]
void OnMouseMove(short Button, short Shift, long x, long y);
[id(DISPID_MOUSEUP)]
void OnMouseUp(short Button, short Shift, long x, long y);
};

[
uuid(44444444-4444-4444-4444-444444444444),
helpstring("IeceControl Class")
]
coclass IeceControl
{
[default] interface IIeceControl;
[default,source] dispinterface _IeceEvents;
};
};

接口部分代码:
#include "stdafx.h"
#include "initguid.h"
#include "axsample.h"
#include "axsampleCtl.h"
#include <stdio.h>
#include "eeprom.c" //自编的功能函数

#include <windows.h>

#include "tvadjust.h" //要调用的DLL的头文件

HWND hWnd;
BOOL dwflages=FALSE;

extern HINSTANCE g_hInstance;
CIeceControl::CIeceControl()
{

}

CIeceControl::~CIeceControl ()
{

}

STDMETHODIMP CIeceControl::ATLTV_HMOVE(int changenumber)
{
TV_HMOVE(changenumber); //TVADJUST.DLL里的函数
return S_OK;
}
......
}
...全文
85 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
desert0 2001-08-31
  • 打赏
  • 举报
回复
问题已经自行解决,谢谢!
desert0 2001-08-31
  • 打赏
  • 举报
回复
半天了,什么没人关注?
这里人气一天不如一天了:(

3,248

社区成员

发帖
与我相关
我的任务
社区描述
ATL,Active Template Library活动(动态)模板库,是一种微软程序库,支持利用C++语言编写ASP代码以及其它ActiveX程序。
社区管理员
  • ATL/ActiveX/COM社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧