Jurgen,
Sorry for not answering immediately, I have been busy trying to have it work. The answer is YES, you can call the QP2 DLL functions from ACCESS. I wrote a VBA module based on the C main.cpp code provided with QP2. The VB code provided with QP2 for the functions definitions needed some modifications, but is basically OK.
There is still a problem to fix: VB doesn't allow optional arguments of a function to be of a user-defined type. This is a problem for the the following functions: int __stdcall R2_QP_LoadSymbol(char *sym,void *data,int max_rec,bool RAWDATA = false, bool IGNORE_HOLIDAYS = true, usr_master_def *pMasterRec = 0); int __stdcall R2_QP_Load_First_Symbol( ... int __stdcall R2_QP_Load_Next_Symbol( ...
The equivalent VB code should be:
Public Declare Function LoadSymbol Lib "qpr2vb" (ByVal Symbol$,ByRef data As DataRec, ByVal MaxRecords As Long, Optional ByVal UseRAWMode As Long = True, Optional ByVal IgnoreHolidays As Long = False, Optional ByRef MasterRec As EquityMaster) As Long
But the compiler doesn't like this ... Without the argument referring to EquityMaster browsing works fine, but you don't get all the information out of the database.
I tried several possibilities but haven't found a satisfactory one yet. Does somebody have experience with this ?
I'll keep you posted on this. |