|
|
hi experts ,, i wana know that how to add a existing class in a windows application project in C#.and how to use it by making objects or watever.. i hope u will understand. waiting for yours reply. plz make a simple application with a button that i can understand easily(make any class declaration and add it)
ishi_us@yahoo.com
|
|
|
|
|
How can i import images stored in a database into a listview control
in thumb nail format.(must support all types of images).
I must be able to view all the images at a time.
Gopi K
|
|
|
|
|
|
Does anybody know any .net image processing library implementing famous filters like "Haar Wavelet"? If not, do you know any powerful Math library which helps to implement such filters?
Regards
|
|
|
|
|
How to find out details of the functionality exported by a legacy dll (which may not be a COM etc., which means it cannot be referenced from .NET project)? Is there any utility which can give details of the functions and data types etc. of such a legacy DLL?
|
|
|
|
|
I use ildasm.exe find it in your SDK directory under bin.
It will give you the attributes and methods/classes exposed by DLL!
GaMBiT---> aND ReVeNGe WiLL Be
|
|
|
|
|
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.
|
|
|
|