Delphi使用VB6编写的ActiveX控件???

原创 2004年06月11日 15:48:00

以下是我在VB6编写的ActiveX控件wjprnview.ocx,注册并导入Delphi5的开发环境后,Delphi生成的wjprnview_TLB.pas文件,其没有生成Twjprnview类,也没有注册面板上,无法使用,请问有方法吗?

unit wjprnview_TLB;

// ************************************************************************ //
// WARNING                                                                   
// -------                                                                   
// The types declared in this file were generated from data read from a      
// Type Library. If this type library is explicitly or indirectly (via       
// another type library referring to this type library) re-imported, or the  
// 'Refresh' command of the Type Library Editor activated while editing the  
// Type Library, the contents of this file will be regenerated and all       
// manual modifications will be lost.                                        
// ************************************************************************ //

// PASTLWTR : $Revision:   1.88.1.0.1.0  $
// File generated on 2004-06-11 14:04:44 from Type Library described below.

// ************************************************************************ //
// Type Lib: E:/R95/wjprnview.ocx (1)
// IID/LCID: {D72F975E-72DC-11D6-923D-00E04CE8FBA7}/0
// Helpfile:
// DepndLst:
//   (1) v2.0 stdole, (C:/WINNT/system32/stdole2.tlb)
//   (2) v4.0 StdVCL, (C:/WINNT/system32/STDVCL40.DLL)
// ************************************************************************ //
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
interface

uses Windows, ActiveX, Classes, Graphics, OleServer, OleCtrls, StdVCL;

// *********************************************************************//
// GUIDS declared in the TypeLibrary. Following prefixes are used:       
//   Type Libraries     : LIBID_xxxx                                     
//   CoClasses          : CLASS_xxxx                                     
//   DISPInterfaces     : DIID_xxxx                                      
//   Non-DISP interfaces: IID_xxxx                                       
// *********************************************************************//
const
  // TypeLibrary Major and minor versions
  wjprnviewMajorVersion = 29;
  wjprnviewMinorVersion = 0;

  LIBID_wjprnview: TGUID = '{D72F975E-72DC-11D6-923D-00E04CE8FBA7}';

  IID__prnview: TGUID = '{18CF3D27-3867-425A-BCE2-C754EE5FFE5A}';
  DIID___prnview: TGUID = '{A47CD1BA-2E3A-4DCC-BE25-EA98C08DD135}';
  CLASS_prnview: TGUID = '{D72F9760-72DC-11D6-923D-00E04CE8FBA7}';
type

// *********************************************************************//
// Forward declaration of types defined in TypeLibrary                   
// *********************************************************************//
  _prnview = interface;
  _prnviewDisp = dispinterface;
  __prnview = dispinterface;

// *********************************************************************//
// Declaration of CoClasses defined in Type Library                      
// (NOTE: Here we map each CoClass to its Default Interface)             
// *********************************************************************//
  prnview = _prnview;


