Form resource files

D

Dave Brown

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.
 
T

Tamas Demjen

Dave said:
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
 
D

Dave Brown

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top