visual-c++

implementation of unsigned long long division

Which file can I find the implementation of unsigned long long division (ulonglong divided by ulong) in? (MS VC++ 2010) ...

Static code memory leak detection for visual studio vc++

Hello, is there a way to detect simple memory leaks like this one with a static analysis tool? I cannot change the code to include the tipical includes used in runtime memory leak detection (struc1 is a simple structure with some fields). void noRelease(void) { struc1 *memoryLeak; memoryLeak = (struc1 *) malloc(sizeof struc1);...

size of fread elements and char *

Hello. I am trying to read random binary data (just to gain understanding and fluency with c++), and display the bit patterns in hex. The code below, as I understand it, should read 5 elements, each 1 byte, and store each element in the char array 'testing'. My code is: int main() { char paus[2]; int n=0; FILE *fid; int ele...

potential dangers of merging two files of unknown size?

Hello all. I have a binary file that I need to insert a header at the beginning of. I was thinking of opening a new file, writing the header data, and then copying the data from the binary file to this new file. Since the binary file is about 1 megabyte, are there any dangers to making this file using fwrite? One specific concern wou...

compiling assembly with Visual C++ Express 2010 64 Bit

How do I compile assembly code in a separate file? If my function is of the type "void __fastcall foo(unsigned long long, unsigned long long, unsigned long long, unsigned long long&, unsigned long long&)", how do I implement this in my .asm file? ...

c++ screen shot

umm i know this can be done but no idea how to...how to capture screen shot using c++,im gonna be working with win32. please no mfc code... thanks Rami ...

How are structs laid out in memory in C++?

Is the way C++ structs are laid out set by the standard, or at least common across compilers? I have a struct where one of its members needs to be aligned on 16 byte boundaries, and this would be easier if I can guarantee the ordering of the fields. Also, for non-virtual classes, is the address of the first element also likely to be th...

VC++ 6.0 MFC - Problem using Macro defined in <WINSER.H>

Hello there, I am facing a weird problem. I have got a file called in which I am using a macro called "WM_USER", the macro is defined in another header file called . Now the problem is that when I am using the macro in the compiler doesn't recognize it. Its not the case that I haven't included , because earlier I wasn't having any prob...

Dynamically call SOAP service from own scripting language

My application has its own scripting language of which I cannot get rid of (lots of customer-specific scripts written). Now my customers are asking if it would be possible to call a SOAP service from within that scripting language. Of course, the SOAP service that needs to be called will be different for every customer. This leaves me...

c++ use custom cursor gdi

ok im trying to create cursor using gdi. i can't even find tutorial how to use customize cursor, i can find so many tutorials for c#. all i know that i use these two functions to set cursor,setcursor and loadcursor that is it thanks Rami ...

Visual C++ includes directories

I want to read some library files and I went to Tools>Options>Projects and Solutions>VC++ directories and I found the following : $VSInstalldir/... $VSInstalldir/... $FrameworkSDKdir/ $WindowsSDKdir/... $PATH $SystemRoot/Syswow64/.... And I could locate only files inside $VSInstalldir . Where are $FrameworkSDKdir, $WindowsSDKdir, $PAT...

Using MySQL in VC++

Hello everyone, I am trying to connect to MySQL using C++. The IDE that I am using is Visual C++ 2010. I followed the steps on the MySQL dev page (http://dev.mysql.com/tech-resources/articles/mysql-connector-cpp.html). I followed the steps exactly as given although i used a different OS(Windows). I get many linker errors in the process,...

How to Make a Nice Block of Commenting in Visual Studio

I just switched back to c++ after leaving it for awhile and I can't seem to remember how to make nice function/class comment boxes in VS. What I'm looking for is something like this: /** * Convenience struct: coord * ------------------------- * Simple C++ struct (which is like a class, except there are * no methods and everything...

blending two images by Opencv

Hi, I want to align two images of different sizes using Opencv, Indeed the function cvAddWeighted enables us to combine or blend two images of identical sizes which is not my case ! so I need a help if somebody knows how to implement this function with considering the different sizes for images thanks y.m ...

High accuracy cpu timers

An expert in highly optimized code once told me that an important part of his strategy was the availability of extremely high performance timers on the CPU. Does anyone know what those are and how one can access them to test various code optimizations? While I am interested regardless, I also wanted to ask whether it is possible to acc...

enabling XML comments in C++ in Visual Studio 2010

How can one enable/achieve XML comments for C++ methods ala C# and VB in Visual Studio 2010? It appears this functionality isn't enabled/available by default. Targeting initially managed C++ projects. ...

why does byte change when bit shifting?

Hi everyone. I'm playing with bit shifting. I'm trying to take a 32bit int, save each byte in an array of char, then reconstitute the int. It works the way I think it should, except the second byte from the right seems to have the lowest bit switched. My code is: int main() { char paus[2]; char b[4] = "abc"; int c = 6104; in...

How can I build VS 2010's C Runtime Library?

I need to modify the C runtime which ships with VS2010 because the 2010 CRT relies on functions released in Windows XP SP2, and I need to be able to deploy to Windows 2000. Specifically, I need to remove any and all calls to EncodePointer and DecodePointer. The source for the C runtime is included in C:\Program Files (x86)\Microsoft Vi...

How to advertise a Bonjour Service in Visual C++

Hey everyone, I'm trying to figure out if this is even possible, but what's the simplest way of advertising a Bonjour service through Visual C++? I've got the Bonjour SDK installed but frankly, SDK seems a kind word for what it really is. I've had a good old google around for sample codes, snippets, tutorials, but got nowhere - can anyon...

Filter feature using CListCtrl

Hi, Is there any decent way to do filtering of Listview, without deleting and inserting items back? I am using VC++ 6.0. For example, hiding and then showing it back? Thanks. ...