c++

What is the current modern term for "Multi-byte Character Set"

I used to be confusing quite a while : http://stackoverflow.com/questions/2384160/confusion-on-unicode-and-multibyte-articles After reading up the comments by all contributors, plus : Looking at an old article (Year 2001) : http://www.hastingsresearch.com/net/04-unicode-limitations.shtml, which talk about unicode : being a 16-bit ...

Micro Second resolution timestamps on windows.

How to get micro second resolution timestamps on windows? I am loking for something better than QueryPerformanceCounter, QueryPerformanceFrequency (these can only give you an elapsed time since boot, and are not necessarily accurate if they are called on different threads - ie QueryPerformanceCounter may return different results on diffe...

Problem linking to a DLL from C++ console application

I have a console application in C++. I need to access a functionality from a C++ DLL. How do I link the DLL from my console application? Please help me in this regard. Thanks, Rakesh. ...

Application launch from c command in window OS

I want to make an console application of c which can run other applications (exe files). Kindly guide me how can I make it possible so that from my c code i can run other executable files in window OS. ...

Stl Set find an item c++

I have a set where i want to find items in it. Right now i have global objects that i am using to store my finds - (ItemSetMap allMusicByBand) I would like to get away from this and just search the sets directly. All the cd info are stored in the private section - (ItemSet allCDS;) here is the library.cpp - the commented code is whe...

C++ Escaping an apostrophe in a string

Could you please tell me how can one escape an apostrophe. I need it to process non apostrophe characters through file operations so when I encounter an apostrophe(') I can't just give ch!='''. It doesn't work. Could you please tell me the right format. Thank you..:) ...

Why some libraries must implement basic data structure?

Some open source libraries have tendency to re implement basic structures like string, list, stack, queue... Why don't they use stl library? Is stl not good enough? ...

How to make script/program to make it so an application is always running?

I have a simple .exe that needs to be running continuously. Unfortunately, sometimes it crashes unexpectedly, and there's nothing that can be done for this. I'm thinking of like a C# program that scans the running application tree on a timer and if the process stops running it re-launches it... ? Not sure how to do that though.... An...

Get path to My Documents

From Visual C++, how do I get the path to the current user's My Documents folder? Edit: I have this: TCHAR my_documents[MAX_PATH]; HRESULT result = SHGetFolderPath(NULL, CSIDL_MYDOCUMENTS, NULL, SHGFP_TYPE_CURRENT, my_documents); However, result is coming back with a value of E_INVALIDARG. Any thoughts as to why this might be? ...

IPhone compilation of ported code problems: calling a static templated function that's inside a templated class == fail

template<typename T> struct AClass { public: template<typename T0> static void AFunc() {} }; template<typename T> void ATestFunc() { AClass<T>::AFunc<int>(); } this works on other platforms, but not on the iPhone I get an error " expected primary-expression before 'int' " on the line where I call the function. it ...

When to use recursive mutex?

I understand recursive mutex allows mutex to be locked more than once without getting to a deadlock and should be unlocked the same number of times. But in what specific situations do you need to use a recursive mutex? I'm looking for design/code-level situations. ...

How often do you declare your functions to be const?

Do you find it helpful? ...

How to convert string (22.123) format number into float variable format without using any API in c++

Hi,How to convert string (22.123) format number into float variable format without using any API in c++. This is just to understand more about the inside coding.. thnx ...

Small block allocator on Linux (or RedHat Linux) to avoid memory fragmentation

I know that there is an allocator for user applications than handles lots of small block allocation on HP-UX link text and on Windows XP Low-fragmentation Heap. On HP-UX it is possible to tune the allocator and on Windows XP it considers block of size less than 16 K as small. My problem is that I can't find any information about this ki...

First and last window don't show up.

Hi, I'm creating a WinApi application for my programming course. The program is supposed to show an LED clock using a separate window for each 'block'. I have figured most of it out, except for one thing: when creating the two-dimensional array of windows, the first and last window never show up. Here's the piece of code from the InitIns...

using lzo library in c++ application

I got lzo library to use in our application. The version was provided is 1.07. They have given me .lib along with some header file and some .c source files. I have setup test environment as per specs. I am able to see lzo routine functions in my application. Here is my test application #include "stdafx.h" #include "lzoconf.h" #includ...

ITERATOR LIST CORRUPTED in std::string constructor

The code below compiled in Debug configuration in VS2005 SP1 shows two messages with “ITERATOR LIST CORRUPTED” notice. Code Snippet #define _SECURE_SCL 0 #define _HAS_ITERATOR_DEBUGGING 0 #include <sstream> #include <string> int main() { std::stringstream stream; stream << "123" << std::endl; std::string str = stream.str(); s...

Is it possible to compact the VC++ runtime heap?

Can I have the same effect as with HeapCompact() for the Visual C++ runtime heap? How can I achieve that? ...

Creating csv files in ObjC

Hi All, Is it possible or any library available for creating .csv file in ObjC ? Thanks ...

How applications can be protected from errors in DLL module.

I have DLL and application that will call some function in this dll. For example... DLL function: char const* func1() { return reinterpret_cast<char const*>(0x11223344); } Application code: func1 = reinterpret_cast<Func1Callback>(::GetProcAddress(hDll, "func1")); blablabla char const* ptr = func1(); cout << ptr; That DLL i...