COM IDL
-
Can anyone assist me I currently have a data-access layer written in VB and would like to port it over to C++ as I'm pretty sure there will be speed benefits in doing so... This is the prototype of the function currently in VB: Public Function RunSPReturnRS( ByVal sDSN As String, ByVal sSP As String, ParamArray params() As Variant) As ADODB.Recordset I have no problems with the first two strings but can anyone give me the IDL and the function prototype to handle the ParamArray and returning the Recordset??? I have been able to find any good samples on these... Many thanks, William :-D
-
Can anyone assist me I currently have a data-access layer written in VB and would like to port it over to C++ as I'm pretty sure there will be speed benefits in doing so... This is the prototype of the function currently in VB: Public Function RunSPReturnRS( ByVal sDSN As String, ByVal sSP As String, ParamArray params() As Variant) As ADODB.Recordset I have no problems with the first two strings but can anyone give me the IDL and the function prototype to handle the ParamArray and returning the Recordset??? I have been able to find any good samples on these... Many thanks, William :-D
William, This should work for ya: HRESULT RunSPReturnRS( [in] BSTR sDSN, [in] BSTR sSP, [in, out] SAFEARRAY(VARIANT)* params, [out, retval] _Recordset** ); You will also have to include the ADODB type library to compile in MIDL: importlib("msado21.tlb"); Hope this helps :) Richard Caetano http://www.caetano.com/richard --------------------------- Richard Caetano richard@caetano.com http://www.caetano.com/richard
-
William, This should work for ya: HRESULT RunSPReturnRS( [in] BSTR sDSN, [in] BSTR sSP, [in, out] SAFEARRAY(VARIANT)* params, [out, retval] _Recordset** ); You will also have to include the ADODB type library to compile in MIDL: importlib("msado21.tlb"); Hope this helps :) Richard Caetano http://www.caetano.com/richard --------------------------- Richard Caetano richard@caetano.com http://www.caetano.com/richard
Also I'd be curious to see how you're building that routine. It appears to be a routine to call stored procedures right? Thanks! Richard --------------------------- Richard Caetano richard@caetano.com http://www.caetano.com/richard