473,941 Members | 6,333 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4488
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.UserContr ol 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.UserContr ol). 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.UserContr ol). 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+spinbutt on 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+spinbutt on.

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
2591
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 all the text for each controls on the form which then can be converted to a .resx file for a given culture. Basically I want to do what WINRES.EXE does but through code. Thanks,
0
2220
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 creates its own .resx file (i.e. form1.resx) for each form. I realized that I was not able to add any strings inside that .resx file because the .Net Designer will overwrite that .resx file causing me to lose the strings I add. Therefore, I created a...
1
4056
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 ==> .txt files from .resources or .resx files. ==> .resources files from text or .resx files.
0
499
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 the code-behind from the first page (mypage.aspx.cs). I hooked everything together and both aspx pages work great. In the process I renamed the code-behind file (mypage.aspx.cs). This caused a disconnect in the VS.NET IDE with the resx file. I...
0
1704
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 content with other languages. We have quite a number of Resx file and each Resx file has enough items so there is a high probability that we might miss few nodes/items in RESx files of other language.
6
4615
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
1660
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 different one. I tried the following code: System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(formDebayer::typeid));
0
2248
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 Content and set copy to output Directory property to Copy Always. I was expecting when i publish the web site I would see the resx file seperately and not packed inside the dll so that I can change the resx file dynamically. But to my surprise I...
8
14972
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 cut and paste code that MSDN recommends for playing a simple wav file from inside an embedded file, like presumeably the 'resources' file .resx is. I want to embed the .wav file in a 'resource file' since I don't want the user storing the file on...
0
9964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11530
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
11296
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7389
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6080
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6298
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4908
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4450
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3507
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.