Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use SQLite within a WinRT DLL?

I am trying to develop a WinRT DLL which uses SQLite to write database. But it seems like some win32 APIs in SQLite source code are not supported by metro, such as, LoadLibraryW, GetTempPathA.

Is there any way to compile SQLite source code or use SQLite with WinRT DLL?

like image 620
Greg Avatar asked Oct 14 '11 06:10

Greg


3 Answers

Well you could always link sqlite3 statically and define new functions for accessing files etc via sqlite3_vfs.

like image 159
Vinzenz Avatar answered Oct 22 '22 19:10

Vinzenz


In VS2012 there is an extension now called SQLite for Windows Runtime. You can download and install this via Visual Studio (requires a restart of the IDE). Then, go to your WinRT project, Add a Reference, under "Windows" choose "Extensions" and you should see it.

enter image description here

like image 2
b.pell Avatar answered Oct 22 '22 20:10

b.pell


There's a winrt branch of SQLite now that only uses supported API. On top of that, we implemented SQLite3-WinRT, a WinRT component that allows using SQLite in any of the WinRT languages.

like image 1
superquadratic Avatar answered Oct 22 '22 20:10

superquadratic