By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,369 Members | 1,584 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,369 IT Pros & Developers. It's quick & easy.

Form resource files

P: n/a
Hi there,

Given an arbitrary ".resx" file (not ."resources"), does anybody know how I
can identify that this file actually contains a Windows form (in code). Once
identified, I then want to collect information about the form and all its
controls. Presumably I would want to read this file into a
"System.Windows.Forms.Form" class so I can obtain the necessary info. How
would I do this. Thanks.in advance.
Jun 2 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Dave Brown wrote:
Hi there,

Given an arbitrary ".resx" file (not ."resources"), does anybody know how I
can identify that this file actually contains a Windows form (in code). Once
identified, I then want to collect information about the form and all its
controls. Presumably I would want to read this file into a
"System.Windows.Forms.Form" class so I can obtain the necessary info. How
would I do this. Thanks.in advance.


There is no form in the .resx file, and no source code either. It only
contains binary resources, such as images and image lists (or other
types of embedded multimedia streams). The form itself and its controls
are always in source code format in the .cpp (or .cs or .vb) file, named
similarly as the .resx but having a different extension. The resource is
just a supplement for those properties that can not be described in
source code.

Tom
Jun 2 '06 #2

P: n/a
> There is no form in the .resx file, and no source code either. It only
contains binary resources, such as images and image lists (or other types
of embedded multimedia streams). The form itself and its controls are
always in source code format in the .cpp (or .cs or .vb) file, named
similarly as the .resx but having a different extension. The resource is
just a supplement for those properties that can not be described in source
code.


Thanks for the reply. Well, let me clarify this a little (note BTW that I'm
a very experienced C++ (WinAPI) developer but am fairly new to .NET). As I'm
sure you know, the VS IDE automatically creates a ".resx" file for each form
created in the IDE (and one for each localized version if the form's
"Localizable" property is set to "True"). Now, if I pass this ".resx" file
to the native .NET utility "Winres.exe", it can re-construct (display) the
form based on the "resx" file alone (no other project files need be
present). I need to do the same thing but here's the twist. I'll be
enumerating all ".resx" files in an arbitrary project so as I encounter each
".resx" file, I first need to determine if it is in fact a VS-generated
".resx" file (containing the form's resources). If so then I want to gather
information about the form in code (possibly displaying it) but I'm not sure
how to do this. "Winres.exe" can do it however ((hopefully relying on
documented techniques) but I still can't figure out how (after lots of
digging). Any suggestions? Thanks again.
Jun 2 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.