Help with using/converting MFC to C#

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all

For some reason I can't get a handle on compiling/using a MFC class with a C# project., or how to tak
a MFC class and convert it to a C# class. Does anyone know of any sites/tutorials/howto's that's nice and
simple; something along lines of "Open here->click there->click this->etc."
I've seen some articles about converting C++ classes to C#, but what do you do with something like

void MyTestApp::ShowMsg(CString sIn

AfxMessageBox(sIn)
Func(TRUE,5)
}

void MyTestApp::Func(BOOL bToF,int nNum

//do somethin


I've probably read about how to do this many times, but for some reason the light just hasn't gone on yet. An
help/suggestions/examples/etc. appreciated

TIA

Ray K
 
Raykos:

I don't know whether this is useful to you, and I have no experience with
MFC. However yesterday at Microsoft DevDays, I saw a Whidbey (VS.Net 2005)
demo where they showed that a class (window frame?? -- it ended up being an
MDI child window) written in C# was pulled directly into an MFC application.
The point being that with Whidbey, they had extended the environment enough
such that you could use C# right along with MFC (disclaimer: I really don't
know MFC, and I only watched the demos, so I have no knowledge of what the
rules and limitations might be). I did see that with Whidbey, you can mix
languages within a project. So you could have a project that includes C++
=, C# and VB code, all compiled into the same assembly.

I think that the intention of all that was to provide a bridge for MFC
applications to incorporate .Net code. I don't know whether the public beta
(PDC bits) version of Whidbey supports this, but it might be worth checking
into.


raykos said:
Hello all,

For some reason I can't get a handle on compiling/using a MFC class
with a C# project., or how to take
a MFC class and convert it to a C# class. Does anyone know of any
sites/tutorials/howto's that's nice and
simple; something along lines of "Open here->click there->click this->etc."
I've seen some articles about converting C++ classes to C#, but what do you do with something like:

void MyTestApp::ShowMsg(CString sIn)
{
AfxMessageBox(sIn);
Func(TRUE,5);
}

void MyTestApp::Func(BOOL bToF,int nNum)
{
//do something
}

I've probably read about how to do this many times, but for some reason
the light just hasn't gone on yet. Any
 
Back
Top