|
ILDASM.EXE does not work on a legacy dll and it gives the error "... does not contain CLR header and therefore it cannot be disassembled."
Any solution please?
|
|
|
|
|
sorry to hear that! but I always used ildasm and never found any problem!
The least I can tell you is this:
go to a C# reflection tutorial and write a program to get the attributes/methods/classes at run time!
it's pretty easy, and you should get all the info you need.
Far from that I don't no!
GaMBiT---> aND ReVeNGe WiLL Be
|
|
|
|
|
DependencyWalker[^] can show you the functions exported by a DLL.
Usually you won't be able to determine the number and type of parameters a function expects, because legacy DLLs didn't expose such meta information.
mav
|
|
|
|
|
Hello,
I have 2 forms. One is called librarySettings, and another one is called loanBook. When the user wants to loan a book, l want to be able to receive 2 variables from this form, which is DaysBorrowed, and OverdueFine. This way if the settings are changed then the loanbook form will have the updated variables.
This is what l have done, and l have done this before, but can't seen to get it to work. Don't know what is going on here.
LibrarySettings form.
[code]
This load the variables data from a database, so that the settings can be updated to a database.
private void frmLibrarySettings_Load(object sender, System.EventArgs e)
{
try
{
cnn.Open();
OleDbCommand cmd = cnn.CreateCommand();
OleDbDataAdapter da = new OleDbDataAdapter();
DataTable dt = new DataTable();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "SELECT * FROM LibrarySettings";
da.SelectCommand = cmd;
da.Fill(dt);
upDDays.Value = Convert.ToInt16(dt.Rows[0]["Days"]); //load into a numericUpDown control
upDFine.Value = Convert.ToInt16(dt.Rows[0]["Fine"]);
}
catch ( OleDbException ex )
{
MessageBox.Show(ex.Message);
}
catch ( Exception ex )
{
MessageBox.Show(ex.Message);
}
}
[/code]
//Set up 2 public procedures
[code]
public int fineAmount
{
get
{
return Convert.ToInt16(upDFine.Value);
}
}
public int DaysToBorrow
{
get
{
return Convert.ToInt16(upDDays.Value);
}
}
[/code]
That is all for the library settings form
for the loanbook form.
I have declared this in the form at the top of the class
<br />
frmLibrarySettings getLibraryDetails = null;
Find out how long the book can be loaned for.
<br />
int loanDays = 0;<br />
loanDays = getLibraryDetails.DaysToBorrow;
The error message l get when this code is executed is " Object reference not set to an instance of an object."
Not sure what l am doing wrong. Hope someone can help
Thanks in advance,
Steve
|
|
|
|
|
frmLibrarySettings getLibraryDetails = null;
and then:
loanDays = getLibraryDetails.DaysToBorrow; //getLibraryDetails still null?
??
u can't get a property value from an object that hasn't been initialized
|
|
|
|
|
Thanks for the reply,
I am coming from VB so not sure if what l am doing is correct. Do l have to initial the object in the constructor?
Any sample code would help.
Thanks for your help,
Steve
|
|
|
|
|
Make a global variabel i.e. private frmLibrarySettings getLibraryDetails;
in the constructor initialize it: frmLibrarySettings getLibraryDetails = new frmLibrarySettings(/*parameters?*/);
now u can call functions and properties on getLibraryDetails from anywhere inside the class
|
|
|
|
|
alternatively u can initialize it in the XXX_load function
|
|
|
|
|
Thanks for your help,
frmLibrarySettings getLibraryDetails = new frmLibrarySettings();
Was the answer
|
|
|
|
|
Well if I am doing that for me...I would use a simple Object Oriented approach.
1. make a local variable in your second form for the information you need to gather.
2. write 2 simple methods to get and set that information.
3. when calling the second form after all processing just write
<variable> = <form_variable>.getXXX();
for example say I have a form to get a point from the user and it have this in the second form:
...form declarations
int x;
int y;
.....
....
public void setX(int x)
{
this.x = x;
}
public int getX()
{
return x;
}
....from the other (first) form just do:
int x;
x = form2.getX();
int y;
y = form2.getY();
by the way...the set x is there so that you can manipulate it later on!
GaMBiT---> aND ReVeNGe WiLL Be
|
|
|
|
|
Hi
I have made a service in C# from where I would like to send keystrokes to the application in focus.
I have tried to use the SendKeys class calling the function
SendKeys.SendWait
When I do that I get an exception "unable to create hook"
Can anybody give me a hint how to solve that ?
Thanks
Brian
|
|
|
|
|
hi,
You cannot send keystrokes to an Interactive Session of windows from a Service. Because that (Service)runs on a diffrent session. If you need to send some response to the interactive session you can consider using sockets or some other Inter Process Communication (IPC) techiniques.
James
James Poulose
|
|
|
|
|
Hi,
Any one can Help me How to Write a Wrapper Class For third Party(Infragistics) tools,
Since I am New to this Please Help me
Regards
Prabhakar.A
Prabhakar.A
Software Engineer
|
|
|
|
|
Hi ,
Guess you can use adapter pattern for this. Can you please check the url dofactory for more info on this.
Thanks
SGS
|
|
|
|
|
Hi,
I want to ignore a class tag and serialize the object inside this ignored class. can someone help me do that. i tried using xmlignore but it ignores that class completely. instead i dont want to serialize that class as parent tag and i want the object and variable inside this class to serialize. can u help?
bye
RJ
RJ
|
|
|
|
|
Im not sure what you are talking about, sorry. Object inside? You should watch what you are saying, Intel is quick with sueing people nowadays
Cheers
Sid
|
|
|
|
|
Consider this example XML
<country>
<city>
<name>India
to serialize this i have a class "Address" which has a data member of class "Country" inside which i have a data member of class "City" and inside class "City" i have a string variable "Name". Now if i have to serialize i have to send a object of class "Address" and after serialization i get a XML as given above but i want a output as this
<city>
<name>India
i dont want "Country" tag. for this if i give XMlIgnore Attribute for "Country" it ignores everything inside this class for example "City" tag. I hope this would have made my problem clear.
|
|
|
|
|
hey the browser parses this xml example i gave above.
|
|
|
|
|
Well, at least this means its valid XML
|
|
|
|
|
Why dont you simply write your own Serializer, which would then output what you want and ignore what you dont need?
Cheers
Sid
|
|
|
|
|
thanxs...
this may be a silly question can u tell me how can i write my own serializer...
RJ
|
|
|
|
|
Generated XML
< Address >
< Country >
< City >
< Name > India </Name >
< /City >
< /Country >
< /Address >
Required XML
< Address >
< City >
< Name > India </Name >
< /City >
< /Address >
|
|
|
|
|
Hi,
I have developed an application at resolution 1024,768. I am able to adjust the form size for different resolutions, I did that, in paint event method as,
private void frmDocumentTracking_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
this.Size = new Size(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height);
}
But I am unable control the size of the controls in the form, I tried that by changing the Anchor property, still i am not finding the proper solution for this.
plz help me in this regard..
Regards
soman.
soman.
|
|
|
|
|
Use a LayoutManager or write one yourself.
Other than that you might want to look into panels.
OK, simply "divide" your Window into different areas, based on your customer's needs. Then use one panel per area and use the Dock-Property to get them where you need them (at this point, you MIGHT need a LayoutManager).
You then should be able to sub-divide the panels using the same technique, until you have every control where it is supposed to be.
Try resizing - if it does not work, start over
Cheers
Sid
|
|
|
|
|
The Paint Event will be called when you refresh the screen
So on SizeChanged Event
write
this.Invalidate();
|
|
|
|