CoCreateInstance failed!!!!
From: Dharani Babu S (dmanian_at_ivesia.com)
Date: 03/18/04
- Next message: Ryszard Halski: "ms sql server; linked server; jet; mdw"
- Previous message: Alexi Jordanov: "ADO Memory Leak??"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 18 Mar 2004 18:38:16 +0530
Hi all
I am a newbie to oledb programming . My requirement is ..
1. Creation and accessing of database from Win Ce/ Embedded vc++ MFC based
application for pocket pc . I am trying to execute the CoCreateInstance
function but it failed .
I have added the following headers also ...
#define OLEDBVER 0x0210 // OLE DB driver version
#define DBINITCONSTANTS // Initialize OLE constants...
#define INITGUID // ...once in each app.
// FOR LISTVIEW CONTROL ONLY, CAN BE REMOVE IS NOT
//APPLICABLE IN THE "ProcessRowset" FUNCTION.
#include <windows.h>
#include <urlmon.h>
#include <oledb.h>
#include <oledberr.h>
#include <ssceoledb.h>
#include <coguid.h>
#include <Oaidl.h>
#include <commctrl.h>
and the code looks like this
hr = CoCreateInstance(CLSID_SQLSERVERCE_2_0,
0,
CLSCTX_INPROC_SERVER,
IDD_IDBInitialize,
(void**)&pIDBInitialize);
But the problem is I got the error " _IDD_IDBInitialize unknown indentifier
" then I checked the oledb.h and found that the line
//IID_IDBInitialize =
{0x0c733a8b,0x2a1c,0x11c{0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d}} was
commented so i uncommented it and gto more errors so I copied the GUID value
to GUID
guid={0x0c733a8b,0x2a1c,0x11c{0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d}}
and passed the value in the place of IDD_IDBInitialize but still the
function failed . Could any of u help me ? I also learned that its
complicated to oledb programming in a MFC app. If so how to over come ? My
ultimate aim is to access a sql server database from sql server ce provider
from embedded vc++ 4.0 , any help is welcome .
with regards and thanks in advance
dharani
- Next message: Ryszard Halski: "ms sql server; linked server; jet; mdw"
- Previous message: Alexi Jordanov: "ADO Memory Leak??"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|