visual-c++

Win32: Bring a window to top

Hi, I have a Windows program which has two 2 windows in it: hwnd (main interface) hwnd2 (toplevel window, no parent, created by hwnd) When I double click on hwnd, I need hwnd2 to pop up and show some data, so I use this function to bring hwnd2 to top: BringWindowToTop(hwnd2); hwnd2 is brought to top, but there is one thing odd. Wh...

How do I convert a CString to a double in C++?

How do I convert a CString to a double in C++? Unicode support would be nice also. Thanks! ...

Capturing still images using AMCAP ?

Hello folks, I am developer from *nix world so any pointers will be helpful. I am using the AMCAP SDK example and have to capture live preview and still images. I understood the code for getting live preview. Now how can I capture an image at runtime from the gcap data structure ? Mind you the application has to do some real time image...

Capturing video from a webcam in VC++

Other than DirectShow, what are the other options? I want to use this in an instant messaging application currently under development. Thanks ...

Return a multidimensional array from pointer function in Visual C++

Hello, I wrote following code to return multidimensional array from pointer function.Input parameter of this function is one dimensional array, output is pointer that point multidimensional array. double **function( array< double>^ data,int width,int height ) {int i; //define returning variable that point multidimensional arr...

How to speed up c++ linking time

Hi, Is there any way, to optimalize linking time in MS Visual studio C++ (2005) ? We're using Xoreax Incredibuild for compilation speed up, but nothing for link. Currently every linking takes about 30seconds. When I turn on incremental linking, takes abou 35-40 seconds. ( No matter if i compile project with or without incredibuild ) ...

Managed CPP reference paths?

I'm trying to compile a managed cpp application from the command line. Suppose my cpp application references the .NET 2.5 framework's "System.dll". I can compile like this, without problems: cl /clr /FU"System.dll" main.cpp The application then works as expected. If, however, I try to reference the .NET 3.5 framework's "System.core...

Should I cast a CString passed to Format/printf (and varargs in general)?

I recently took in a small MCF C++ application, which is obviously in a working state. To get started I'm running PC-Lint over the code, and lint is complaining that CStringT's are being passed to Format. Opinion on the internet seems to be divided. Some say that CSting is designed to handle this use case without error, but others (an...

Why does Microsoft's _wspawnv return EINVAL?

I'm calling Microsoft's _wspawnv function, and it keeps returning -1 with errno set to 22; errno.h defines this as EINVAL. According to Microsoft's documentation for _wspawnv, this code should only be returned if the mode parameter is invalid. I've tried calling it with _P_WAIT and _P_NOWAIT in the first parameter, and both return the ...

Can I optimize some code snippet as release in debug mode?

I use MSVC++ 2005 x64. Some code work incorrectly in release optimizing mode. So, I want to make test for that code. Problem is, my test code run only in debug mode. (I dont' want mix test code in product code.) So, Can I declare some part of code to compile as release optimizing mode in debug build? For example, like, __asm ... or some...

Strange behavior with the hotkeys in VC++

I have a dialog written in VC++ as shown below: Label1 Control1 Button1 If Control1 is disabled, using Label1's hotkey results in Button1's Click event. How could I avoid that? As Control1 is disabled shouldn't the hotkey for Label1 too? ...

R6016 - not enough space for thread data

How do I go about debugging "R6016 - not enough space for thread data" in a C++ application. I've read http://support.microsoft.com/kb/126709 but would like some other input. ...

What is the difference between read and readline in C#?

What is the difference between read() and readline() in C#? Maybe we don't use it but in my academy the only difference is that one has "line" and the other don't have... In c++, there is "cin" and it has "endl" to add line. Can somebody tell me the difference? ...

Stack issues when calling a DLL compiled with Visual C++ in GCC

I'm trying to call some functions in a DLL compiled with (I believe) Visual C++ from my program, which is compiled using GCC. To call the functions in the DLL, I do a LoadLibrary() on the DLL, and then a GetProcAddress() to get the address of a particular function, which I then call. This function returns a list of pointers to the funct...

Good URLs for tracking implementation progress of C++0x in MSVC and GCC

Does anyone know good URLs/Sites/mailing lists to track the current implementation progress of C++0x features in MSVC and GCC? BTW: Yes I know there is boost but because I'm also very interested in the new language features I only want to know the progress in MSVC and GCC (as those are the two compilers we use for our projects). ...

How to disable warnings 4510 and 4610 from std::list class?

I have a bunch of warnings C4510 and C4610 when I use std::list with my class. It is a warning stating that default constructor is not available, and I want to disable them. When I put: #pragma warning(disable: 4510) inside .cpp file that is instantiating this list nothing happens. I tried placing this pragmas around function where ...

Visual C++ Runtime Library Linker Woes

Observe this close Scenario even though it appears to be the same as my previous questions. Still I am not getting an answer. So please don't report as a duplicate. I have a project which has 10 dependencies. First I compiled using the /MTD option in the C/C++ codegeneration section in the main project and all its dependencies are getti...

typedef void(*ptr)(argumentlist) problem

How do I pass or get parameter values to/from this function pointer: typedef void(* CreateCursorBitmapProc )(uchar *bitmapBuffer, uint32 *width, uint32 *height, bool16 *hasAlpha) bitmapBuffer, width, height, hasalpha are the out parameters. ...

Why is /clr incompatible with /mt and /mtd in Visual Studio?

Hi can anybody please explain for me how and why /clr is incompatible with /mtd ? What is the alternative for this? What happens internally if I use /md or /mdd ? As far as I know we don't combinedly use /clr and /mtd. Can someone explain if there is a way to do this? And please explain me how and why /clr is incompatible with /mt and ...

How to check a popup menu item?

How to check a popup menu item? ...