How Do I Get A Handle To and Assembly Object???

  • Thread starter Thread starter E.D.I
  • Start date Start date
E

E.D.I

How Do I Get A Handle To and Assembly Object???
Actually i need to use Bitmap.FromResource() and i need to give it the
name and a handle of the Assembly...
Please Help!!!! Realy Realy Stuck....
 
How Do I Get A Handle To and Assembly Object???
Actually i need to use Bitmap.FromResource() and i need to give it the
name and a handle of the Assembly...
Please Help!!!! Realy Realy Stuck....

Well, which assembly are you trying to get hold of?

You're likely to find that typeof(...).Assembly is what you're after,
but you need to know a type within the assembly in order to use
typeof.

Jon
 
Well, which assembly are you trying to get hold of?

You're likely to find that typeof(...).Assembly is what you're after,
but you need to know a type within the assembly in order to use
typeof.

Jon

this shoud be an assembly of a Form i guess, u see i'm in the middle
of a project in witch we are at work of creating a program for
automatic converting our delphi coded program to C# coded progran
in .NET so this function is a general functiion that works in delphi
and i'm looking for a prallel way in c# so i'm not sure about the type
but i guess it should be a Form so thanks for the help
 
E.D.I said:
this shoud be an assembly of a Form i guess, u see i'm in the middle
of a project in witch we are at work of creating a program for
automatic converting our delphi coded program to C# coded progran
in .NET so this function is a general functiion that works in delphi
and i'm looking for a prallel way in c# so i'm not sure about the type
but i guess it should be a Form so thanks for the help

Well it's likely to be a *particular* form, rather than just the Form
type, unless you really want to get a resource from the
System.Windows.Forms assembly.
 
Well it's likely to be a *particular* form, rather than just the Form
type, unless you really want to get a resource from the
System.Windows.Forms assembly.

Thats not working , i need the handle ( IntPtr Type )of an assembly :(
 
Thats not working , i need the handle ( IntPtr Type )of an assembly :(

i think this one should is fine ,
IntPtr HINSTANCE =
Marshal.GetHINSTANCE(Assembly.GetExecutingAssembly().GetType().Module);
but i dont understand what the type got to do with this and how is the
module referenced from it,
 
i think this one should is fine ,
IntPtr HINSTANCE =
Marshal.GetHINSTANCE(Assembly.GetExecutingAssembly().GetType().Module);
but i dont understand what the type got to do with this and how is the
module referenced from it,

To be honest, I think you're going about things the wrong way. Getting
a Bitmap from an assembly resource is usually a lot easier than this,
usually using the ResourceManager class, or using Bitmap.FromStream by
providing it with the result of a call to
Assembly.GetManifestResourceStream.
 
To be honest, I think you're going about things the wrong way. Getting
a Bitmap from an assembly resource is usually a lot easier than this,
usually using the ResourceManager class, or using Bitmap.FromStream by
providing it with the result of a call to
Assembly.GetManifestResourceStream.

you were write thanks for the help
 

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

Back
Top