ADO/ATL: What's wrong... 
Author Message
 ADO/ATL: What's wrong...

Any hint would be appreciated...
It's my very first application in ADO and ATL. I'm developing a
multi-tier app that uses an Access database. Client and middle-tier are
written in Visual C++6. The middle-tier is represented by a DLL made in
ATL Wizard. The client is in a form of dialog and it initializes its
controls through OnInitDialog member function. When I try to fill in a
few controls (combo boxes and lists) with datas from the database my
application shows some strange behaviour.

BOOL CFaktura::OnInitDialog()
{
 CDialog::OnInitDialog();

        ////Initialization of controls

 ......

 IGCExpoPack *pl;
 HRESULT hr=CoCreateInstance(CLSID_GCExpoPack,NULL,
  CLSCTX_ALL,IID_IGCExpoPack,(void**)&pl);

 pRec.CreateInstance(__uuidof(Recordset));
 pl->UspostaviVezu();
 _bstr_t Query("SELECT * FROM Komp WHERE Type='Comp'");

 //AfxMessageBox("OK!");
 hr=pl->ExecuteCommand(Query,&pRec);

 if(SUCCEEDED(hr))
 {

 ........

Quote:
}

It all works well until ExecuteCommand() function. It's just a wrapper
for ADO Execute method and it returns a Recordset.
The strange thing is that it executes well only if I put something like
that AfxMessageBox method... Otherwise SUCCEEDED(hr) macro fails.
Is it a matter of time that COM component requires or what?
Any idea?


Tue, 04 Mar 2003 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. ATL Server / ADO don't work together

2. How to derive new ATL COM class from ADO's _Recordset

3. How to derive new ATL COM from ADO's Recordset

4. ADO In ATL Project,ADO Version,CreateInstance Failed

5. I don't what's wrong!

6. ADO Macros wrong in MSDN Help file

7. what is wrong with this simple ADO code?

8. what's wrong with NT's wininet

9. ADO Whats wrong with that?

10. Can't add new ATL class to ATL wizard generated solution

11. Using ATL's from ATL or C++ Clients

12. Problem with ATL Sink class for catching another ATL's events

 

 
Powered by phpBB® Forum Software