From: Adrian S. <ad...@ya...> - 2003-08-22 21:04:52
|
steven wrote: > Adrian, may i have the source code and the step in > using ADO with MinGW via activex? > > Steven Chew > I'm sorry, but I haven't decided to release the source code to the public (at least not yet). However, I can assist you to write your own implementation. I advise you to start with msdn and google and study those functions thoroughly. I think you can find good sample code too. Here's a simplified overview of the process: - first, initialize OLE using OleInitialize - start with the progid (e.g. ADODB.Connection) - get the classid with CLSIDFromProgID - create an object with CoCreateInstance - use QueryInterface to get its IDispatch interface - for each function/property you want to use, get its dispatch id with GetIDsOfNames, and use it with Invoke (you will need to set up a DISPPARAMS structure for the parameters, and work with VARIANTs) - at the end of the program, call OleUninitialize If you do the things this way, then you can use activex objects like in VB, VBScript and JScript. Actually I am pretty sure they do exactly these things inside. If you come across problems, I can help you. Adrian |