c++

Client server application

Hi, Can any one please provide me the sample client and server application in win32, i just want to make my machine as server and client.. if i send a data from client i should be able to see at server, vice versa.. Thanks GrabIt ...

How to write `is_complete` template?

After answering this question I was trying to find is_complete template in Boost library and I realized that there is no such template in Boost.TypeTraits. Why there is no such template in Boost library? How it should look like? //! Check whether type complete template<typename T> struct is_complete { static const bool value = ( si...

Processing huge text files

Problem: I've a huge raw text file (assume of 3gig), I need to go through each word in the file and find out that a word appears how many times in the file. My Proposed Solution: Split the huge file into multiple files and each splitted file will have words in a sorted manner. For example, all the words starting with "a" will be stored ...

Will IntelliTrace(tm) (historical debugging) be available for unmanaged c++ in future versions of Visual Studio?

I love the idea of historical debugging in VS 2010. However, I am really disappointed that unmanaged C++ is left out. IntelliTrace supports debugging Visual Basic and C# applications that use .NET version 2.0, 3.0, 3.5, or 4. You can debug most applications, including applications that were created by using ASP.NET, Win...

Where I can find the appWizard that can generate C++ application

Hi, I have an project to modify. This project was create with AppWizard many years ago. This generated weird code when I open it with visual studio 8. I would like to modify the interface. Can I find a free AppWizard. Thanks, ...

C++, WCHAR[] to std::cout and comparision

Hi, I need to put WCHAR[] to std::cout ... It is a part of PWLAN_CONNECTION_NOTIFICATION_DATA passed from Native Wifi API callback. I tried simply std::cout << var; but it prints out the numeric address of first char. the comparision (var == L"some text") doesn't work either. The debugger returns the expected value, however the compari...

How can I pass an arithmetic operator to a template?

I want to somehow merge templates like these into one: template <class Result, class T1, class T2> class StupidAdd { public: T1 _a; T2 _b; StupidAdd(T1 a, T2 b):_a(a),_b(b) {} Result operator()() { return _a+_b; } }; template <class Result, class T1, class T2> class StupidSub { public: T1 _a; T2 _b; StupidSub(T1 a, ...

How do I collapse selected chunks of code in Visual Studio 2008?

In Visual Studio 2008: Is there a way for me to customly collapse bits of code similar to like how I can automatically collapse chunks of comments? ...

Should an implementor of IShellBrowser::QueryActiveShellView Method call AddRef for the caller?

I am attempting to implement an IShellBrowser. One method of such is: HRESULT STDMETHODCALLTYPE IShellBrowser::QueryActiveShellView(/* [out] */ __RPC__deref_out_opt IShellView **ppshv) This gets the active shell view pointer for the caller (in my case, there is only one shell view at any given time). But it is very unclear whether I...

OpenGL - Textures loading improperly

UPDATE: I've posted the Renderer code below, since this code here doesn't seem to be the problem. I'm having a problem with some code of mine where when I try to upload multiple textures to openGL, one at a time, it fails somewhat spectacularly, with the renderer only ending up using a single texture. I've done a bit of debugging to ...

How to write a class capable of foreach

It's been a while since Visual Studio added support for a foreach extension that works like vector<int> v(3) for each (int i in v) { printf("%d\n",i); } I want to know how to make any class able to use foreach. Do I need to implement some interface? ...

Does GCC inline C++ functions without the 'inline' keyword?

Does GCC, when compiling C++ code, ever try to optimize for speed by choosing to inline functions that are not marked with the inline keyword? ...

C++ virtual function table memory cost

Hi all, Consider: class A { public: virtual void update() = 0; } class B : public A { public: void update() { /* stuff goes in here... */ } private: double a, b, c; } class C { /* Same kind of thing as B, but with different update function/data members */ I'm now doing: A * array = new A[1000];...

C++ multiplayer UDP socket API

Hi all! Can anyone recommend an easy to use, fast and reliable C++ API for sending and receiving data over a UDP socket? Maybe something that is specifcally intended for multiplayer games? ...

How do I allocate variably-sized structures contiguously in memory?

I'm using C++, and I have the following structures: struct ArrayOfThese { int a; int b; }; struct DataPoint { int a; int b; int c; }; In memory, I want to have 1 or more ArrayOfThese elements at the end of each DataPoint. There are not always the same number of ArrayOfThese elements per DataPoint. Because I have a ridicul...

C# encryption, C++ decryption. Final few bytes failing on decryption.

My apologies for the length of the code I'm about to list. I need to encrypt the contents of an xml file on the C# end of my code, and decrypt it in C++. I'm using RC2, with RC2CryptoServiceProvider and CryptoStream on the C# side, with Wincrypt on the C++ side. Encryption seems to be working fine, it looks like such: public static ...

Can I mix JNI headers implementation with normal C++ classes?

If I try to implement my class on this file I get an error UnsatisfiedLinkError, however if I remove the implementation of the Broker.h Class it goes ok. Why? Broker.h #include "XletTable.h" #ifndef BROKER_H_ #define BROKER_H_ class Broker { private: static Broker* brokerSingleton; static XletTable *table; // Private con...

Programmatically move registry keys...

Hello, Does anyone know how I can programmaically move a registry from HKEY_LOCAL_MCAHINE to HKEY_CURRENT_USER? I wrote a recursive function that uses RegEnumKeyEx and RegEnumValue, but it appears that RegEnumValue returns all of the values under the top level key. For example, if the key is HKEY_LOCAL_MACHINE\SOFTWARE\MyApp\KeyName1 ...

Virtual Webcam Driver

Hi I want to develop a virtual webcam driver which from User mode I'll pass image to it and it will display as webcam output. I don't want to use DirectX filter and CSourceStream etc. Because they don't work on some programs which doesn't use DirectX for capturing webcam image. I have to write a kernel mode device driver so. Any id...

Is the use of previously defined members as part of later members in an enum definition legal?

namespace ValueType { enum Enum { Boolean = 0, Float = 1, Double, SInt = 8, SLong, UInt = SInt + (1 <<4), ULong = SLong + (1 << 4) }; } ...