How to use LPDISPATCH *ADODBRecordset

Posted on 2003-03-10
Medium Priority
Last Modified: 2008-03-10
I have the following in my cpp file and is created in my idl file...

idl - STDMETHOD(StartReformatProcess)(/*[in]*/ int skip, /*[in]*/ int iloop,/*[in]*/ LPDISPATCH *ADODBRecordset, /*[out]*/ int *errorNo);

cpp - STDMETHODIMP CReformatter::StartReformatProcess(int skip, int iloop, LPDISPATCH *ADODBRecordset, int *errorNo)
//How would i access the recordset that was passed to me.


I guess my question here is "how would I access the recordset from the LPDISPATCH declaration.  I have a VB dll passing it into my VC++ dll... I know that the VB DLL is able to pass it... but I don't know how to use LPDISPATCH to get the recordset information.. can some one please help me out by giving my some examples.


Question by:Blade007
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

AnnaNachesa earned 280 total points
ID: 8106367
You have to do something like:

IRowset* lpRowset = NULL;
ADODBRecordset->QueryInterface(IID_IRowset, (void**)&lpRowset);
then do what you wish
then release the lpRowset as well...

also look here:

LVL 11

Expert Comment

ID: 9978894
No comment has been added lately, so it's time to clean up this TA. I will
leave a recommendation in the Cleanup topic area that this question is:

Answered: Points to AnaNachesa

Please leave any comments here within the next seven days.

Experts: Silence means you don't care. Grading recommendations are made in light
of the posted grading guidlines (http://www.experts-exchange.com/help.jsp#hi73).


-bcl (bcladd)
EE Cleanup Volunteer

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses
Course of the Month9 days, 18 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question