Answer the question
In order to leave comments, you need to log in
How to connect to SQLite3?
I decided to connect the sqlite3.dll library to the project using explicit linking. But when trying to connect to the database, the idea fails... Studio points to ' identifier is undefined ' . I can't figure out what I'm doing wrong. help me please
typedef int (*function);
{
HMODULE hm = LoadLibrary(L"sqlite3.dll");
if (NULL == hm)
{
cout << (" not found!\\n");
}
else
{
function SQLITE_OPEN_READONLY = (function)GetProcAddress(hm, "sqlite3_open_v2");
function sqlite3_close = (function)GetProcAddress(hm, "sqlite3_open_v2");
if ((NULL == SQLITE_OPEN_READONLY) || (NULL == sqlite3_close))
{
cout << (" doesn't export functions\\n");
}
else
{
sqlite3* sql_db = NULL;
status = sqlite3_open_v2(TEMP_DB_PATH, &sql_db, SQLITE_OPEN_READONLY, NULL);
if (status != SQLITE_OK)
{
sqlite3_close(sql_db);
DeleteFile(TEXT(TEMP_DB_PATH));
}
cout << "OK"<< endl;
}
}
FreeLibrary(hm);
_getch();
}
return 0;
Answer the question
In order to leave comments, you need to log in
identifier is undefined
typedef int(*function);
typedef int (*function)(void);
status = sqlite3_open_v2(TEMP_DB_PATH, &sql_db, SQLITE_OPEN_READONLY, NULL);
sqlite3_close(sql_db);
typedef sqlite3;
typedef int (*fn1) (sqlite3* db);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question