visual-c++

Assignment across data types in C++

Hi, I've compiled the following snippet of code in VC++ 2005/2008: unsigned long ul = ...; signed long l = ...; l = ul; and was expecting to see a compiler warning (Warning Level set to 4), but none was generated. Am I missing something obvious here? Thanks ...

To Disable the multimedia contents in IE

I need to disable the multimedia contents in IE Programatically. Is there any way my programming environment is VC++ ...

visual c++: GRAphviz output in visual c++

i want to use graphviz as a library in vc++. for that i link it with vc++. now i want to run some program writing graphviz code in vc++. i am using console application for that .it is suppose to be shown some graph having node in it . but that is showing only a black screen . then what to do to solve this problem? ...

Linking error: Missing symbol but symbol exported (in exp and lib)

Hi all! I have a dynamic library (plugin) that uses another dynamic library (dependency). I use the dependency in two ways: a. by instantiating object from classes defined in the dependency b. by inheriting from classes defined in the dependency When doing a., there are no linking errors. But when doing b., I have a linking error stati...

"Copy to output directory" in VC++

When doing C# with VS2008, there is a file property "Copy to output directory". This property seems to be missing in VC++. What is the simplest way to approximate the same effect? I've been told that it should be done with custom build rules. Is this really the simplest way, and if it is, how should the custom build rule be implemented?...

How can I find out what makes my application mix the statically and dynamically linked CRT

...

Why does memcpy fail copying to a local array member of a simple object?

Classic memcpy gotcha with C arrays as function arguments. As pointed out below, I have an error in my code but the erroneous code worked in a local context! I just encountered this weird behaviour in a porting job, where I'm emulating the Macintosh Picture opcode playback using objects. My DrawString object was drawing garbage on playb...

Tracking/monitoring File/Folder copy activities on windows

Hi, I would like to know if there are any ways to programmatically detect or monitor the file or folder being copied either by copy command(like on command prompt-- copy a b) or by using drag/drop(ctrl+c and ctr+v). It would be helpful if you could give some pointers( preferably some APIs in vc++) thanks and regards Dinakara K ...

Visual C++ compiling error

When compiling these two files I am getting numerous errors. Please help me out. stchart.cpp # include "peg.hpp" # include "stchart.hpp" # include "stchart_res.hpp" external PegResourceTable stchart_ResourceTable; PEGINT gChartData [] = (100, 100, 100, 100, 100, 100, 125, 150, 175, 200, 150, 100, 50, 100...

Winsock2: How to allow ONLY one client connection at a time by using listen's backlog in VC++

Hi Everyone, I want to allow only one connection at a time from my TCP server. Can you please tell, how to use listen without backlog length of zero. I m using the code(given below), but when i launch 2 client one by one, both gets connected. I m using VC++ with winsock2. listen(m_socket,-1); passing zero as backlog is also not work...

what is the most unobtrusive way of using precompiled headers in Visual C++?

Say I have a single project, with files A.cpp, B.cpp, C.ppp and matching header files (and that's it). The C++ files include system headers or headers from other modules. I want to compile them to a library with command line actions (e.g., using Make), using 'cl', with the precompiled headers feature. What are the steps I should do? Wh...

Is there a way to get better information for the context of an error when using msvc? (ex: C2248)

Hi, I'm wondering if there is a way to get better information about the location of an error in msvc (2005)? Exemple, when inheriting from boost::noncopyable in my class I get a C2248 error saying something like: error C2248: 'boost::noncopyable_::noncopyable::noncopyable' : cannot access private member declared in class 'boost::nonc...

Using a pure C++ compiler versus Visual C++

Hello all. I searched around for the answers to these questions, but I have had little luck. So, I thought I would post them here to get some clarification. If this is a duplicate, please let me know, and I will close this. Okay, with that said, I would like to begin learning C++. I come from a C# background and I have a great respe...

backup reg hives

Using http://support.microsoft.com/kb/240184 I'm able to open SAM, SOFTWARE, SYSTEM reg hives, but I do not know the next step to get them copied in a different backup folder? I get Access Denied when I try to use BackupRead API. Any help is much appreciated! ...

CMake Visual Studio linking executable with static library

I have a very simple (currently just a main.cpp) CMake C++ project that I'm trying to build on both Mac OS X and Windows. It depends on libgsasl, which I have compiled as a static library on both platforms. Mac OS X has no problems building, and Windows doesn't complain during the build either and produces an EXE. When I try to run the ...

Profiler for a C++ module in a C# app

I rewrote a number-crunching two pages of code from C# to unmanaged C++ in my project, which with full optimizations gave a 3x speedup. I want to keep optimizing that code, but now my profiler of choice, dotTrace, can't do it, because it only looks at managed code. How do I profile the P/Invoked C++ module when it's running in the C# ap...

What functions does _WinMainCRTStartup perform?

This is part of a series of at least two closely related, but distinct questions. I hope I'm doing the right thing by asking them separately. I'm trying to get my Visual C++ 2008 app to work without the C Runtime Library. It's a Win32 GUI app without MFC or other fancy stuff, just plain Windows API. So I set Project Properties -> Confi...

Building Visual C++ app that doesn't use CRT functions still references some

This is part of a series of at least two closely related, but distinct questions. I hope I'm doing the right thing by asking them separately. I'm trying to get my Visual C++ 2008 app to work without the C Runtime Library. It's a Win32 GUI app without MFC or other fancy stuff, just plain Windows API. So I set Project Properties -> Confi...

Redirect hwnd GDI calls to system memory bitmap?

I have a 3rd party ActiveX control I want to render within other presentation technologies (Direct3D and WPF). To do this, I need the ActiveX to render to a system memory bitmap instead of the screen. I know there is a way to do this, but not sure where to start. I'm not afraid of doing any native method hooking, but I'm not sure wher...

libcurl and amazon s3

Hi I am wondering if there is a way to set two different write callback functions in libcurl. The problem is that I'm currently using libcurl to communicate with amazon s3 for various operations, creating buckets, uploading, deleting and downloading objects. The problem is with the download function, I have set a callback function to wr...