visual-c++

visual c++ create text file

How to create text file? CreateFile("1", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_FLAG_OVERLAPPED, NULL); throw 1>------ Build started: Project: test2, Configuration: D...

Creating a library?

I'm using MSVC, but I plan to make my library cross platform. Right now, I have h and cpp files of classes and functions. Is making a library in MSVC as simple as adding all my files to a Visual C++ Project marked as either Static or Dynamic Library? Or must I make my classes and functions extern and whatnot? Thanks ...

Programmatically add port forwarding entry into router using upnp?

Does someone have a simple example on how to add a port forwarding entry with upnp into the router using c++? ...

Windows VC++ 2010 code before my main() function executes.

I've been compiling simple Hello World applications in Visual Studio 2010 with the C++ compiler (Win32 is the target) to see what the product looks like under the microscope when I run it with the Immunity debugger. What I've noticed, however, is that there is some code (quite a bit of code, actually) that gets run before my main functi...

How To read/write C array stored in text file created through bin2C utility

Hi, I am creating a application, input to which is a C file having an array ( which is created with bin2C.exe ) , the code segment of the C file is:- unsigned int MyArray[] = { 0x00000001,0x00000002,0x00000005 ...}; now I need to read this array as a text file and story its value in an int array. Then I need to modify that array and ...

why does directx 9 lack of resources? c++

directx 9 is most library i have found that doesn't have any free tutorials or resources. why is that? ...

Is my design for UDP socket server correct?

I am designing a server which is used in UDP communication using MFC. I have the following classes CMyDlialog - Take care of User interface CController - Act as an Mediator between all the classes CProtocolManager - Take care of Encoding/Decoding msgs (This is a static class) CConnectionManager - Take care of UDP connection, Sending, R...

Windows service won't stop and restart

I wrote a windows service in C++ that needs to restart every night at midnight, so I call exit(1) on it so that it can be restarted by SCM. The problem is it seems every other night it starts up partially and hangs. In the event log, I get this: Application popup -Application Error: The instruction at "0x0043c145" referenced memory a...

Need to get List of C++ Kernel Types?

Hello, Respectfully!! I need complete list of kernel types such as "CRITICAL_SECTION", "_LARGE_INTEGER" or "_SECURITY_ATTRIBUTES". Basically I am extracting all the data members of class given class name as type from some debugging SDK (right now using DIA SDK or DbgHelp) . Now If a type(say class or struct) contains some kernel level...

Threading on windows platform (C++)

how to use threading on windows platform, do i need to include some lib or dll file, is there some command? ...

How do I validate template parameters in compile time when a templated class contains no usable member functions?

I have a following templated struct: template<int Degree> struct CPowerOfTen { enum { Value = 10 * CPowerOfTen<Degree - 1>::Value }; }; template<> struct CPowerOfTen<0> { enum { Value = 1 }; }; which is to be used like this: const int NumberOfDecimalDigits = 5; const int MaxRepresentableValue = CPowerOfTen<NumberOfDecimalDigits>...

Visual C++ Express - Dozens of vcpkgsrv.exe

I don't want to disable IntelliSense, but I don't see any other solution. I have Visual C++ v10.0.30319.1, Max Cached Translation Units = 2. But still, dozens of vcpkgsrv.exe processes are spanned, consuming lots of memory (and rendering the computer unusable). Windows 7 Pro. Any solution that you know of? Thanks. ...

How do I fix symbol name collision between static libs in Visual Studio/C++?

My platform is Windows / Visual Studio / C++ I have two static .lib files. They are from two different vendors. Unfortunately the lib symbols are colliding on a globally defined symbol that each file defines. They both choose the same name for something. eek! Is there a way to namespace or "hide" the symbols from the two libraries fr...

Communicating between C# and Visual C++ over IPC port (OR: Sharing a type between a Visual C++ DLL and a C# application)

I have a DLL written in Visual C++ and an application written in C#. The application that is written in C# already uses IPC between multiple instances of itself so that it only ever runs one instance (it attempts to start an IPC server, and if it can't assumes there's already one running, in which case it sends the command line argument...

How to get the executable file name throng Developer Studio object

I'm develop a Add-In for VC6. (Oh, I've asked many questions about it.:)) I should get the active process ID in debug. Now I took project's name as process name to get the process ID. But it will failed if the process name is not same as the project's name. So I want to get the executable file name, that is in Project Settings'->Debug->E...

Using CMPH in VC++

I would like to use minimal perfect hash from CMPH. Any idea how can I use it on a VC++ project? I created a new project using VC++ 2008 Express Edition here and add the header and source files but it output compilation errors. 1>------ Build started: Project: CMPH, Configuration: Release Win32 ------ 1>Compiling... 1>wingetopt.c 1>vs...

intellisense not properly working visual studio 2008 for Visual C++ and MFC environment

I am working in vc++ of Visual Studio 2008. In my project (VC++), I could access the INTELLISENSE only when i press CTRL+SPACE. it doesn't work automatically as like any other project ( i.e. C#, VB .Net). so what should i do to work with the intellisense efficiently? ...

Confused about use of 'HANDLE' in piece of Visual C++ code for Real-Time IIS 7.0 Event Logging

I'm relatively new to Visual C++. I'm trying to build a module to consume log events generated by the IIS 7.0 server in order to be able to analyze these logs in real-time. I found a Microsoft article which provides code that accomplishes the real-time capture: http://learn.iis.net/page.aspx/581/advanced-logging-for-iis-70---real-ti...

Renaming a Visual Studio .NET 2008 C++ project

I didn't think too hard when initially naming my Visual Studio C++ project and now want to rename it. I'd love to avoid doing a replace all on the name of the project (and renaming all files in the project directory), because this would be error prone and tedious. Is there a way to rename the project within Visual Studio? Thanks, Eri...

c++ directx muliti textures

How can I set set more than one texture on a cube like the front of the cube has different texture from the back of it.... I tired to use the stages but it didn't work. for example, if i wanna make a dice i would have top would be 1 side be 2.............. D3DXCreateTextureFromFile(d3ddev, //Direct3D Device ...