visual-c++

Accelerators not visible on dialog controls on launch.

When I launch a dialog the alt accelerators are not visible on the controls. Accelerators are visible only after I press alt. eg. if my button text is &Save on launch the button doesn't have underline effect under 'S'. it is visible only after alt is pressed. ...

How to change/append the text of edit control box in that dialog when i pressed the push button in dialog window

I am doing calculator program by using dialog based vc++/MFC application. In a dialog box, I added a edit text control and a push button. So I need to change/append the text of the edit control box in that dialog when I click the button on the dialog. To display the text am using Setsel() and ReplaceSel() methods in ButtonClicked method,...

How to enforce C89-style variable declarations in gcc ?

I work on a code base which is mostly C with a little C++, and is mostly built with gcc but occasionally it needs to be built with MSVC. Microsoft's C compiler is still pretty much C89 with a few minor extensions, and it still doesn't support mixed code and variable definitions à la C++/C99. So I need to find a way to prevent developers ...

C++ dynamic review tools

What's the best tool (commercial/open source) you've used for dynamic review/memory analysis of a C++ application? EDIT: removed 'static' as there is already a great question on this topic (thanks Iulian!) ...

Concatenation problems with debug print macro under gcc

Hi Folks. To completely disable a debug output in c-source, I usually define the following SIMPLE macro #1 #define dprintf(args) To enable a debug output, I define macro #2 alternatively #define dprintf(args) printk##args The usage in source looks like: dprintf(("Irqs:%lu\n",irqs)); A preprocessor should create following line if...

Is there a way in Visual Studio to specify what a template class (new class) is going to look like?

I'm a long time Eclipse user trying to learn to Visual Studio. I know that Eclipse had Code Templates that would allow you to build classes with certain comments and formatting already added for a class. For example: Auto placing the copyright for the code at the top of the file Who created the file Predefined Comments, etc... Does...

How to detect client connection to a named pipe server using overlapped I/O?

I was studying the MSDN examples of using named pipes: Named pipe server using overlapped I/O Named pipe client The server easily detects when the client is disconnected and creates a instance of a named pipe. But I cannot figure out how the server knows that a client is connected to a pipe before any data from client is sent. Can s...

Is there a stoll()/stroll() (string to long long) alternative in Visual Studio 2008

Is there an alternative, either built into windows or apache license compatible, to stoll() for Visual Studio 2008. Even installing the windows 7 platform SDK does not add stoll() to the string header. On unix the same function is be called strtoll(). ...

Adding two path names in VC++

String^ Source = System::IO::Directory::GetCurrentDirectory()+ "\\DeleteFolder.exe\"" ; String^ Destination = "C:\\Windows\\DeleteFolder.exe"; pin_ptr<const wchar_t> WSource = PtrToStringChars(Source); pin_ptr<const wchar_t> WDestination = PtrToStringChars(Destination); Is there any problem with the code above, i am unable to get the s...

To find all the functional dependency in Visual Studio C++ solution

Is there a way to find all the functions which are being called as well as which file this function resides in from an API interface function. It is more like a DFS on the visual studio solution. Are there any tools already available. My solution is in C++. ...

Is Visual C++ as powerful as gcc?

My definition of powerful is ability to customize. I'm familiar with gcc I wanted to try MSVC. So, I was searching for gcc equivalent options in msvc. I'm unable to find many of them. controlling kind of output Stop after the preprocessing stage; do not run the compiler proper. gcc: -E msvc: ??? Stop after the stage of compilation pr...

OMPTL in Visual Studio?

I was trying to use the OMPTL in Visual Studio. As far as I understand it, I only need to set the /openmp option, in order for the OMPTL to use the multi-threaded implementation of some stl functions. When I don't use /openmp everything is fine and OMPTL maps the functions to their normal stl counter parts, without multi-threading. With...

Getting value of a input attribute 'id' of a resource in a webpage

Dear Friends, Actually i want to retrieve value of a Input attribute 'id' from the source page [Right click on a Webpage->Select 'View Source'].For example - 'id' of PasswordBox . Right now I am able to retieve the values of attributes like- 'type','name','image' by using IID_IHTMLInputElement ->get_type/get_name..... But I am unable to ...

how to transfer C++ number format to C# number format?

have the flowing C++ code: CString info, info2; info.Format("%2d", Value[i]); info2.Format("%4.1f", Value[j]); want to have the equivalent code in C# how to do it? ...

Create a DataTable from list<T> and bind it to datagridview [c++]

Hi guys, I'm new with c++/cli programming. I have to do a program for the university I'm trying to create a datatable in c++/cli with visual c++ 2010 and then bind to dataGridView1. I have a list of Class P object with several fields. I've looked every where, but i've found only c# versions. Thank you in advance, and sorry for my eng...

fscanf / fscanf_s difference in behaviour

I'm puzzled by the following difference in behaviour: // suppose myfile.txt contains a single line with the single character 's' errno_t res; FILE* fp; char cmd[81]; res = fopen_s(&fp, "D:\\myfile.txt", "rb" ); fscanf(fp,"%80s",cmd); // cmd now contains 's/0' fclose(fp); res = fopen_s(&fp, "D:\\myfile.txt",...

How can I tell what version of Visual Studio was last used to work on a project?

I'm working with some older code, and I think the person who last built it was using Visual Studio 6. There's no .vcproj file, but the .dsp and .dsw files have the following headers: (.dsp) # Microsoft Developer Studio Project File - Name="[redacted]" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version ...

Where are the redistributable merge modules for Visual Studio C++ Express edition?

I have created MSI installers for programs compiled with Visual C++ 2008 Express edition and Wix (Windows Installer Xml) before. I just needed to bring in the merge modules for the C++ runtime redistributables from c:\Program Files\Common Files\Merge Modules*.msm. I expected the procedure would be similar with Visual C++ 2010 Express, ...

Is there a simple way to forward to a member function with a matching function signature?

Is there a simple way to forward to a member function with a matching function signature? typedef std::tr1::function<int(int,int,int,int)> TheFn; class C { int MemberFn(int,int,int,int) { return 0; } TheFn getFn() { //is there a simpler way to write the following line? return [this](int a,int b,int c,int d){ r...

delayed DLL loading possible when using QMake?

In my project, I have a set of DLLs I want to load delayed, i.e. on first use instead of on process start. That means I want to use /DELAYLOAD flag of the MSVC linker (see [1] for more explanation) for certain DLLs (not Qt itself). The reason is that some users experience crashes during DLL initilization (which we can't reproduce). A fo...