|
Member 12129820 wrote: Now I need to build a simple register program...
"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
|
|
|
|
|
|
Thanks guys for the help.
|
|
|
|
|
Would it be possible to code the sound to text software from c++? what should we use for that?
|
|
|
|
|
|
Hey everyone i am working on an old code which was written for 'Xtion pro live RGBD camera' my task is to make it compatible for kinect v2, i.e. it must take the input form kinect v2 instead of the old camera. Can somebody help me in the regard that which part of the code to be changed and any idea how to do that?(Working with c++ in visual studio 2013 (The old code includes Opencv, OpenNI and NiTE linked to it)).
(As far as i understood i have to change only the part of code where image acquisition is happening but its too complicated for me as i am new with it)
modified 7-Nov-15 19:07pm.
|
|
|
|
|
Hey everyone i am working on a code where i have to detect angles between the 3 joints i.e. Hip,Knee and ankle, would be grateful if someone here can help me out.(I am working with c++ in Visual studio 2013(The old code includes Opencv, OpenNI and NiTE in it)).
modified 7-Nov-15 18:49pm.
|
|
|
|
|
Hi all,
I am inserting text to CListCtrl Items with function
SetItemText(). The text contains '\t'. I would need to display the text of the subitems with expanded tabulators.
Is there a way? I cannot find any hints about this issue.
Many Thanks
modified 8-Nov-15 15:31pm.
|
|
|
|
|
You need to expand the tabs yourself before adding the strings to the control.
|
|
|
|
|
you propose to replace with number of tabs?
it's much effort, because I need to loop over the text and replace by different number of tabs (depending on position).
further this works only for fix size fonts.
|
|
|
|
|
Well the issue is quite simple: if the control does not expand them for you, then you will need to do it yourself. You can use the GetTextExtentPoint32 function[^] to calculate the average size of the characters, and use that information to calculate the width of the tabs.
|
|
|
|
|
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() ?
Thanks again!
|
|
|
|
|
|
Member 8534035 wrote:
I am inserting text to CListCtrl Items with function
SetItemText(). What does the call to SetItemText() look like?
Member 8534035 wrote: The text contains 't\'. What is so special about the letter t followed by a backslash?
Member 8534035 wrote: I would need to display the text of the subitems with expanded tabulators. What in the world does this mean?
"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
|
|
|
|
|
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.
|
|
|
|
|
Member 8534035 wrote: ...the tabulator is ignored completely. 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;
db->open(gszFile);
SQLite3QueryCpp q = db->execQuery("select * from my_settings");
q.finalize();
db->close();
}
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.
AnsiString sQuery; ...
SQLite3QueryCpp q = db->execQuery(sQuery.c_str());
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.
In fact, if we dumped the sQuery.c_str(), the output was "select * from my_settings".
What's the matter? Please tell me the reason.
I think it'll be no problem in Linux, but I don't know the Windows inside well.
Please help me, Best regards!
-- modified 2-Nov-15 10:51am.
|
|
|
|
|
Member 11967800 wrote: it operated as a stupid. And exactly what are we to understand by that statement?
Member 11967800 wrote: but doesn't act well as a service. Or that?
Please edit your question and explain exactly what problems you see in the code when you try to run it.
|
|
|
|
|
Message Closed
-- modified 2-Nov-15 11:42am.
|
|
|
|
|
Sorry but that information does not give any clues. I can only suggest you add some more debugging logic to your service program to see what is happening.
|
|
|
|
|
Can I make debugging on the running service?
And I'm using VS2015 but service debugging is seen somewhat different with normal application.
Please teach me how to debug service program.
-- modified 2-Nov-15 11:37am.
|
|
|
|
|
|
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.
DALConnection::ExecutionResult
SQLiteRecordset::TryOpen(std::shared_ptr<dalconnection> pDALConn, const SQLCommand &command, String &sErrorMessage)
{
String sSQL = command.GetQueryString();
try
{
std::shared_ptr<sqliteconnection> pConn = std::static_pointer_cast <sqliteconnection>(pDALConn);
std::shared_ptr<sqlite3dbcpp> dbengin_ = pConn->GetConnection();
AnsiString sQuery;
if (!Unicode::WideToMultiByte(sSQL, sQuery))
{
ErrorManager::Instance()->ReportError(ErrorManager::Critical, 5108, "SQLiteRecordset::TryOpen", "Could not convert string into multi-byte.");
return DALConnection::DALUnknown;
}
record_cnt_ = cur_row_ = 0;
field_list_.clear();
value_list_.clear();
ErrorManager::Instance()->ReportError(ErrorManager::High, 3156, "SQLiteRecordset::TryOpen", sQuery);
/*
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.
*/
SQLite3QueryCpp query_ = dbengin_->execQuery(sQuery);
int numFld = query_.numFields();
String data = "\n";
for (int i = 0; i < numFld; i++)
{
field_list_.push_back(query_.fieldName(i));
data += query_.fieldName(i);
data += "\t";
}
data += "\n";
while (!query_.eof())
{
std::vector<ansistring> sRow;
for (int i = 0; i < numFld; i++){
sRow.push_back(query_.fieldValue(i));
data += query_.fieldValue(i);
data += "\t";
}
data += "\n";
value_list_.push_back(sRow);
record_cnt_++;
query_.nextRow();
}
query_.finalize();
ErrorManager::Instance()->ReportError(ErrorManager::High, 3156, "SQLiteRecordset::TryOpen ...", data);
}
catch (...)
{
ErrorManager::Instance()->ReportError(ErrorManager::High, 4202, "SQLiteRecordset::TryOpen", "An unknown error occurred while executing " + sSQL);
return DALConnection::DALErrorInSQL;
}
return DALConnection::DALSuccess;
}
Error Log look like this
ERROR" 5928 "2015-11-02 18:17:33.876" "Severity: 1 (Critical), Code: HM3156, Source: SQLiteConnection::Connect Starting..., Description: e:\develop\MiniMail\Test\Database\MailServer.db3"
"ERROR" 5928 "2015-11-02 18:17:33.877" "Severity: 2 (High), Code: HM3156, Source: SQLiteRecordset::TryOpen, Description: select * from hm_dbversion"
"ERROR" 5928 "2015-11-02 18:17:33.879" "Severity: 2 (High), Code: HM3156, Source: SQLiteRecordset::TryOpen ..., Description:
value
5601
"
"ERROR" 5928 "2015-11-02 18:17:33.879" "Severity: 2 (High), Code: HM3156, Source: SQLiteRecordset::FindRecValue found..., Description: value==>5601"
"ERROR" 5928 "2015-11-02 18:17:33.879" "Severity: 2 (High), Code: HM3156, Source: SQLiteRecordset::TryOpen, Description: select * from hm_settings"
"ERROR" 5928 "2015-11-02 18:17:33.879" "Severity: 3 (Medium), Code: HM5015, Source: PropertySet::GetProperty_(), Description: The property usescriptserver could not be found."
|
|
|
|
|
Sorry, but I cannot figure what is going on here, or what is supposed to be going on. Which of the log messages actually identifies any error?
|
|
|
|
|
"select * from hm_dbversion" reports correct result.
but next "select * from hm_settings" report nothing.
If we change sQuery = "select * from hm_settings" directly, it reports proper result.
But it actually useless in practice, and i need to process the dynamical SQL commands in the service.
I can't find the reason and crashed with a barrier. Now I have a doubt in the timing of SQL commands.
I'm so sorry for your efforts, best regards!
|
|
|
|