I have a bunch of enum types in some library header files that I'm using, and I want to have a way of converting enum values to user strings - and vice-versa.
RTTI won't do it for me, because the 'user strings' need to be a bit more readable than the enumerations.
A brute force solution would be a bunch of functions like this, but I f...
Hi Guys,
I'm having problems with cross theme compatibility in windows forms. If you don't set the font for a control on a windows form, it will use the system font with correct typeface and size. If you want to make the font bold, it hard codes in the rest of the system font values for the current theme you're programming with. For ...
Hi I'm struggling to find examples/explanations of coding a MS Certificate Authority exit module. If anybody has any help or resources they can point me at I'd be grateful.
Thanks
Mark
...
I need to get a list of directories shared by the current computer, and their shared names. How do I do this in C++ / MFC?
...
We need to write unit tests for a wxWidgets application using Google Test Framework.
The problem is that wxWidgets uses the macro IMPLEMENT_APP(MyApp) to initialize and enter the application main loop. This macro creates several functions including int main(). The google test framework also uses macro definitions for each test.
One of ...
Very basic question.. how do I write a short literal in C++?
I know the following:
2 is an int
2L is a long
2LL is a long long
2.0f is a float
2.0 is a double
'\2' is a char.
But how would I write a short literal? I tried 2S but that gives a compiler warning.
...
What is a fairly standard way for storing application settings, mainly for windows but also easy to move over to other platforms.
There's basically 4 groups of settings I want to have:
Global settings, affects all users, and may be moved between machines
Global system settings, affects all users, but specific to that system (eg defaul...
Let's have the following class definition:
CThread::CThread ()
{
this->hThread = NULL;
this->hThreadId = 0;
this->hMainThread = ::GetCurrentThread ();
this->hMainThreadId = ::GetCurrentThreadId ();
this->Timeout = 2000; //milliseconds
}
CThread::~CThread ()
{
//waiting for the thread to terminate
if (...
I'm in the process of creating a class that stores metadata about a particular data source. The metadata is structured in a tree, very similar to how XML is structured. The metadata values can be integer, decimal, or string values.
I'm curious if there is a good way in C++ to store variant data for a situation like this. I'd like for...
I've got a c++ Win32 app that has a number of threads that might be busy doing IO (HTTP calls, etc) when the user wants to shutdown the app. Currently, I play nicely and wait for all the threads to end before returning from main. Sometimes, this takes longer than I would like and indeed, it seems kind of pointless to make the user wait...
In my application I have a number of panes from m_wndspliter classes. What I want to do is at run time show and hide one of these panes. Whilst with the following code I can show and hide the view associated with the pane, I can't temporarily remove the pane itself.
CWnd * pCurView = m_wndSplitter2.GetPane(2, 0);
if( !pCurView == NULL ...
What on earth is a caret in the context of a CSplitterWnd class? I can't find any documentation relating explicitly to CSplitterWnds...
EDIT: Specifically, what do these functions actually do:
CWnd * pCurView = m_wndSplitter2.GetPane(2, 0);
pCurView->ShowCaret()
pCurView->HideCaret()
EDIT2: Please note, I know what a caret is, I am s...
Hello
I am using Borland Turbo C++ with some inlined assembler code, so presumably Turbo Assembler (TASM) style assembly code. I wish to do the following:
void foo::bar( void )
{
__asm
{
mov eax, SomeLabel
// ...
}
// ...
SomeLabel:
// ...
}
So the address of SomeLabel is placed into EAX. This doesn't ...
I am working on C++ and COM/ATL in Windows from last few years. Now I want to shift to Linux Programming. I know basic architecture of Linux. I did some of the projects which are using ncurses, sockets and audio libraries(Terminal Applications). On which tool I should be familiar to start with projects. In windows I have started with Win...
What are the easiest steps to make a small circuit with an LED flash from a C/C++ program?
I would prefer the least number of dependencies and packages needed.
What port would I connect something into?
Which compiler would I use?
How do I send data to that port?
Do I need to have a micro-processor? If not I don't want to use one for ...
Kind of a random question...
What I'm looking for is a way to express a cast operation which uses a defined operator of the class instance I'm casting from, and generates a compile-time error if there is not a defined cast operator for the type. So, for example, what I'm looking for is something like:
template< typename RESULT_TYPE, ty...
I have some C++ source code with templates maybe like this - doxygen runs without errors but none of the documentation is added to the output, what is going on?
///
/// A class
///
class A
{
///
/// A typedef
///
typedef B<C<D>> SomeTypedefOfTemplates;
};
...
I am using a library that has headers without the .h
This defeats visual studio's intellisense (declaration/definition lookup)
Anyone know how to tell VS2008 that a file is a header?
...
This may not be possible, but I figured I'd ask...
Is there any way anyone can think of to track whether or not an automatic variable has been deleted without modifying the class of the variable itself? For example, consider this code:
const char* pStringBuffer;
{
std::string sString( "foo" );
pStringBuffer = sString.c_str();
}...
I'm reading this C++ open source code and I came to a constructor but I don't get it ( basically because I don't know C++ :P )
I understand C and Java very well.
TransparentObject::TransparentObject( int w, int x, int y, int z ) :
_someMethod( 0 ),
_someOtherMethod( 0 ),
_someOtherOtherMethod( 0 ),
_someMethodX( ...