The following steps provide an overview of how you work with the API to control QMF for Windows:
Create an instance of the QMF for Windows API object.
If you are using Microsoft Visual Basic, add a reference to the QMF for Windows type library, qmfwin.tlb. Then use the Dim statement: Dim QMFWin As New QMFWin
or the CreateObject statement:
Dim QMFWin As Object Set QMFWin = CreateObject("QMFWin.Interface")
If you are using Microsoft Visual C++ and Microsoft Foundation Class (MFC), create a wrapper class for the QMF for Windows API object from the QMF for Windows type library, qmfwin.tlb. Then use the following CreateDispatch() function:
COleException e; IQMFWin QMFWin; QMFWin.CreateDispatch("QMFWin.Interface", &e);
Select the server you want to use and call InitializeServer() to initialize a connection to the database.