.NET Framework - cpp-Dialog --> C#-Dialog

Asked By Ernst Sauer on 19-Oct-11 08:27 AM
Hello,

what is the easiest way to do this?
Are there any tools for this task?

Thanks
Ernst




Peter Duniho replied to Ernst Sauer on 19-Oct-11 10:07 AM
First, you need to define what you mean by "cpp-Dialog" and "C#-Dialog".

Even in C#, there are multiple ways to show a dialog.  .NET has two
completely different GUI APIs (Forms and WPF), and each API offers
simple "message box" dialogs as well.

In unmanaged code, one typically would use a dialog template resource,
but of course even there you might use it directly from plain C/C++ or
you might be using MFC or some other framework.  And the unmanaged
Windows API also has its version of a message box.

With a more specific question, you are likely to be able to get a more
specific answer.

All that said, in general the .NET GUI APIs are different enough from
what is available in unmanaged code that you are not likely to find tools
to completely automate the process.  But take a look at this discussion
for useful ideas and a link to a tool to at least deal with some of the
more tedious parts:
http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/b0672f08-ebfd-4f08-9836-42e533a33509

Pete
Ernst Sauer replied to Peter Duniho on 19-Oct-11 11:06 AM
Am 19.10.2011 16:07, schrieb Peter Duniho:
I am looking for a quick way to convert a resource (.rc) file from a VS
MFC app to a C# WinForm (.designer.cs).

I will try your link.

Ernst
Jeff Johnson replied to Ernst Sauer on 19-Oct-11 12:00 PM
I have never looked for such a thing, so I cannot say for sure if one exists or
not, but I can say that I do not recall ever seeing anyone ask this question
in this newsgroup, for whatever that is worth.
Peter Duniho replied to Ernst Sauer on 19-Oct-11 11:07 PM
I have not used the tool myself, but it does promise to help with your
scenario.  You'll still need to port and hook up all the specific UI
logic behind your dialog, but hopefully the tool will at least simplify
the initial creation of the layout for the form.

Pete
Ernst Sauer replied to Peter Duniho on 20-Oct-11 06:05 PM
Am 20.10.2011 05:07, schrieb Peter Duniho:
...

RC Coverter from DudeLabs does the job, it saves a lot
of stupid work.
Unfortunately I did some unnecessary tests, so I have
only one more try  :-(

Ernst
Peter Duniho replied to Ernst Sauer on 20-Oct-11 09:25 PM
Well, if it saves a lot of stupid work, it might actually be worth
paying for.  I think $200 is pretty steep for that kind of tool (it is
less useful than Reflector and costs twice as much???seven times as much
as the basic version, which is still more useful than a .rc-to-forms
converter), but fact is at normal programmer pay rates, that is only a
few hours of work.  If you save more time than that, the software has
paid for itself.

Pete