|
|
hi, I am using following code to invoke my DLL and it's functions.
Assembly assemScenarioPreview = Assembly.LoadFrom(Some Path);
Type typeScenarioPreview = assemScenarioPreview.GetType(...);
Object obj = Activator.CreateInstance(typeScenarioPreview);
MethodInfo methodofScenarioPreview = typeScenarioPreview.GetMethod("Run");
methodofScenarioPreview.Invoke(obj, null);
methodofScenarioPreview = typeScenarioPreview.GetMethod("CleanUp");
methodofScenarioPreview.Invoke(obj, null);
In first chance it's get executed. but next time it throws an Exception.
"Exception has been thrown by the target of an invocation"
If I closed the client then then again ran the same code. it works..
What is the possible problem ..
|
|
|
|
|
Generally, a try/catch block around this will let you see what the exeption says about itself. Very useful stuff. Do something like the following, and you'll get information about the exception. (Also, be aware that the InnerException memeber may need to be looked at in some rarer occasions.)
try
{
// Your code here.
}
catch (Exception err)
{
System.Diagnostics.Trace.WriteLine(err.ToString());
// or
MessageBox.Show(err.ToString());
}
John
"We want to be alone when we hear too many words and we feel alone when it has been a while since anyone has spoken to us." Paul David Tripp -- War of Words
|
|
|
|
|
Please help me if you know the answer to this. I want to create a dataAdapter, that fills a dataSet. However, I have a stored procedure that I want to use, that takes one int as input. I have been trying this for a few hours now, and have come no closer.
|
|
|
|
|
Design time:
You have to set your parameter to the Parameters collection of the Command object.
Run time:
Use the Add method of the Parameters collection to create a Parameter object for the parameter in the stored procedure.
SqlCommand[^]
"If a jug falls upon a stone, woe to the jug. If a stone falls upon a jug, woe to the jug. Always woe to the jug"." - KaЯl This signature was created by "Code Project Quoter".
|
|
|
|
|
Firstly, what is the best way to delete some text. What I want is the number "563.5423" to become "563.54".
|
|
|
|
|
See Remove or Substring or Replace methods of string object
Hi,
AW
|
|
|
|
|
when i use tabcontrol,i find that there is no property for the tabpage to visible or unvisible.i want make tabpage1 to visible but tabpage2 to unvisible,but beacause there some progress need controls on tabpage2,so i can remove tabpage2,i just want to make it unvisible.how can i make that?
thanks
|
|
|
|
|
Only by removing/adding from Controls
Hi,
AW
|
|
|
|
|
I have a figure that I want to fill with black color, but it don't work!!
private void button11_Click(object sender, System.EventArgs e)
{
System.Drawing.Graphics formGraphics = null;
System.Drawing.Pen myPen;
formGraphics = pictureBox7.CreateGraphics();
myPen = new System.Drawing.Pen(System.Drawing.Color.Black,1);
formGraphics.DrawLine(myPen, 4, 4, 50, 4);
formGraphics.DrawLine(myPen, 4, 4, 4, 100);
formGraphics.DrawLine(myPen, 50, 4, 50, 100);
formGraphics.DrawLine(myPen, 4, 100, 27, 120);
formGraphics.DrawLine(myPen, 50, 100, 27, 120);
SolidBrush Brush = new SolidBrush(Color.Black);
Point point1 = new Point(4, 4);
Point point2 = new Point(50, 4);
Point point3 = new Point(4, 4);
Point point4 = new Point(4, 100);
Point point5 = new Point(50, 4);
Point point6 = new Point(50, 100);
Point point7 = new Point(4, 100);
Point point8 = new Point(27, 120);
Point point9 = new Point(50, 100);
Point point10 = new Point(27, 120);
Point[] curvePoints = new Point[]
{
point1,
point2,
point3,
point4,
point5,
point6,
point7,
point8,
point9,
point10,
};
formGraphics.FillPolygon(Brush, curvePoints);
myPen.Dispose();
formGraphics.Dispose();
}
Any idea?
|
|
|
|
|
So I'm doing something like :
[Category("Visual"),
DefaultValue(XXXX)
]
public Color MyColor { get{..} set{..} }
What should I put in XXX to get my color initialized correctly .. whatever I put in it, I get a wrong value or color !!
Cheers,
MrPink
|
|
|
|
|
Color.Black is what you want?
Mazy
No sig. available now.
|
|
|
|
|
Well,
[
...
DefaultValue(Color.Black),
]
Does not work
|
|
|
|
|
What about:
[
...
DefaultValue(KnownColor.Black),
]
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Let me rephrase the question...
/\ |_ E X E GG
|
|
|
|
|
Were you going to rephrase the question in this post or another one?
John
"We want to be alone when we hear too many words and we feel alone when it has been a while since anyone has spoken to us." Paul David Tripp -- War of Words
|
|
|
|
|
funny he lost the thought
|
|
|
|
|
NO. I'm just to damn fustrated with this stupid little thing I need my program to do....
and I don't know how to do it...
it's dumb...
I don't know how...
and I just want someone else to do it...
/\ |_ E X E GG
|
|
|
|
|
then show the xml and describe what your trying to do
|
|
|
|
|
Memory Management
I am using mid form in a windows forms application. Every time I am loading new child windows memory is going up(it’s ok). When I close them memory is not coming down. I am disposing child windows as they close.
Why is this happening ?
What is the solution for this problem ?
What are the best practices for memory management.
Thanks
Gau
Gaurika Wijeratne. //
www.gaurika.com
Every Compounded thing is impermanent
|
|
|
|
|
If you are using task manager to detect memory usage, what you are seeing is the programs working set and not the atuall memory usage.
You say you are using the Dispose method as you close windows. But do those child windows use any resources that are not automatically disposed?
Contrary to popular belief, .NET's automaticall memory management does not imply immediate 100% resource cleanup. Some resources have to be cleaned up manually to decrease memory footprint at any given time since the garbage collector funtions in a non-deterministic way.
|
|
|
|
|
I don’t have any other resources in them . say if I have 20 child windows even after I close all of them, Task Manager dose not reflect it , till I close the MDI main.
Is Task Manager showing the correct memory ?
Any other tool to track memory ?
Gaurika Wijeratne. //
www.gaurika.com
Every Compounded thing is impermanent
|
|
|
|
|
|
how to minize and close form into system tray (application running)
help me!!!
Nho'c ti`
|
|
|
|
|
You have to use NotifyIcon . For more information search it in CP. There is a article about it.
Mazy
No sig. available now.
|
|
|
|