How to add MetaLib to your Visual Basic Project
Steps to add MetaLib to your VB/VBA project:
1. Start the Visual
Basic-Editor (ALT+F11)
2. Open the References dialog

3. Select the MetaLib 5.0
entry.
4. Close the dialog.
5. [Optional] Add the MetaLibUtil.Bas (C:\…\MetaLib\Include)
file to your project.
How to add MetaLib to
your VB.NET project
1. Click on “Project->Add Reference”
2. The “Add Reference” dialog will appear:

3. Double click on the
MetaLib 5.0 entry.
4. The MetaLib entry will appear in the “Selected
Components” list box.
5. Click on “OK”.
VB.NET example code:
|
Dim
Reader As
New METALIBLib.MLReader
Reader.OpenDirectory(“C:\MetaStock”)
Reader.ReadMaster()
' Display all securities that are stored in the MS
directory
While
(Reader.iMaRecordsLeft > 0)
Debug.WriteLine(Reader.sMaSecName + "(" +
Reader.sMaSecSymbol + ")")
Reader.ReadMaster()
End
While
Reader.CloseDirectory()
|
Top
How to add MetaLib to
your C# Project
1. Click on “Project->Add Reference”
2. The “Add Reference” dialog will appear:

3. Double click on the
MetaLib 5.0 entry.
4. The MetaLib entry will appear in the “Selected
Components” list box.
5. Click on “OK”.
For easier use it is
recommended that you write the statement “using METALIBLib;”
at the top of each “.cs” file where you want to use the DLL.
Use the “new” statement to create a new instance of an
interface:
|
MLReaderClass lReader =
new MLReaderClass ();
MLWriter lWriter =
new MLWriterClass (); |
If you do not use the “using
METALIBLib;” statement you have to declare the interfaces as
shown below:
|
METALIBLib.MLReaderClass lReader =
new
METALIBLib.MLReaderClass ();
METALIBLib.MLWriter lWriter =
new
METALIBLib.MLWriterClass (); |
Take a look at the C#
example that is located in the “C:\Program Files\Metalib\Examples\C#”
folder for more details.
How to add MetaLib to
your Delphi Project
1. Click on the Project->Import Type Library menu.
2. The “Import Type Library” dialog will appear.

3. Select the MetaLib 5.0
entry.
4. Make sure that the “Generate Component Wrapper” check box
is unchecked.
5. Click on the “Create Unit” button.
How to add MetaLib to your JAVA Project
You need a COM bridge, like the JACOB project (http://danadler.com/jacob)
if you want to use MetaLib with JAVA. Download the COM
bridge from this site and follow the instructions. |