• Welcome, Guest. Please login.
 
September 17, 2019, 09:58:15 am

News:

Welcome to the SQLitening support forums!


A VC++ wrapper for Sqlitening (with demo project)

Started by yctsai, May 22, 2011, 02:05:45 pm

Previous topic - Next topic

yctsai

This is a simple VC++ wrapper for Sqlitening. I've test it in local and remote mode, work great.

It is very simple to use, olny two files:

1. sluwrapper.h : define API prototypes in SQLitening.Dll and SQLiteningU.Dll.
2. sluwrapper.cpp: implementation

Notes:

1. I use CString for convenience, it only works in VC++. If you want to port it to another C++ platform, remember to substitute CString in some way.

2. In the wrapper, I implement two functions: ES2A and DS2U.
ES2A converts and encrypt UNICODE to ASCII string that can be accept by SqliteningU.DLL.
When read from DB, we use DS2U to decrypt and convert it to UNICODE string.

The wrapper can handle any language in the world (Japan, Chinese, UK .. and so on), because, I treat the strings as "Binary raw data".

3. Error handling is weak. I only implement "GetErrorString()", you can modify it to your style.


    result=sluWrapper.SluConnect("LocalHost",51234);
   
    // if result is not zero, some error occur, you can read error string using "GetErrorString()"
    if(result!=0)
        MessageBox(sluWrapper.GetErrorString(),_T("Error"),MB_OK);


Feel free to use it.

Eric~