CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2001
    Posts
    36

    Looking for tutorials - how to make a dll/ocx

    Im looking for good tutorials on how to make a dll/ocx

    I have lots of functions that i made and would like to put them into a dll/ocx or something so that i can use them without having to add my modules to every program i make, does anyone know of any really good tutorials??

    Ive been scouring the net, but keep seeming to d/l dll's without the info on how to make them.

    Thanks in advance, a fairly good programmer,but still a relative newbie

    mick


  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Looking for tutorials - how to make a dll/ocx

    Inside vb, call for help and in Search tab digit "Activex"
    Look for "Creating ActiveX Components" and double click on it.

    Cesare Imperiali

    Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris
    and all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

    The Rater
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  3. #3
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: Looking for tutorials - how to make a dll/ocx

    Typically what you would do is group the functions by type and create one public class file for each type. For example if you have some string functions, some math functions and some drawing functions you would have a StringFuncs.cls, a MathFuncs.cls and a DrawingFuncs.cls.

    Then open a new VB project of type ActiveX dll and add these class modules to it. Using the project properties give it a sensible name and then do Project:Make to compile the DLL.

    In your client apps you need to instantiate each class, perhaps using a global object thus:

    Dim myMathFuncs as MyDll.MathFuncs




    and you need to initialise the object before you can use it thus:

    set myMathFuncs = new MyDll.MathFuncs




    Don't forget to release any dll references before you close your client app thus:

    set myMathFuncs = nothing




    Hope this helps,
    Duncan

    -------------------------------------------------
    Ex. Datis: Duncan Jones
    Merrion Computing Ltd
    http://www.merrioncomputing.com
    Check out the new downloads - ImageMap.ocx is the VB control that emulates an HTML image map, EventVB.OCX for adding new events to your VB form and adding System Tray support simply, MCL Hotkey for implemenmting system-wide hotkeys in your application...all with source code included.
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured