Hi Fred!
Remember: This *only* works if you make an ANSI-Build of your App! If
you (later) switch to UNICODE, it does not work anymore!
What is the problem? The following works perfectly:
#include <afx.h>
#include <windows.h>
This is exactly what I suggested:
TheFunc(CString(Junk.Text));
Maybe; I have not looked at your source...
On my Visual Studio 2003 Enterprise running on XP PRO SP2, putting
"#include <afx.h>" before "#include <windows.h>" results in about dozen
warnings and errors. Reversing the order results in only one error in
afxv_w32.h which is generated by the following lines of code:
#ifdef _WINDOWS_
#error WINDOWS.H already included. MFC apps must not #include
<windows.h>
#endif
Since this is a .net app I don't fully understand this error.
Also you mentioned ANSI/UNICODE builds, where is this set?
I am an experienced programmer, but new to .net. I am probably doing
something wrong, but I find the documentation is poor and most of the
examples are to simplistic especially when it comes to mixed mode
programming.
Most of our applications are evolutions of existing apps rather than new
application from scratch. I suspect most companies who have a large
investment in code are not going to switch to .net unless there is a
reasonable upgrade path. So far I don't see it. It has been an up hill
battle just to convert these little demo programs that I originally
wrote in an hour or 2. I can't imagine what it would be like to convert
one of our multi-threaded DLLs that took a week to write. I could
probably retire converting one of our major apps, some of which took
more than a year to write.
I had fewer problems converting these program to Linux using a free
compiler! It's just a char* so why all the grief.