Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> OO4O & ORADC

OO4O & ORADC

From: Krzysztof Kwiatkowski <Krzysztof.Kwiatkowski_at_ComArch.pl>
Date: Thu, 21 Jan 1999 11:33:21 GMT
Message-ID: <36A71DED.847087E4@ComArch.pl>


I'm writing a plug-in to the application which uses OO4O 2.3. I need to write it in VC++5.0 using ActiveX controls ORADC and DBGrid. Application passes to the plug-in the pointer to ODatabase and I need to create ODynaset object with "select *..." and pass it to the ORADC control using SetRecordset method. But ORADC has the following definition:

        void SetRecordset(LPDISPATCH p);

so I need to pass LPDISPATCH to my ODynaset, not a pointer to it.

If I directly set RocordSource, Connect and DatabaseName in Properties of ORADC it works and I can get ODynaset from ORADC using this code
(mayby this method is not very good):
 

 ODynaset Dyna;
 ODatabase* odb = g_pPlugIn->pDispatchInfo->pDatabase; <-- ODatabase from application
 CString sqlst = "select * from vmt_usersex where is_group = 'N'";  CORADC* pOdc = (CORADC*)GetDlgItem(IDC_ODC_USERS); <-- pointer to my ORADC control  

 if (pOdc != NULL) {
   LPDISPATCH dyni = pOdc->GetRecordset();    oresult ores = Dyna.OpenHelper(dyni, odb->Internal());    // and now Dyna is the object from ORADC so I can read fields selected in DBGrid associated with ODARC  }else
   return false;

AND THIS IS MY QUESTION:   How to get IDispatch of MY ODynaset object to pass it to ORADC ?

In the source of ODyn.cpp I found the following line which looks like somethig solving my problem but I can't find the definition of "get_CreateDynaset" so I'm lookig for a different way.

oresult ODynaset::Open(const ODatabase &odb, const char *sqlst, long options)

	...
 	IDispatch *dyni = ((_IOraDatabase *)

(odb.Internal()))->get_CreateDynaset((char *) sqlst, options);
...
Received on Thu Jan 21 1999 - 05:33:21 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US