I have tried several methods, but problems always exist. Sometimes the sub-window didn't refresh and sometimes the sub-window will keep blink.
This is a sample project that i have written
http://rapidshare.com/files/283950611/TestProject.7z.html
My method to implement that is:
Put a scroll bar on the top of sub-window, whenever the scro...
I'm looking for a C++ "equivalent" of Java ByteBuffer.
I'm probably missing the obvious or just need an isolated usage example to clarify. I've looked through the iostream family & it looks like it may provide a basis. Specifically, I want to be able to:
build a buffer from a byte array/point and get primitives from the buffer, e.g. g...
I want to have a list of items that need to be processed in a QListWidget. Similar to Windows Media Player CD import, there should be a progress bar for every item in the list.
Now there seems to be a way to do this by creating a regular progress bar, using QPixmap::grabWidget() to save its appearance in a QPixmap and then adding this Q...
I am implementing a C++ message queue based on a std::queue.
As I need popers to wait on an empty queue I was considering using mutex for mutual exclusion and cond for suspending threads on empty queue, as glib does with the gasyncqueue.
However it looks to me that a mutex&semaphore would do the job, I think it contains an integer and ...
Hello,
I'm trying to do real-time pitch detection using C++. I'm testing some code from performous (http://performous.org/), because everything else hasn't worked for me. I know for sure that this works, but i just cant get it to work. I've been trying this for a few weeks now, and i haven't been able to get any pitch detection code wor...
Hi,
So I have megabytes of data stored as doubles that need to be sent over a network... now I don't need the precision that a double offers, so I want to convert these to a float before sending them over the network. What is the overhead of simply doing:
float myFloat = (float)myDouble;
I'll be doing this operation several million t...
I am building the debug version of my app, with full symbols. I set a breakpoint on the following line:
throw std::range_error( "invalid utf32" );
When the breakpoint hits, my stack looks normal. I can see all my routines. But if I run, and let the exception get thrown, I see a worthless stack. it has MyApp.exe!_threadstartex() towards...
I'm trying to create a DLL that exports a function called "GetName". I'd like other code to be able to call this function without having to know the mangled function name.
My header file looks like this:
#ifdef __cplusplus
#define EXPORT extern "C" __declspec (dllexport)
#else
#define EXPORT __declspec (dllexport)
#endif
EXPORT TCHA...
Hi all
I dont know which is the best practice when we want to create a new vector 3D class, i mean, which of this two examples is the best way ?
class Vec3D
{
private:
float m_fX;
float m_fY;
float m_fZ;
...
};
or
class Vec3D
{
private:
float m_vVec[3];
...
};
With the first aproach, we...
Is there an easy way to remove the QDockWidget's resize handle? My dock widget can't be resized (the sizepolicy is fixed), so having the handle there is just redundant.
...
I have an unmanaged c++ library that outputs text to an std::ostream*.
I call this from a managed c++ wrapper that is used by a c# library.
Currently I pass the unmanaged code a pointer to a std::stringstream and then later call System.String(stringstream.str().c_str()) to copy my unmanaged buffer back into a .net friendly string.
Is ...
Okay i've seen this done somewhere before where you have a function that takes a pointer parameter and returns a pointer.
However you can choose not to pass a parameter and it will return a dynamically allocated pointer but if you do pass a pointer then it just fills it in instead of creating one on the heap. This is a single function n...
I have some static const strings as private members of my C++ class. I am aware of the declaration in .h and definition (and initialization) in .cpp practice. In the class constructor I invoke a function that uses these static strings. Surprisingly when in constructor, the strings remain uninitialized (empty strings) which is creating a ...
My company has a large Windows application with a document-object model: open application, open a file, make some changes, save, close. I'm attempting to cut the GUI off of the top and create a console application that accepts some parameters, opens a file, does something useful, saves, closes the file, and terminates. Because there is...
solved
I changed the bfs::directory_iterator Queue to a std::string queue, and surprisingly solved the problem.
Hi, I have a gut feeling that i'm doing things wrong.
I've implemented (or attempted to) the thread pool pattern.
N threads read from a Queue, but i'm having some trouble. Here's what i got:
//inside a while loop
bool isE...
I am unclear about the following.
First, this code compiles fine:
#include <vector>
typedef struct{
int x1,x2,x3,x4;
} ints;
typedef std::vector<ints> vec;
int main(){
vec v;
ints a = {0,1,2,3};
v.push_back(a);
}
The following code is near identical:
#include <vector>
typedef std::vector<int[4]> vec;
int main(){
vec v;
i...
I'm looking for help porting this Windows tool to Unix (Mac/OSX);
http://www.oxyron.de/html/netdrive01src.zip
First off I'd like to know, if anyone could take a moment to have a quick look at the (small) source code, if it's a reasonably straight-forward task.
Secondly, any tips on porting the code would be much appreciated.
I've tri...
How does one use QFileSystemModel in the context of a QCompleter? It looks like a better choice than QDirModel as it is non UI-blocking. The following snippet doesn't seem to do anything.
QLineEdit* l = new QLineEdit ;
QCompleter* c = new QCompleter ;
QFileSystemModel* m = new QFileSystemModel ;
m->setRootPath( "c:\\" ) ;
c->setModel( m...
When using the CB_SETCURSEL message, the CBN_SELCHANGE message is not sent.
How to notify a control that the selection was changed ?
P.S.
I found on the Sexchange site, a very ugly hack :
SendMessage( hwnd, 0x014F/*CB_SHOWDROPDOWN*/, 1, 0 );
SendMessage( hwnd, 0x014E/*CB_SETCURSEL*/, ItemIndex, 0 );
SendMessage( hwnd, 0x0201/*WM_LBU...
I'd like to include just one file instead of all of them, because the compiler I have to use does not include them by default.
...