Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to create a DLL

how to create a DLL

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Smith
    wrote on last edited by
    #1

    i created a DLL with some functions that i'd use in a VB or someother application, but the problem is for every exported function , i need to do like [code] Private Declare Function MyTestFun1 Lib "MDLL.dll" (ByVal hWnd As Long, ByVal a As Integer, b As Integer) As Integer Private Declare Function MyTestFun2 Lib "MDLL.dll" (ByVal hWnd As Long, ByVal a As Integer, b As Integer) As Integer [/code] what i need is like, when u create an object using Microsoft scripting runtime, you'll get access to FileSystemObject. (fso) so in VB, you do like [code] Dim fso as new fileSystemObject later on you'd use all functions by fso.(dot).. [/code] how'd i do my own dll like MSScripting runtime..?:( regards, Rookie -- modified at 4:37 Thursday 22nd September, 2005

    N D 2 Replies Last reply
    0
    • S Smith

      i created a DLL with some functions that i'd use in a VB or someother application, but the problem is for every exported function , i need to do like [code] Private Declare Function MyTestFun1 Lib "MDLL.dll" (ByVal hWnd As Long, ByVal a As Integer, b As Integer) As Integer Private Declare Function MyTestFun2 Lib "MDLL.dll" (ByVal hWnd As Long, ByVal a As Integer, b As Integer) As Integer [/code] what i need is like, when u create an object using Microsoft scripting runtime, you'll get access to FileSystemObject. (fso) so in VB, you do like [code] Dim fso as new fileSystemObject later on you'd use all functions by fso.(dot).. [/code] how'd i do my own dll like MSScripting runtime..?:( regards, Rookie -- modified at 4:37 Thursday 22nd September, 2005

      N Offline
      N Offline
      Nilesh K
      wrote on last edited by
      #2

      Try creating DLL through ATL COM and make each function as interface.

      - Nilesh "Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw

      1 Reply Last reply
      0
      • S Smith

        i created a DLL with some functions that i'd use in a VB or someother application, but the problem is for every exported function , i need to do like [code] Private Declare Function MyTestFun1 Lib "MDLL.dll" (ByVal hWnd As Long, ByVal a As Integer, b As Integer) As Integer Private Declare Function MyTestFun2 Lib "MDLL.dll" (ByVal hWnd As Long, ByVal a As Integer, b As Integer) As Integer [/code] what i need is like, when u create an object using Microsoft scripting runtime, you'll get access to FileSystemObject. (fso) so in VB, you do like [code] Dim fso as new fileSystemObject later on you'd use all functions by fso.(dot).. [/code] how'd i do my own dll like MSScripting runtime..?:( regards, Rookie -- modified at 4:37 Thursday 22nd September, 2005

        D Offline
        D Offline
        douglasjordan
        wrote on last edited by
        #3

        There are two things you need to do: First define your functions in the DLL so VB can call them correctly: // DLL external entry points for VB long WINAPI MyTestFun1(HWND hwnd, int a, int b) long WINAPI MyTestFun2(HWND hwnd, int a, int b) // Then you will need a def file for the DLL so the entries are public and VB can pull them out LIBRARY MDLL DESCRIPTION 'Test DLL' EXETYPE WINDOWS EXPORTS MyTestFun1 @1 MyTestFun2 @2 Your VB defines look correct so it should work with these changes.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups