visual-c++

Usefulness of signaling NaN?

I've recently read up quite a bit on IEEE 754 and the x87 architecture. I was thinking of using NaN as a "missing value" in some numeric calculation code I'm working on, and I was hoping that using signaling NaN would allow me to catch a floating point exception in the cases where I don't want to proceed with "missing values." Converse...

What's the difference between D3DERR_OUTOFVIDEOMEMORY and E_OUTOFMEMORY

Hi, guys, I am developing a tool drawing primitves with DX9 in my XP-32. When create vertex buffer and index buffer, there could be some error of creation failed. Return code could be D3DERR_OUTOFVIDEOMEMORY or E_OUTOFMEMORY. I am not sure what the difference of them. I use VideoMemory tool in DX sample to check the memory, and it r...

[C++] Getting undefined class type error but I did create the class and defined it

Hi. Im working on an assignment for one of my classes. Simply I have a GumballMachine class and a bunch of State classes that change the state of the GumballMachine. Here is the offending code: class GumballMachine; class State { public: virtual void insertQuarter() const = 0; virtual void ejectQuarter() const = 0; virtual void tur...

How to draw vertical text in Windows GUI?

I need to draw a column of vertical text (in Japanese language - it is drawn top-to-bottom instead of left-to-right) in my native C++ Win32 GUI application. I've looked through MSDN and only found how to draw right-to-left text. How do I output top-to-bottom text except drawing each character separately? ...

Using MS Visual C++ to make a Windows Forms Application in C?

I'm learning C, and I want to use the Windows Forms tools in Visual C++, so I can do Rapid Application Development with C. I've tried changing the compiler mode to C, but then, I can't use the RAD tools in VC++, it seems. ...

How to make your MFC application bypass UAC in windows7 and Vista

I have an MFC application developed in VS Studio 2008 which reads and writes to a JSON file in its installation folder. It works perfectly in vista(administrator) BUT ONLY when UAC is turned off. When UAC is ON, the application isn't able to write to its JSON file. I figured I had to create a manifest file but I haven't really tried crea...

Visual Studio as Code Browser : How to preserve the directory structure?

Hello, I've downloaded source of an opensource C++ project. It is a Linux project. As Visual Studio is my favorite IDE I want to use it to browse & study the code. I created an empty C++ project and now want to add the source code to Solution explorer. How can I add the directory structure to "Solution Explorer". Dropping the root fol...

How to improve Visual C++ compilation times?

I am compiling 2 C++ projects in a buildbot, on each commit. Both are around 1000 files, one is 100 kloc, the other 170 kloc. Compilation times are very different from gcc (4.4) to Visual C++ (2008). Visual C++ compilations for one project take in the 20 minutes. They cannot take advantage of the multiple cores because a project depend ...

Visual C++: What is a dynamically linked .lib file?

I noticed the following about a library I use: Library is compiled to .lib file. My code needs to be compiled as Multi-threaded (Debug) DLL to link to this library. I open the .sln (solution) file of the library (it is open source) and see the following in its Project properties: Runtime Library option is set to Multi-threaded (Deb...

How to run .exe binary of a remote server on the remote server from a c++ application in windows platform

What are the ways to run .exe binary of a remote server on the remote server from a c++ application in windows platform?? ...

Can't find my syntax error, VC++ says there's one

I'm running into a bit of a problem here, I'm messing around with machine code and function pointers, and there's a bit of my code that VC++ simply refuses to compile. This compiles and runs exactly as expected: #include <stdlib.h> #include <stdio.h> int main() { char tarr[] = {0xb8, 222, 0, 0, 0, 0xc3}; int (*testfn)() = tar...

Visual C++ setting to insert a newline at end of file

While compiling C++ code that is cross platform, g++ throws a compiler error if a .cpp or .h file does not have a newline at its end. Is there a visual studio setting that would do this automatically? ...

CMake not using appropriate output command line argument for compiler.

Hello, I'm working with CMake, and my program compiles fine with g++. However, I also wish to compiled it with bcc32 and cl. I am running into an issue -- I'm telling cmake to use those compilers by doing a command line somewhat like "cmake -DCMAKE_CXX_COMPILER=cl" or whatnot, and it picks up the compiler correctly (ie, in that case, t...

WPF contros in VC++

Hi, Im using WPF controls as C# dll in VC++.Im having Tabcontrol with three tab items.Two tabitems contains buttons only and third tab contains Listbox.Im sending data to Listbox from my VC++.So i did coding like this ref class Globals1 { public: static System::Windows::Interop::HwndSource^ gHwndSource; static Tabcontrol::Tool...

How can I make the printer work in C in MS VC++ Express edition?

I am using VC++ 2008 express edition for C. When I try to run this: /* Demonstrates printer output. */ #include <stdio.h> main() { float f = 2.0134; fprintf(stdprn, "This message is printed.\n\n"); fprintf(stdprn, "And now some numbers:\n\n"); fprintf(stdprn, "The square of %f is %f.", f, f*f); /* Send a form feed */ fprintf...

How do I see the output of my code using Visual C++ 2008?

I wrote some very simple code since I'm just starting C++ and I want to get warmed up with the syntax and compiler before our binary tree assignment. #include <iostream> using namespace std; int main(){ cout << "Hello"; return 0; } The only output I'm receiving is: 1> Build started: Project: First-BinaryTree, Configuration: Debug...

how to reassemble tcp segment?

im now developing a project using winpcap..as i have known packets being sniffed are usually fragmented packets. how to reassemble this TCP segements?..any ideas, suggestion or tutorials available?.. this i assume to be the only way i can view the HTTP header... thanks!.. ...

.Net-like Intelisense for VC++?

Up until now in VC++, when I want to see everything I do :: . This shows all of my objects. Is there a way to make it like c# so it checks as you type without needing :: . Thanks ...

How do I address warnings when compiling SQLite with VC++?

Whenever I compile SQLite with Visual C++ 9 I get hundreds of warnings, such as potentially uninitialized variables conversion from wider integer types to narrower integer types signed/unsigned integers mismatches. I'm not alone - there's an SQLite FAQ question specifically about that. The answer to that question says that those wa...

Read/extract data from sql server backup file without restoring

Hi All, Is there any way to read/extract data from sql server backup file without restoring it? Thanks. ...