473,320 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How can a .rc file be converted to .resx?

Not sure if this question was posted before.
When I loaded an app.rc file from VC++ 6.0 to VC .NET 2003, I can see
all screens in resource view. But when I right-clicked and did 'add a
class' and tried to attached a class to a dialog or screen, I found out
that I am only able to add MFC class like CDialog. I can not attach
..NET class like WindowForm. So my question is that do we have some way
to convert a dialog defined in .rc file to one in .resx? Does .NET
support this kind of migration? Do we have to always start from scratch
to create a WindowForm-based dialog? I got hundreds of dialogs created
in VC++ 6.0 and wanted to reuse them in .NET framework.

Thanks in advance.

Nick

Nov 17 '05 #1
4 4446
ni*******@gmail.com wrote:
Not sure if this question was posted before.
When I loaded an app.rc file from VC++ 6.0 to VC .NET 2003, I can see
all screens in resource view. But when I right-clicked and did 'add a
class' and tried to attached a class to a dialog or screen, I found
out that I am only able to add MFC class like CDialog. I can not
attach .NET class like WindowForm. So my question is that do we have
some way to convert a dialog defined in .rc file to one in .resx?
Does .NET support this kind of migration? Do we have to always start
from scratch to create a WindowForm-based dialog? I got hundreds of
dialogs created in VC++ 6.0 and wanted to reuse them in .NET
framework.


AFIAK you have to start from scratch. You might do some googling around -
maybe someone's made a dialog resource -> winforms convertor, but I'm pretty
sure there isn't any such functionality "out of the box" for visual studio.

-cd
Nov 17 '05 #2
> When I loaded an app.rc file from VC++ 6.0 to VC .NET 2003, I can see
all screens in resource view. But when I right-clicked and did 'add a
class' and tried to attached a class to a dialog or screen, I found out
that I am only able to add MFC class like CDialog. I can not attach
.NET class like WindowForm. So my question is that do we have some way
to convert a dialog defined in .rc file to one in .resx? Does .NET
support this kind of migration? Do we have to always start from scratch
to create a WindowForm-based dialog? I got hundreds of dialogs created
in VC++ 6.0 and wanted to reuse them in .NET framework.

There is no automatic conversion form res file to the .NET verison. They are
too different.

You are probably refering about one dialog box template reused by different
parts of the program?

If you inherit from System.Windows.Forms.UserControl then you can create
your own custom controls by drag and drop.
Then later you can create another UserControl and drag your previously
created custom UserControl, so you can build controls on controls on
controls.
So no, you do not have to create every reoccuring form with minor changes
from scratch, you can create complete buildingblocks very easily. Even my
grandmother can do that.

I think this is called form inheritance.
Nov 17 '05 #3
Carl and Olaf. Thanks so much for your input and ideas.
Olaf, I am new to .NET and not quite follow the way you described
here(using System.Windows.Forms.UserControl). Do you have some examples
or links I can play with it?

Appreciate your help.

Nov 17 '05 #4
> Olaf, I am new to .NET and not quite follow the way you described
here(using System.Windows.Forms.UserControl). Do you have some examples
or links I can play with it?

I believe that this link will help you a little further:
http://www.akadia.com/services/dotne..._controls.html

It is C# but these controls can then be used in managed C++.
You will discover that mixing C#, VB.NET and managed C++ is fun. :-)
Although at this moment, you cannot create one dll (assemblie) with C# and
managed C++ together. You must crate a C# assemblie (dll) and then use it in
the managed C++. But I believe that VS2005 could do just that.

This way you can create custom controls in a modular way.
One example is I have a static text a slider and a spinbutton together in a
usercontrol (looks like a form) then I put the code behind it that
synchronizes the spin button with the slider and the other way around. The
static text is used as description.

Now in a late stage, I create another usercontrol and put these
slider+spinbutton control on that newly created usercontrol. I use this to
move something in a 3D scene , so I have an X, Y and Z slider+spinbutton.

Finally in my result project I use that last created custom control by drag
and drop.
So you can create a custom control using other custom controls using other
custom controls using ....

Coming from a MFC C++ backrgound moving into the .NET way of thinking will
be a steep learning curve, but it is very rewarding and you will notice that
the develop cycle is far much shorter. I prefer C# now since it is a
lightning fast compiler, but other parts of my code is still C++ too.

There is one issue about .NET that you must be aware of, that it has an
increased security so your programs might not run imemdiately on a machine
when you try to access a LAN folder or Internet. The administrator of that
machine should give enough execution rights, but luckily enough if you
create a setup project, no need of advanced user knowledge is needed if you
wish to distribute a program that needs LAN and Internet access. This
configuration could be done automatically.

One thing I wish Microsoft would implement in the next .NET is a user
friendly way of saying that this program does nt have enough rights to
execute on that machine. Right now, you get a scare error that looks like an
access violation dialog box, and it will take the user years of
psychotherapie to recover from that trauma. ;-) One solution might be a
dialog box with a simple explanation that this program might not have enough
rights to run or that the .NET framework is not installed yet, and an
advanced button the gives more details.

Another problem is that installing the .NET framework is aparently a very
scary thing to do, since I have had so many users now that just refuses to
install it. You have no idea what reasoning they had not to install the .NET
framework but all based on superstition. Luckily, it is getting more and
more accepted. I still believe that Microsoft should have promoted the .NET
installation on the Windows updated like they did with SP2.

Have a lot of fun :-)
Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Buddy | last post by:
Hello, I need to know how can I generate a .resx file from code for different language culture. Basically the .resx file is in binary, is there anyway that I can generate a text file contains...
0
by: qh0st | last post by:
Hi all. I have a frustrating issue that I can't seem to figure out. EXPERTS please help me~! Deadline is coming up soon~! My task is to localize a winform application. The .Net Designer...
1
by: Namratha Shah \(Nasha\) | last post by:
Hi All, This is a resource file generation tool which converts an xml based resource formats to .net resource file i.e. (.resources) and vice-versa. Today we will see how we will generate ...
0
by: David Krussow | last post by:
I had an aspx page (mypage.aspx) with a code behind file (mypage.aspx.cs) that in turn had a resx file (mypage.aspx.resx). I decided to create another aspx page (myotherpage.aspx) that would reuse...
0
by: prabhupr | last post by:
Hi Folks I'm currently working on a Localization+Globalization project; for this project, we need to generate ".Resx" files and we use "US English" Resx file as the base version, to compare the...
6
by: ad | last post by:
I wnat to load a file in an .resx file and transfer the file to a stream. How can I do?
0
by: Steave | last post by:
Hi, using Managed C++ (.Net 2.0), I want to embed some images within an executable using a .resX file, and upon an event (in this case a combo box changing), I want the picture box to update with a...
0
by: Rahul | last post by:
Hi I have a Project A that is being reffered by another WEB project Webber. In Project A i am using a resx file to store some information in it. I have m1de the Build Action of the Resx file to...
8
by: raylopez99 | last post by:
I have the latest version of Visual Studio 2008 Professional, which allows you to create resource files (this is the .resx file, no?), unlike the Express version, which does not. I am trying to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.