how to write a virtual com port to TCP driver?
Hi I am trying to write a windows virtual com port driver which will divert the data to a IP address. any pointers, best practice will be of help? ...
Hi I am trying to write a windows virtual com port driver which will divert the data to a IP address. any pointers, best practice will be of help? ...
Hey folks. I'm a little confused as to what's going on, i'm playing with some programs from "Accelerated C++", and have hit a problem with one of the early programs (page 35, if you happen to have a copy nearby). It uses this snippet: while (cin >> x) { ++count; sum += x; } ("count" is an integer, "x" is a double) It works as...
How can I get the return value of a process? Basically I'm ShellExecute()ing a .NET process from a DLL (in C++). The process does its task, but now I want to know whether it succeeded or failed. How to do that in WinAPI or MFC? ...
Recently, I was challenged in a recent interview with a string manipulation problem and asked to optimize for performance. I had to use an iterator to move back and forth between TCHAR characters (with UNICODE support - 2bytes each). Not really thinking of the array length, I made a curial mistake with not using size_t but an int to it...
I try to measure the clock cyles needed to execute a piece of code on the TMS32064x+ DSP that comes with the OMAP ZOOM 3430 MDK. I look at the "Programmer's Guide" of the DSP chip and it says that the DSP supports the clock() function. What I do is really simple, I just do start = clock(); for (i=0;i<100;i++){ /* do something here ...
Microsoft provides a method as part of WinHTTP which allows a user to determine which Proxy ought to be used for any given URL. It's called WinHttpGetProxyForUrl. Unfortunately I'm programming in python so I cannot directly access this function - I can use Win32COM to call any Microsoft service with a COM interface. So is there any way...
I want to profile my execution in a non-standard way. Using gprof, Valgrind, Oprofile... for a given function, I only get the mean of its execution time. What I would like is to obtain the standard deviation of this execution time. Example: void a() sleep ( rand() % 10 + 10 ) void b() sleep ( rand() % 14 + 2 ) main for (1 .. 10...
Is there a way to get the C++ pre processor to expand a #define'ed value into a string literal? for example: #define NEW_LINE '\n' Printf("OutputNEW_LINE"); //or whatever This looks to me like it should be possible as it's before compilation? Or is there a better design pattern to achieve this kind of behaviour (without resorting to...
Hi, All I am trying to get the Icon from the system. by using SHGetFileInfo I got the HICON, I tested this HICON with the following code: SHFILEINFO info; //For getting information about the file if (::SHGetFileInfo(ucPath.GrabTString(), 0,&info, sizeof(info), SHGFI_ICON | SHGFI_SMALLICON | SHGFI_SHELLICONSIZE) != NULL) { //Cont...
When debugging code using boost function and bind in Visual Studio, I would like to be able to have the debugger show information about the actual function pointed to by the boost functor. For instance the name of the function, the signature of the original function (before bind was used on it), or the state of the functor. At the momen...
Hi...Please check this code out it compiles and runs absolutely fine.. The question is that when i started learning c++ (turbo c++) i never was able to declare an array of any type as .. datatype var[variable_set_at_runtime]; and i took it for granted that this cant be possible in latest gcc compilers...but surprisingly this is possib...
I have two HANDLEs and they are created from the same file, in such condition I want to write on offset from 1 to 100 using the first HANDLE, and from 101 to 200 using the 2nd HANDLE, from 201 to 300 using the first HANDLE, ..., How can I make this operation seems like a sequential write and no time is wasted between positioning t...
Wikipedia entry for GNU gettext shows an example where the locale is just the lanuage, "fr". Whereas the i18n gettext() “hello world” example has the locale value with both the language and country, "es_MX". I have modified the "es_MX" example to use just the lanuage, "es", but it produces the English text rather the expected Spanish. c...
Hello, i'm trying to hide window after its startup. I have own window-class wich is inherited from QMainWindow. I rewrited showEvent like this: void showEvent (QShowEvent *evt) { if (firstShow) { hide(); firstShow = false; } else { QMainWindow::showEvent(evt); } } But it doesn't work. firstShow is a ...
If I have a class called Test :: class Test { static std::vector<int> staticVector; }; when does staticVector get constructed and when does it get destructed ? Is it with the instantiation of the first object of Test class, or just like regular static variables ? Just to clarify, this question came to my mind after reading Conce...
I am writing a program that uses prints a hex dump of its input. However, I'm running into problems when newlines, tabs, etc are passed in and destroying my output formatting. How can I use printf (or cout I guess) to print '\n' instead of printing an actual newline? Do I just need to do some manual parsing for this? EDIT: I'm receivin...
Hi all I have an application consisting of different modules written in C++. One of the modules is meant for handling distributed tasks on SunGrid Engine. It uses the DRMAA API for submitting and monitoring grid jobs.If the client doesn't supports grid, local machine should be used The shared object of the API libdrmaa.so is linked at c...
Hi, I have a program, that is been implemented in C++, now I want to add MPI support. The point is exist a MPI bind for C++, with namespace MPI and everything. In my case I have a specific object that is suitable to be the parallelized process into the cluster. Question, does anyone already did something like this ? Can give some advic...
the pointer data if pointing to some image generated by an iphone application. Does anybody now if using CGBitmapContextCreate make a copy of this data or does it use the image "in place"? Ideally, I'd like to reuse the information in data* and not create any additional copy of this image. void* data = <my data>; CGColorSpaceRef color...
I have tried to make the fullscreen feature of a SDI application with splitter windows by following the forum link. However, my status bar, system menu as well as the title bar of the application have disappeared. Do you have any suggestions on any easy ways of getting these back (or if I have to use different method of making the applic...