// *********************************************************************//
// Interface: _prnview
// Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID:      {18CF3D27-3867-425A-BCE2-C754EE5FFE5A}
// *********************************************************************//
  _prnview = interface(IDispatch)
    ['{18CF3D27-3867-425A-BCE2-C754EE5FFE5A}']
    procedure PsetA(var X: OleVariant; var Y: OleVariant; var color: OleVariant); safecall;
    function  TextWidth(var str: WideString): Single; safecall;
    function  TextHeight(var str: WideString): Single; safecall;
    procedure PaintPicture(var pic: IDispatch; var pLeft: OleVariant; var pTop: OleVariant;
                           var pWidth: OleVariant; var pHeight: OleVariant); safecall;
    procedure Refresh; safecall;
    procedure StartDoc(zm: OleVariant; Pw: OleVariant; Ph: OleVariant); safecall;
    function  Get_DrawWidth: OleVariant; safecall;
    procedure Set_DrawWidth(var Param1: OleVariant); safecall;
    function  Get_CurrentX: Single; safecall;
    procedure Set_CurrentX(Param1: Single); safecall;
    function  Get_CurrentY: Single; safecall;
    procedure Set_CurrentY(Param1: Single); safecall;
    function  Get_BackColor: OLE_COLOR; safecall;
    procedure Set_BackColor(Param1: OLE_COLOR); safecall;
    function  Get_ForeColor: OLE_COLOR; safecall;
    procedure Set_ForeColor(Param1: OLE_COLOR); safecall;
    function  Get_Font: IFontDisp; safecall;
    procedure Set_Font(const Param1: IFontDisp); safecall;
    procedure Set_FontName(var Param1: OleVariant); safecall;
    procedure Set_FontSize(var Param1: OleVariant); safecall;
    procedure Set_FontBold(var Param1: OleVariant); safecall;
    procedure Set_FontItalic(var Param1: OleVariant); safecall;
    function  Get_PaperWidth: Single; safecall;
    procedure Set_PaperWidth(var Param1: Single); safecall;
    function  Get_PaperHeight: Single; safecall;
    procedure Set_PaperHeight(var Param1: Single); safecall;
    function  Get_ScaleHeight: Single; safecall;
    procedure Set_ScaleHeight(Param1: Single); safecall;
    function  Get_ScaleWidth: Single; safecall;
    procedure Set_ScaleWidth(Param1: Single); safecall;
    procedure CircleA(var bLeft: OleVariant; var bTop: OleVariant; var bRadius: OleVariant); safecall;
    procedure PrintA(var PrintVar: OleVariant); safecall;
    procedure BoxA(var bLeft: OleVariant; var bTop: OleVariant; var bLeft1: OleVariant;
                   var bTop1: OleVariant); safecall;
    procedure BoxF(var bLeft: OleVariant; var bTop: OleVariant; var bLeft1: OleVariant;
                   var bTop1: OleVariant; var color: OleVariant); safecall;
    procedure LineA(var bLeft: OleVariant; var bTop: OleVariant; var bLeft1: OleVariant;
                    var bTop1: OleVariant); safecall;
    procedure Cls; safecall;
    function  Get_DrawStyle: Smallint; safecall;
    procedure Set_DrawStyle(Param1: Smallint); safecall;
    function  Get_DrawMode: Smallint; safecall;
    procedure Set_DrawMode(Param1: Smallint); safecall;
    function  Get_FontStrikethru: WordBool; safecall;
    procedure Set_FontStrikethru(Param1: WordBool); safecall;
    function  Get_FontUnderline: WordBool; safecall;
    procedure Set_FontUnderline(Param1: WordBool); safecall;
    property DrawWidth: OleVariant read Get_DrawWidth write Set_DrawWidth;
    property CurrentX: Single read Get_CurrentX write Set_CurrentX;
    property CurrentY: Single read Get_CurrentY write Set_CurrentY;
    property BackColor: OLE_COLOR read Get_BackColor write Set_BackColor;
    property ForeColor: OLE_COLOR read Get_ForeColor write Set_ForeColor;
    property Font: IFontDisp read Get_Font write Set_Font;
    property FontName: OleVariant write Set_FontName;
    property FontSize: OleVariant write Set_FontSize;
    property FontBold: OleVariant write Set_FontBold;
    property FontItalic: OleVariant write Set_FontItalic;
    property PaperWidth: Single read Get_PaperWidth write Set_PaperWidth;
    property PaperHeight: Single read Get_PaperHeight write Set_PaperHeight;
    property ScaleHeight: Single read Get_ScaleHeight write Set_ScaleHeight;
    property ScaleWidth: Single read Get_ScaleWidth write Set_ScaleWidth;
    property DrawStyle: Smallint read Get_DrawStyle write Set_DrawStyle;
    property DrawMode: Smallint read Get_DrawMode write Set_DrawMode;
    property FontStrikethru: WordBool read Get_FontStrikethru write Set_FontStrikethru;
    property FontUnderline: WordBool read Get_FontUnderline write Set_FontUnderline;
  end;

// *********************************************************************//
// DispIntf:  _prnviewDisp
// Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID:      {18CF3D27-3867-425A-BCE2-C754EE5FFE5A}
// *********************************************************************//
  _prnviewDisp = dispinterface
    ['{18CF3D27-3867-425A-BCE2-C754EE5FFE5A}']
    procedure PsetA(var X: OleVariant; var Y: OleVariant; var color: OleVariant); dispid 1610809362;
    function  TextWidth(var str: WideString): Single; dispid 1610809363;
    function  TextHeight(var str: WideString): Single; dispid 1610809364;
    procedure PaintPicture(var pic: IDispatch; var pLeft: OleVariant; var pTop: OleVariant;
                           var pWidth: OleVariant; var pHeight: OleVariant); dispid 1610809365;
    procedure Refresh; dispid 1610809366;
    procedure StartDoc(zm: OleVariant; Pw: OleVariant; Ph: OleVariant); dispid 1610809367;
    property DrawWidth: OleVariant dispid 1745027089;
    property CurrentX: Single dispid 1745027088;
    property CurrentY: Single dispid 1745027087;
    property BackColor: OLE_COLOR dispid 1745027086;
    property ForeColor: OLE_COLOR dispid 1745027085;
    property Font: IFontDisp dispid 1745027084;
    property FontName: OleVariant writeonly dispid 1745027083;
    property FontSize: OleVariant writeonly dispid 1745027082;
    property FontBold: OleVariant writeonly dispid 1745027081;
    property FontItalic: OleVariant writeonly dispid 1745027080;
    property PaperWidth: Single dispid 1745027079;
    property PaperHeight: Single dispid 1745027078;
    property ScaleHeight: Single dispid 1745027077;
    property ScaleWidth: Single dispid 1745027076;
    procedure CircleA(var bLeft: OleVariant; var bTop: OleVariant; var bRadius: OleVariant); dispid 1610809369;
    procedure PrintA(var PrintVar: OleVariant); dispid 1610809370;
    procedure BoxA(var bLeft: OleVariant; var bTop: OleVariant; var bLeft1: OleVariant;
                   var bTop1: OleVariant); dispid 1610809371;
    procedure BoxF(var bLeft: OleVariant; var bTop: OleVariant; var bLeft1: OleVariant;
                   var bTop1: OleVariant; var color: OleVariant); dispid 1610809372;
    procedure LineA(var bLeft: OleVariant; var bTop: OleVariant; var bLeft1: OleVariant;
                    var bTop1: OleVariant); dispid 1610809373;
    procedure Cls; dispid 1610809376;
    property DrawStyle: Smallint dispid 1745027075;
    property DrawMode: Smallint dispid 1745027074;
    property FontStrikethru: WordBool dispid 1745027073;
    property FontUnderline: WordBool dispid 1745027072;
  end;

