Creating Windows Standard Dynamic Link Library (DLL) to Use with VB6 and Meta Trader (MT4)

Here are some simple steps to create a DLL to use with Meta Trader 4 or VB6.

NOTE: I assume that you have basic programming knowledge.

  1. Download Free Basic Here
  2. Install Free Basic in its default Location. You can read here about FreeBasic.
  3. Free Basic is free programming language to write programs like in MS VB.
  4. After installing FreeBasic, now write your dll code. For example open your favorite text editor and type the following sample code:
  5. 
    extern "windows-ms"
    
    function Add( byval x as integer, byval y as integer ) as integer export
      function = x + y
    end function
    
    function subtraction(byval x as integer, byval y as integer) as integer export
      function = x - y
    end function
    
    function divide(byval x as integer, byval y as integer) as double export
      function = x / y
    end function
    
    function multi(byval x as integer, byval y as integer) as integer export
      function = x * y
    end function
    
    function square(byval x as integer) as integer export
      function = x * x
    end function
    
    function cube(byval x as integer) as integer export
      function = x * x * x
    end function
    
    end extern
    
  6. All your functions should be between the commands [extern "windows-ms"] and [end extern].
  7. Now save the file as “mathlib.bas”. DOWNLOAD HERE sample file and DLL. As we have math functions so we are giving mathlib name, you can give it any other name. If you did not set your path variable to free basic then save file in folder: c:freebasicfreebasicmathlib.bas
  8. Now open DOS command prompt and change directory to:
  9. c:freebasicfreebasic

  10. Now type the following command to compile your file into dll.
  11. c:freebasicfreebasic>fbc -dll mathlib.bas
  12. This will create a mathlib.dll file. Now you can use this dll with any windows application like Meta Trader 4 or VB6.
  13. NOTE: If you have set your path variable to freebasic, then you can invoke “fbc” command from any directory.

Searched By:

mql4 dll (3), freebasic dll mt4 (3), freebasic dll (2), mt4 api dll (2), freebasic extern function (2), visual basic 6 soap (2), freebasic dll for vb net (2), mt4 vb6 (2), mql4 dll c# (2), mql4 dll sample (2), vb2010 export standard api dll (2), MT4 DLL create window (1), mt4 dll freebasic (1), mt4 dll use (1), mt4 dll vb (1), mt4 to vb net (1), mql4 export functinos (1), mt4 dll basic (1), mql4 msgbox (1), mql4 soap (1)

Related posts:

  1. Adding web reference(wsdl service) to visual basic 6 using microsoft soap type library
  2. Alternate to php copy, move function
  3. Back Link Factory
  4. Back Link for Noobs

1 Comment:

  1. Can I make a suggestion? I think youve got something good here. But what if you added a couple links to a page that backs up what youre saying? Or maybe you could give us something to look at, something that would connect what youre saying to something tangible? Just a suggestion.