c++

InternetDial with INTERNET_AUTODIAL_FORCE_UNATTENDED still shows an error dialog?

I have a piece of software running on a remote device which calls InternetDial to establish a connection and report information. Most of the time this works fine, but occasionally, some sort of error will occurr (bad signal etc.) and despite calling the function with INTERNET_AUTODIAL_FORCE_UNATTENDED, windows still appears to pop up di...

Drawing on 8bpp grayscale bitmap (unmanaged C++)

Hi all, I've been attempting to draw on an 8bpp grayscale bitmap without success. Here are some of my attempts. Maybe someone can point out what I'm doing wrong. =================================================== Attempt 1: Create, select, and draw: In constructor: CBitmap bm; bm.CreateBitmap (200, 200, 1, 8, NULL); In OnDraw: ...

Platform-independent C++ Debugger IDEs that follow pointers like Visual Studio

Visual Studio debugger automatically recognizes the types of pointers and shows the value of the variable or object pointed to by the pointer. Example screenshot for Ruby debugger here: http://www.rubyinside.com/wp-content/uploads/2008/03/jruby-debugger.jpg This applies to debugger tooltips, watch windows, etc. I never have to see t...

Convert some code from C++ to C

Possible Duplicate: C code compiles as C++, but not as C Edit: I recompiled the source for the library as C, and that fixed it. I've got this code I need to use in my application. It's for writing to the serial port, and I can't figure out how to get it to run in C. I've got a version in C++, as well as a version that looks ...

Implementation of string literal concatenation in C and C++

AFAIK, this question applies equally to C and C++ Step 6 of the "translation phases" specified in the C standard (5.1.1.2 in the draft C99 standard) states that adjacent string literals have to be concatenated into a single literal. I.e. printf("helloworld.c" ": %d: Hello " "world\n", 10); Is equivalent (syntactically) to: ...

Building in 64 bit Windows on VS2008 gives C2632 error

So I am trying to build an 32 bit application in 64. I am linking to all 64 bit libraries, and I have recompiled everything we used for 64 bit. I am getting weird errors now. I have seen some similar errors over the net but nothing useful in those topics. Any idea what could be wrong that causes this behavior? warning C4091: 'typedef ...

How to switch on the "auto-build" option in VS2008

What option (where it is located in VS2008 menu) is need to be switched on in order VS2008 compile and build solution before launch (native C++ project)? Thanks. ...

Pointer Naming Preferences

Possible Duplicate: Whats your preferred pointer declaration style, and why? Just curious: What's you standard method when declaring pointers? Why? SomeClass *instance; OR SomeClass* instance; I prefer the second method as it keeps the entire type together (it's a 'SomeClass pointer'). But I know many prefer the first an...

Porting C++ code from Windows to Linux - Header files case sensitivity issue

I am porting a C++ large project form Windows to Linux. My C++ files include header files that do not match those on the project directory due to the case sensitivity of file names in Linux file systems. Any help? I would prefer finding a flag for gcc (or ext4 file system) to manual editing or sed'ing my files. Thanks for all! ...

How do I specify 64-bit machine architecture when building boost libraries with bjam on solaris?

That's the question. Thanks in advance. ...

C code compiles as C++, but not as C

Possible Duplicate: Convert some code from C++ to C I've got some code that appears to be straight C. When I tell the compiler (I'm using Visual Studio 2008 Express) to compile it as c++, it compiles and links fine. When I try to compile it as C, though, it throws this error: 1>InpoutTest.obj : error LNK2019: unresolved exter...

C++ Wait For Mutex

I have a C# app that creates a mutex: var mutex = new Mutex(true, // desire initial ownership "MyMutexName", out owned); How would an unmanaged C++ app detect when this mutex is released? (I'm not a C++ dev) Thanks in advance, Jim ...

How can I log which thread called which function from which class and at what time throughout my whole project?

Hello, I am working on a fairly large project that runs on embedded systems. I would like to add the capability of logging which thread called which function from which class and at what time. E.g., here's what a typical line of the log file would look like: Time - Thread Name - Function Name - Class Name I know that I can do this by ...

reuse function logic in a const expression

I think my question is, is there anyway to emulate the behaviour that we'll gain from C++0x's constexpr keyword with the current C++ standard (that is if I understand what constexpr is supposed to do correctly). To be more clear, there are times when it is useful to calculate a value at compile time but it is also useful to be able to c...

How to do static de-initialization if the destructor has side effects and the object is accessed from another static object's destructor?

There is a simple and well-known pattern to avoid the static initialization fiasco, described in section 10.13 of the C++ FAQ Lite. In this standard pattern, there is a trade-off made in that either the constructed object gets never destructed (which is not a problem if the destructor does not have important side effects) or the static ...

conversion from std::vector<char> to wchar_t*

i'm trying to read ID3 frames and their values with TagLib (1) and index them with CLucene (2). the former returns frame ID's as std::vector<char> (3) and the latter writes field names as tchar* [wchar_t* in Linux] (4). i need to make a link between the two. how can i convert from std::vector<char> to wchar_t* by means of the STL? thank ...

To implement properties or not?

I've found a few methods online on how to implement property-like functionality in c++. There seems to be some sound work-arounds for getting it to work well. My question is, with the prevalence of properties in managed langues, should I spend the effort and the possibilty of code-breakage (or whatever) to implement properties in my co...

Problem compiling VS8 C++ program with boost signals

Hi there, So I am wanting to use boost signals in my C++ program. I add: #include <boost/signal.hpp> But I get this error when I build. fatal error LNK1104: cannot open file 'libboost_signals-vc90-mt-gd-1_42.lib' The lib file is not contained within my boost directory. Typing 'libboost_signal' (with variations) into google hasn'...

Problems upgrading VS2008 to VS2010 with Managed and Unmanaged C++

I have a VS2008 Professional solution that I tried to convert to VS2010 Professional (RTM from MSDN download) today and I am experiencing some problems with some unmanaged and managed C++ DLLs that are referenced by a C# application. The C# application is set to target .NET 3.5 (as it was in the VS2008 version) but when I try and compil...

assign values to selective items using STL multimap

typedef std::pair<int, bool> acq_pair; //edge, channel_quality typedef std::pair<int, acq_pair> ac_pair; typedef std::multimap<int, acq_pair> ac_map; typedef ac_map::iterator It_acq; int bits = acq_map.size(); std::cout << "bits = " << bits << std::endl; std::vector<std::vector<bool> > c_flags (1 << bits); for (i = 0; i < c_flags.siz...