hmm, maybe I do not understand this approach completely!
I could calculate the text size and tab position. but when replacing the tab character with a number of blanks, I will not get an accurate tab position. it will looks quite crude over several lines. further I will have additional issues with the blanks, when I want do make in place edititing.
Is there any possibility to draw the text of an subitem by myself? e.g. if I would catch a notification message that an subitem needs to be drawn, that I call a function like CDC::TabbedTextOut() ?
sorry, I was talking about '\t', the ASCII sign for tabulator.
If I assign a text with SetItemText() to a CListCtrl item,
the tabulator is ignored completely.
e.g. "label:\tsome text which should begin at next tabulator position"
The CListCtrl is not viewing any spacing for the tabulator.
Of course, since it was not meant to handle it as a special case. One solution would be to call AfxExtractSubString() to break your source string up into its individual tokens. Then you could call InsertItem() to insert an item in the list control, followed by SetItemText() to set the text of subitems.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
I used CppSQLite3_2.zip freeware and wrote some Windows service to manage SQLite DB.
As a simple application, it acts well.
ex. In the application for test, this code reported proper value.
const char* gszFile = "e:\\Test\\Database\\Server.db3";
int TryOpen(char * sql)
SQLite3DBCpp *db = new SQLite3DBCpp;
SQLite3QueryCpp q = db->execQuery("select * from my_settings");
But after implemented as a service, it doesn't returned any values.
ex. in the service program, I used the above code directly.
Here I tried to give SQL cmd as a parameter.
Thank you for your kindly advice.
But my vaccine 365 security reject it as a virus. But www.virustotal.com doesn't report it as a virus. I also have no clue on it, maybe the vaccine detects the approach to the registry by debug mode built service.
Now I'm using Error log file and monitor its action.
Please check this function and give me your precious advice.
sQuery = "select * from my_settings";
If I set this value like this, SQL query will be succeed, but only using sQuery normally will be failed. Simple query such as "select * from my_dbversion" will be succeed but large data querying will be failed. I don't know the clue.
Just noting that in general a windows service would not be used to "manage" a database.
A database might be a windows service (or more than one service.)
A management API would exist on one of those servers.
Then an application, not service, would use that API and present a interface, like a GUI, to a user. The interface could also be a command line console.
A service API that would support the above would support the following
1- A definition of a protocol, such as Rest or more generally http
2- Commands that are sent via the protocol and responses to those commands.
3- The API protocol would be a LAYER on top of the actual management code.
3a - Supporting 3 one should probably add logging.
4- Management layer.
At best from your code it looks something like 3. I suggest you look into learning how to use a logging API.
Additionally there are other aspects involved with getting a windows service to run, and those have nothing to do with the actual database problem. For example
A- Starting/stopping the service
B- Running with the correct user
Member 11967800 wrote:
If I give a static command such as "select * from my_settings" instead of sQuery.c_str(), it operated properly, but it doesn't act when it receives a dynamic params.
That doesn't have anything to do with windows service. It has to do with how you implemented the code. At best this looks like 4 above and you should get it that to work BEFORE you attempt to do anything else.