• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

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

Joined
8/5/14
Messages
312
Points
303
My new job requires that I have a deep understanding of the following concepts:

1. Windows programming
2. Database connections
3. Multi threading

Can someone provide introductory references to help me learn these concepts?
 
@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??
 
@Daniel Duffy Are you porting an MFC multi threading application to use boost::threads? I am considering doing this.
I needed to port just the UI part of a single-threaded app. A lot of MFC stuff is not supported any more in VS2015, painful.

Why not use C++11 Threading?
 
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?
 
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
 
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