• Countdown to the 2025 QuantNet rankings. Join the list to get the ranking prior to public release!

Windows programming, Multi-threading, Database connections in C++

@alain I would prefer to use C++11 threads, but I must use
MFC's Threading library since we only use Visual Studio 2008 with no C++11 support. I will provide more information about the optimization when I learn more about this.

For now, I was wondering if anyone could provide resources to learn about databases, MFC's threading library and windows programming. I know these are broad topics. I will provide more info when I find out more. Anything to help me start would be great.
 
Unfortunately, you are very much constrained by legacy VS2008 and super-legacy MFC. It's between a rock and a hard place. IMO you need to be at least on VS2010 and ideally VS2015.

MSDN has lots of stuff on MFC.

C++ is a pain with databases; C# is much easier.

For threading you could use Boost Thread which works with VS2008. For databases, ADO.NET is the MS standard.

Do you maintain a legacy C++/MFC application? To be honest, MFC is really really outdated.

Here is something I wrote on Boost Thread
https://www.quantnet.com/threads/c-multithreading-in-boost.10028/
 
Last edited:
Try to use openmp as much as you can. Boost.Threads is also good alternative but try to avoid MFC at all costs.

Install some well known free libraries. Boost and POCO should be at the top of your list.

PS - You are in for a lot of pain.
 
Try to use openmp as much as you can. Boost.Threads is also good alternative but try to avoid MFC at all costs.

Install some well known free libraries. Boost and POCO should be at the top of your list.

PS - You are in for a lot of pain.

I agree. OpenMP is a great way to learn.

A disgruntled user once said "Microsoft Frustration Classes".

=====
SOCI library for DB
SOCI - The C++ Database Access Library
 
Last edited:
Unfortunately, you are very much constrained by legacy VS2008 and super-legacy MFC. It's between a rock and a hard place. IMO you need to be at least on VS2010 and ideally VS2015.

MSDN has lots of stuff on MFC.

C++ is a pain with databases; C# is much easier.

For threading you could use Boost Thread which works with VS2008. For databases, ADO.NET is the MS standard.

Do you maintain a legacy C++/MFC application? To be honest, MFC is really really outdated.

Here is something I wrote on Boost Thread
https://www.quantnet.com/threads/c-multithreading-in-boost.10028/

Thanks for the references. I am maintaining legacy C++/MFC application. For that reason, I am constrained by the MFC threading interface.
 
Ryan,
Believe it or not, I am porting MFC from ages ago and I get error


MSG* pMsg = &AfxGetThread()->m_msgCur;

"m_msgCur is not a member of CWinThread"

Any ideas??
 
I can't use C++11 Threading because I only have access to VS 2008.

I have been debugging an MFC application for over a week now. I don't feel like I am making any progress. I am considering changing everything to boost::threads instead.
An advantage of VS2008 is that some MFC code has not yet been deprecated/unsupported, but this has major consequences..

It means VS2008 will be used for some more years?
 
like VC++ 6? That one is still around
Yeah.
I gave a course last year to a company that build dredging machines. They still use VC++ 6.0, it's blisteringly fast.

My fav error message "INTERNAL COMPILER ERROR, contact Microsoft"
 
thinking about it, Ryan

would it not be better to us VC++ 6.0 instead of VS2008 for this MFC project?
 
Back
Top Bottom