visual-c++

How to gather information on windows shell programming?

Hi, I am very interested in learning windows shell programming. So...I searched for books on the amazon.com. I see that books on the amazon.com are out of date. Most of books are published before 2005. I googled about it and found many tips and tricks, but not step by step guide. Where do I get started? P.S: I am talking about windows...

Work with files exception

I want to create program which will tell me if a file is used or not by another processes (for example i open music or video file in multimedia player, and then i launch my program with this file name programm return "this file is being used", and when no processes uses this file program would say "this file not being used"). What clas...

Creating UI problem

I am creating a program which has an installer-like interface. Is it better to implement it with ShowDialog method of Form class or doing an MDI interface? Below are the ways I tried to do it using the ShowDialog method, and the problems I have with them: 1) First form ShowInTaskbar property is set to true, other form is set to false. ...

Can't add message handlers for my MFC dialog

I have two dialogs in my application. (i'm working in Visual C++ 2008) For one of them I've added various message handlers. However, for the other dialog I can't add any handlers. If I click the "Messages" button in the Properties window, it only shows a blank page instead of the usual messages list. What could be the problem? Thanks f...

What information about me and my system do compilers add to executeables?

I'm currently using Microsoft Visual Studio 2010. If we say that we give 10 different people a copy of MSVC 10 and a short C++ Hello, World listing. They all create a new project using exactly the same settings, add a new cpp file with the Hello, World program and compile it. Do they all get the exactly same binary? If not, what are t...

C++ Pointer trouble with File I/O

Hi, I am writing a function that takes in a output target file and a couple of other arguments. I am currently having trouble with converting types between the argument passed in and using it in the fopen_s() method. FILE* outputf; void myfunc(FILE* fin, CString finpath,...) { outputf = fopen_s(&fin, finpath, "w"); ....... } I'...

[VC++]How can I run my program on another PC ?

I have an MFC application that runs on my computer, but when I try to run it on another PC I receive an error message that the application failed to initialize and I should re-install it. What should I do? ...

Is there a shortcut to move between header and source file in VC++?

This is a feature I have grown accustomed to in Eclipse (alt-tab). Is there an equivalent in Visual C++? Thanks! ...

Is there a way to capture a bitmap from a WPF window using native C++?

Imagine a document window in a MDI application which contains a child WPF window, say a sidebar for example. How can one get a bitmap containing both the WPF pixels AND the GDI (non-wpf) pixels? I've discovered that when making my thumbnail preview for the Win7 taskbar app icon hover, I get black in the parts of the preview where the WP...

How to tell if two exe's are the same code-wise?

Is there a way to detect whether two EXE's (compiled from VS.Net 2008 for C++/MFC) do not have any code-level changes between them i.e. for purposes of knowing that there have been no statement changes. This is for compliance purposes when my vendor ships me an exe, ostensibly with no changes made to the code since the last time we ...

How to properly rewrite ASSERT code to pass /analyze in msvc?

Visual Studio added code analysis (/analyze) for C/C++ in order to help identify bad code. This is quite a nice feature but when you deal with and old project you may be overwhelmed by the number of warnings. Most of the problems are generating because the old code is doing some ASSERT at the beginning of the method or function. I thin...

Any Win32 APIs to get the screenshots?

Hi all, I am writing an app, which needs to take the screen shots automatically (just like pressing PrintScreen button). So please suggest me how to get this done. A raw 24 bit BMP image would suffice. PLEASE NOTE: My app is in C, so any win32 APIs that can be called from my code is what I am looking for. (Sometimes back I had got an e...

Starting a VC++ .exe from MSAccess

For a complex calculating problem we use an VC++ module (.exe). For the users we have build an ms Access application as user interface. After input the calculating module should start and do its job. The result is again imported in Ms Access. However we work wit dBase files (.dbf) as data files. The calculating unit works fine by its ow...

Visual studio: automatically update C++ cpp/header file when the other is changed?

For example, if I change the signature in a function in either the header or the cpp, I'd like it to automatically change in the other one. If I add a new function in either, it should appear in both. If I delete a function, it could probably comment out the other one. Manually having to duplicate one's changes seems silly. Some people ...

Problem with cvCvtColor: unhandled exception at "0x1002e4e4" in "opencvsample.exe": 0xC0000005: Access read violation "0xffffffff".

Hello! I have a problem with OpenCV function cvCvtColor. Here is the code I used: #include "cv.h" #include "highgui.h" int main(void) { int g_thresh = 100; CvCapture* capture = cvCreateCameraCapture(0); IplImage* g_image = cvQueryFrame(capture); IplImage* g_image_copy = cvCloneImage(g_image); cvNamedWindow( "Contours", 1 ); ...

How to link C# and C++ assemblies into a single executable?

I have VS2008 solution containg a project that generates a C# executable that references a project that generates a dll containing both C++/CLI and unmanaged C++. I would like to merge these into a single executable, as the C++ dll contains security code that I want to embed in the main executable. I cannot use ILMerge, as the dll cont...

Indenting c++ in visual studio.

I am using Visual Studio 2005 team edition. I come from a unix background using gvim. It would appear that formatting/indenting code seems to be a lot harder. Can anyone suggest a good option. VI with its autoindent/smartindent settings spoilt me. thanks ...

Unhandled Exception with c++ app on Visual Studio 2008 release build - occurs when returning from function

Hi, I have a (rather large) application that I have written in C++ and until recently it has been running fine outside of visual studio from the release build. However, now, whenever I run it it says "Unhandled exception at 0x77cf205b in myprog.exe: 0xC0000005: Access violation writing location 0x45000200.", and leads me to "crtexe.c" at...

How to upgrade the project build in visual studio 2005 to visual studio 2008?

I have one OPC ( OLE for Process control ) server project which is developed into visual studio 2005. I want to run it in visual studio 2008. The coding for the OPC server project is done in VC++. I want to connect my OPC client to this OPC server. When I was opened the OPC server project which was build into visual studio 2005 into visu...

C compiler producing lightweight executeables

I'm currently using MSVC for C++ but as I'm switching to C to write a very performance-intensive program (interpreter) I have to search for a fitting C compiler. I've looked at some binaries produced by Turbo-C and even if its old they seem pretty straigthforward and optimized. Now I don't know what the best compiler for building an in...