ActiveX without using a .ocx file
From: Alastair Anderson (alastair_anderson_at_hotmail.com)
Date: 01/19/05
- Next message: AlanGLLoyd: "Re: newbie question sabout class design"
- Previous message: Bjørge Sæther: "Re: Convert C-Builder program to Delphi?"
- Next in thread: Ulrich Korndoerfer: "Re: ActiveX without using a .ocx file"
- Reply: Ulrich Korndoerfer: "Re: ActiveX without using a .ocx file"
- Reply: J French: "Re: ActiveX without using a .ocx file"
- Reply: VBDis: "Re: ActiveX without using a .ocx file"
- Reply: David Reeve: "Re: ActiveX without using a .ocx file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 19 Jan 2005 08:07:02 -0800
Short Question:
---------------
Can I use ActiveX from Delphi on an application which claims to use
ActiveX but has no .ocx file? If so do I use the .dll files or the
.exe?
I haven't used ActiveX before, so all this is totally new to me.
Long Question (to put this in to some context on why I am asking
this):
-----------------------------------------------------------------------
I have been handed a task of writing a piece of label printing
application which interacts with another piece of software called
BarTender to generate the labels from templates.
In the application's help files (segment placed below) it shows an
example of how to do it using visual basic.
I haven't used ActiveX before and having investigated it from the
Delphi side it refers to using a .ocx file which doesn't exist for
this application. It does have an exe and some dll files:
bartend.exe
BtEng.dll
BtPvDt6.dll
cneng.dll
Imgman32.dll
RoboEx32.dll
(I understand ppl reading this might not know what thy mean, but
because I am unsure of dll file naming conventions you may or may not
be able to have a rough guess at if they are needed.)
As far as what I can tell from my limited experience in this, is that
a reference to the bartender application (not sure if it is the exe or
any of the dll's) is being set up in the IDE (through a prompt or
dialog box) and from there-after you can call and use the various
methods and properties that are provided by the bartender application
Any help regarding this would be mucho appreciated as I have been
tearing my hair out for hours now, and I think it is going to be as
simple as "yeah, this is how you do it..." or "no!!!, don't be so
stupid".
HELP FILE SEGMENT
-----------------------------------------------------------------------------
To access the Application object from Visual Basic (or any program
that supports automation), you must perform the following steps.
1. Set a reference to BarTender application.
This can be done from Visual Basic by selecting References from the
Project menu, and selecting BarTender 6.0 library from the Available
References list box. If you are using Visual Basic for Applications
(i.e. supported by Microsoft Office Suite and other programs), the
References dialog can be found in the Tools menu.
-----------------------------------------------------------------------------
2. Declare an object variable of type BarTender.Application using the
Dim command.
-----------------------------------------------------------------------------
3. Start a new or access a running BarTender application by returning
a reference to BarTender Application object and setting it to the
object variable defined in the step above.
----------------------------------------------------------------------------
4. Quit BarTender application using the Quit method of the
Application object.
For example, the following Visual Basic code will start a new copy of
BarTender and quit.
Dim btApp As BarTender.Application
Set btApp = CreateObject("BarTender.Application")
btApp.Quit
If you would like to reference a BarTender application that is already
running then use the GetObject function in place of the CreateObject
function.
You can also declare the Application variable to be of type Object.
However, be careful when using the Object type because it will run
slower. Try always to declare an object variable using its respected
type. You will run faster and will be able to use Visual Basic's
IntelliSense technology.
-----------------------------------------------------------------------------
- Next message: AlanGLLoyd: "Re: newbie question sabout class design"
- Previous message: Bjørge Sæther: "Re: Convert C-Builder program to Delphi?"
- Next in thread: Ulrich Korndoerfer: "Re: ActiveX without using a .ocx file"
- Reply: Ulrich Korndoerfer: "Re: ActiveX without using a .ocx file"
- Reply: J French: "Re: ActiveX without using a .ocx file"
- Reply: VBDis: "Re: ActiveX without using a .ocx file"
- Reply: David Reeve: "Re: ActiveX without using a .ocx file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|