Hello,
I have a program that is executed by another program. The program that is being executed needs files located at its own location [same folder]. If I call myfile.open("xpo.dll") I might get an error because I am not passing the [fullpath + name + extension]. The program that is being executed can vary paths depending on the instal...
Hello
i have this code in QT and all i want to to catch the clicked event when some one clicking in one of the treeview rows without success
here is my code:
(parant is the qMmainwindow)
m_model = new QStandardItemModel(0, 5, parent);
// then later in the code i have
proxyModel = new QSortFilterProxyModel;
proxyModel->setDynamicSor...
I want to make this code work properly, what should I do?
giving this error on the last line.
what am I doing wrong?
i know boost::bind need a type but i'm not getting. help
class A
{
public:
template <class Handle>
void bindA(Handle h)
{
h(1, 2);
}
};
class B
{
public:
void bindB(int number, in...
I am programming on windows, I store my infors into sqlite.
However I find to get all items is a bit slow.
I am using the following way:
select * from XXX;
retriving all items in 1.7MB SQLite DB takes about 200-400ms.
It is too slow. Can Anyone Help!
Many Thanks!
Thanks for your answers!
I have to do a complex operation on the data,...
Using type std::string to accept a sentence, for practice (I haven't worked with strings in C++ much) I'm checking if a character is a vowel or not. I got this:
for(i = 0; i <= analyse.length(); i++) {
if(analyse[i] == 'a' || analyse[i] == 'e' [..etc..]) {
...vowels++;
} else { ...
...consonants++;
}
This works fine if the strin...
I am using festival TTS c++ API in my program.I have downloaded all files from http://www.cstr.ed.ac.uk/downloads/festival/2.0.95/
and install festival and speech_tools successfully on my UBUNTU 10.04
now when compile my c++ programme gcc gives error:
g++ -L/usr/lib -L/home/peeyush/Desktop/festival/src/lib -L/home/peeyush/Desktop/speec...
Here is my situation:
I have an event driven system, where all my handlers are derived from IHandler class, and implement an onEvent(const Event &event) method. Now, Event is a base class for all events and contains only the enumerated event type. All actual events are derived from it, including the EventKey event, which has 2 fields: (...
Hi, i want to copy the files present in a flash drive into hard drives and then run them using a VC++ application. I have a VS 2008..?
...
Given the following classes:
class Foo
{
struct BarBC
{
protected:
BarBC(uint32_t aKey)
: mKey(aKey)
mOtherKey(0)
public:
const uint32_t mKey;
const uint32_t mOtherKey;
};
struct Bar : public BarBC
{
Bar(uint32_t aKey, uint32_t aOtherKey)
...
That may sound a little confusing. Basically, I have a function
CCard newCard()
{
/* Used to store the string variables intermittantly */
std::stringstream ssPIN, ssBN;
int picker1, picker2;
int pin, bankNum;
/* Choose 5 random variables, store them in stream */
for( int loop = 0; loop < 5; ++loop )
{
...
Hi All.
I've a WAVEFORMATEX struct with some codecdata at the end of it (10 bytes).
I'm using C++.
How do I access the data at the end? (this is a purely technical question).
I tried :
WAVEFORMATEX* wav = (WAVEFORMATEX*)pmt->pbFormat;
WORD me = wav->cbSize;
wav = wav + sizeof(WAVEFORMATEX);
BYTE* arr = new BYTE[me];
...
i need to clear the data on serial port when i have read the data from it before i read the data again? i m using c/c++ on windows xp
how can i do so ?
thanx in advance.
...
I've got the situation where the cycle of loading and then closing a document eats up a few Mb of RAM. This memory isn't being leaked as something owns it and cleans it up when the app exits (Visual Leak Detector and the Mac Leaks tool show agreement on this). However, I'd like to find out where it's going. I'm assuming it's some sort...
Suppose I have UTF-8 content stored in memory, how do I read the characters using a pointer? I presume I need to watch for the 8th bit indicating a multi-byte character, but how exactly do I turn the sequence into a valid Unicode character? Also, is wchar_t the proper type to store a single Unicode character?
This is what I have in ...
I'm using swprintf to build a string into a buffer (using a loop among other things).
const int MaxStringLengthPerCharacter = 10 + 1;
wchar_t* pTmp = pBuffer;
for ( size_t i = 0; i < nNumPlayers ; ++i)
{
const int nPlayerId = GetPlayer(i);
const int nWritten = swprintf(pTmp, MaxStringLengthPerCharacter, TEXT("%d,"), nPlayerId);...
Important update: Apparently I drew the wrong conclusion when I asked this question. Thanks to the responses I found out the lambda function [=]() does work fine in a multithreaded scenario. My apologies for posing this confusing question. Please vote to close, as it was a non-issue.
In our company we've written a library function to ...
Is it possible to draw an animated text with QPainter?
I only want to change color of text periodically.
If possible how to achieve?
...
I am working with USB device on Windows that is seen as a virtual serial port. I can communicate with the device using CreateFile and ReadFile functions, but in some cases my application does not call CloseHandle (when my application in development crashes). After that all calls to CreateFile fail (ERROR_ACCESS_DENIED), and the only solu...
Hi fellows,
it's my flight simulation application again. I am leaving the mere prototyping phase now and start fleshing out the software design now. At least I try..
Each of the aircraft in the simulation have got a flight plan associated to them, the exact nature of which is of no interest for this question. Sufficient to say that the...
i want to read serial port when there is some data present i mean on the event when data arrives only then i will read serial port instead of continuously reading the port i have this code for continuous reading the port how can i make it event based.
thanx in advance.
while(1)
{
bReadRC = ReadFile(m_hCom, &byte, 6, &iBytesRead, NUL...