// *********************************************************************//
// DispIntf:  __prnview
// Flags:     (4240) Hidden NonExtensible Dispatchable
// GUID:      {A47CD1BA-2E3A-4DCC-BE25-EA98C08DD135}
// *********************************************************************//
  __prnview = dispinterface
    ['{A47CD1BA-2E3A-4DCC-BE25-EA98C08DD135}']
    procedure MouseMove(var Button: Smallint; var Shift: Smallint; var X: Single; var Y: Single); dispid 1;
    procedure MouseUp(var Button: Smallint; var Shift: Smallint; var X: Single; var Y: Single); dispid 2;
    procedure MouseDown(var Button: Smallint; var Shift: Smallint; var X: Single; var Y: Single); dispid 3;
    procedure Click; dispid 4;
  end;

implementation

uses ComObj;

end.

delphi中ActiveX 和 Web

http://book.77169.com/data/web5302/20050228/20050228__3692503.htmlActiveX 和 Web在Windows 操作系统下,有一个重要的...
  • leixg
  • leixg
  • 2010年05月13日 16:42
  • 3731

Delphi2007 下安装ActiveX控件

此英文文章来自codegear官方网站,但是是讲在BDS2006 下如何安装,我在delphi 2007下用此方法,一样通过,原文如下 Description:How to import an Act...
  • lee576
  • lee576
  • 2007年09月03日 19:44
  • 3872

Delphi 调用VB写的控件[转]

前言        在最近几周的工作里,始终被一个头疼的问题所困扰,那就是VB6编写的ActiveX控件在Delphi环境下存在着诸多稀奇古怪的问题,几经周折,终于在搜索了几乎全部的论坛、资料后,找到...
  • dongzi502
  • dongzi502
  • 2014年01月15日 16:08
  • 514

Delphi下的COM接口編程(ActiveX Library)

在較早的時候,我的博客里已經有關于COM編程的有關知識(http://hi.baidu.com/yueyun889/blog/item/53ad2c1208b6f950f919b8ee.html),不...
  • lailai186
  • lailai186
  • 2012年11月16日 14:18
  • 2995

Activex 控件编程入门实例

直接上图,使用vs2008IDE 1.新建 Activex项目 2.自动生成项目文件  3. 现在添加自己的方法供外部调用     4.实现添加的方法 5....
  • mfc5158
  • mfc5158
  • 2016年06月29日 11:04
  • 335

VB 动态创建ActiveX控件详解

熟悉VB的朋友对使用ActiveX控件一定不会陌生,众多控件极大地方便了编程,但唯一的缺陷是不能动态加载控件,必须在设计时通过引用,将控件放置在窗体上。VB6.0已能够解决该问题,只是帮助中没有明确说...
  • xcntime
  • xcntime
  • 2014年03月21日 20:15
  • 1235

VC开发支持ActiveX控件工程

近日使用VC开发一个带对话框的ActiveX控件第一步:创建ActiveX控件,正常使用 第二步:ActiveX控件添加对话框,正常,参见http://blog.csdn.net/ljz9425/a...
  • ljz9425
  • ljz9425
  • 2012年01月11日 14:52
  • 2908

Activex和javaScript结合使用

http://download1.csdn.net/down3/20070613/13093058219.rar由于项目的需要,将一组事务封装成Activex控件(使用传统的delphi),总结来前人...
  • liuzuofei
  • liuzuofei
  • 2007年06月13日 09:31
  • 988

delphi 10 lite安装 Activex控件的变通方法

delphi 10 lite 直到现在的v3.0还没有加入“Import a Type Library”,很多优秀的Activex控件自然无法使用。本人电脑中同时安装了delphi 7 和delphi...
  • fluky
  • fluky
  • 2007年07月07日 14:23
  • 1617

VB6.0 ActiveX 控件开发详解 [第一章:创建工程]

前言         在CSDN的VB论坛上,我总是能够看见有人这样问“有没有这样的控件,一个列表框,每一个项前面有一个按钮”(这是例子),又或者见到这样:“怎么样做一个ActiveX控件?”,诸如此...
  • JiLuoXingRen
  • JiLuoXingRen
  • 2011年08月03日 18:19
  • 25561
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Delphi使用VB6编写的ActiveX控件???
举报原因:
原因补充:

(最多只允许输入30个字)