PDA

View Full Version : How do I pass a winId to an external application?



agerlach
18th October 2011, 23:30
Hello,

I have an external application that I need to use that requires me to pass a handle for a GUI element so that the external application can draw video from a camera on my GUI. This is done by passing the following arguments to a command line call: "application.exe attachvideo CAMERAID HANDLE". I run the application using QProcess.

My question is how to get the handle of the GUI element and put it into a QString so that I can add it to the command line argument list in order to use QProcess. It sounds like QWidget::winId() is the handle for my GUI element, but I don't know how to work with the WId datatype returned.

I am using windows 7 and the msvc 2008 compiler.

I found the following on another webpage:


HANDLE hData;
std::stringstream ssTmp;
std::string Data;
ssTmp << hData;
ssTmp >> Data;

but I get the following error upon compilation:" 'ssTmp' uses undefined class 'std::basic_stringstream<_Elem,_Traits,_Alloc>' "

Thanks