Solved

Use an ActiveX COM DLL within Delphi without .ocx?

Posted on 2004-11-01
469 Views
Last Modified: 2010-04-05
I have a component which is described as an ActiveX COM DLL. I would like to use the component with Delphi 7 to develop applications.
When I have used ActiveX components in the past, there has been a .ocx ActiveX control file which I have used with Component > Import ActiveX > Add to be able to see the component in a palette and add it to my application.
There is no mention of a .ocx file with this release anywhere in the documentation, nor can I find on the www a .ocx file or any guidance which would enable me to get to work. Can someone please fill in the knowledge gap and let me know either how to use this .dll or why it isn't possible?
0
Question by:shallimus
    6 Comments
     
    LVL 6

    Expert Comment

    by:vadim_ti
    if this DLL includes type library, you can select
    components -> import activex control -> add -> select your DLL

    after your TLB will be added to TLB list, you will click "create unit" button,
    as a result interface uniit will be created

    if you will click "install" button, your activex will be installed in component palette
    0
     

    Author Comment

    by:shallimus
    Thanks for your reply vadim_ti.
    I tried adding the DLL, and received no error, but do not see the component in the list. I have looked through several times; it really isn't there. There is a .tlb file in the directory with the DLL.
    Is there something I'm doing wrong, or not doing?
    0
     

    Author Comment

    by:shallimus
    Or, another thought occurs: is there some way to manually add the TLB to Delphi's list, since it doesn't seem to add in the way it is supposed to?
    0
     
    LVL 6

    Accepted Solution

    by:
    You can use TLIBIMP utility

    TLIBIMP yourLibrary.TLB

    2 files will be created:

    yourLibrary_TLB.PAS
    yourLibrary_TLB.DCR

    it will be delphi component and you can install it in regular way

    0
     
    LVL 22

    Expert Comment

    by:mnasman
    Hello

      ActiveX COM Dll is just Com Dll, don't use Import ActiveX menu to add reference to it, instead use Import Type Library from project menu

    0
     

    Author Comment

    by:shallimus
    Thanks vadim. This was great and exactly what I needed. The component is now working in my IDE :)
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
    In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    913 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now