|
AshishBasran wrote: It means if I dispose the object instance, the reference in Queue will return false values
Of course. No different to a vector in C++, if you store a pointer, don't delete it elsewhere.
AshishBasran wrote: Is there any way I can store the full object?
Don't dispose of stuff you want to keep. I don't see the problem here.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Depends on what you store in the collection. Value types (structs and other primitive data types except string) get boxed, which implicitly creates a copy of the original object. Reference types (classes) are stored by reference.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi, This is Deepak. Friends I need you help. I just want to open the View Source Code of a HTML File through C# Code. Please Help me ASAP.
Deepak
|
|
|
|
|
Open your HTML file as text should give you the source code.
Cheers!!!!
- ashish
|
|
|
|
|
Hi
I have an application that has many different forms. All these forms use a certain kind of a TreeView that has drag/drop rules, copy/paste rules and other functionalities. I'm trying to create one inherited TreeView control instead of doing this for every TreeView in my application. Where do I start? How do I go about accomplishing that?
Thank you for your help.
|
|
|
|
|
i think you can build a usercontrol, that ok.;)
|
|
|
|
|
hi, I have a question.
I want to draw a line on the panel but this line must be drawn above all the control in this panel.
my code doesn't work as my want.
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint (e);
Graphics g = e.Graphics;
g.DrawRectangle(new Pen(Color.Red,3),0,0,this.Width-10,this.Height-10);
//this rectange still draws under all control
}
thanks for help!
|
|
|
|
|
Any control on your panel will draw above the panel. If this were not so, then you wouldn't be able to see your controls at all.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
so like you say, how can i put a frame(drawing image) may be this image on another or same panel which is displaying images that are capturing by webcam.
sorry about my bad English!
-- modified at 0:16 Wednesday 26th October, 2005
|
|
|
|
|
Are you doing this in the FORM's on paint, or a control's (what is this)? the co-ordinates you specify should draw the rectangle positionned at the top left of this and 10 pix smaller than the control's size - i.i the top left corner of the rectangle will be at the same point as the top left corner of the control's client area, with it's bottom right corner 10 pix in from this's botoom right corner...
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
my panel still has alot controls and i want this rectangle draw above these controls,and i have just done it buy set the BackColor=Color.Transparency;
but while my panel display images capture by webcam, this doesn't qork anymore?
Sorry about my bad English!
thanks for your help!
|
|
|
|
|
Hi there,
i try this in my code but some problem in the updated stmt can u help me shoot wht the problem is the compiler thro me error: The name Var1 does not exist in the class or namespace of the project....
here is the codesnippet:
string strsql;
DataTable dt;
SqlDataAdapter da;
SqlConnection objConn = new SqlConnection("data source=yusuff;user id=sa;password=sa;initial catalog=Heritage");
dt = new DataTable();
strsql = "select * from Articles_production";
da = new SqlDataAdapter(strsql,objConn);
da.Fill(dt);
if(dt.Rows.Count > 0)
{
//foreach (DataRow dr in dt.Rows) //ervy loop
for (int i=0;i
|
|
|
|
|
If your code looks the way that it is posted. the for loop is incomplete.
|
|
|
|
|
no i posted my codesnippet as
For (int i=0;i
|
|
|
|
|
ur text box is truncate the code...pls check the code project page
regards
ybasha
|
|
|
|
|
ybasha wrote: 'where identifier='" + Id +"'";
Unless your unique ID is a string, you need to remove the quotes.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Since you didn't cut an paste the real code (as evidinced by the incomplete for statement) it is possible that the error message is correct: Var1 doesn't exist in the posted code. its var1... C# is after all case sensitive...
This would be better done as a parameterized query anyway. Parameters have fewer issues with text characters (don't mind unescaped single quotes for instance) and so are less likely to give strange errors than dynamically built SQL.
I notice that two or more of your replacements are replaceing unicode characters with double quotes, which likely totally corrupt the concatenated query sting (causing it to appear to terminate early). Using parameters would avoid that issue as well.
Christian's observation is also likely a problem, and is another that would be avoided by using parameters.
Building up SQL statements by concatenating stuff like this is bad practice for a number of reasons (increased garbage generation from all the string reallocations, vulnerability to SQL injection attack, etc).
[edit] On top of all that, all the string variables (var1, var2, etc) are declared inside the scope of the for loop, and so do not exist outside of it (where your sql sting is declared and concatenated)...move the declarations to before the for loop, and this might have a chance [edit]
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
-- modified at 0:00 Wednesday 26th October, 2005
|
|
|
|
|
It looks like Var1 is outside the scope of the loop.
|
|
|
|
|
did you spell the variables correctly (i.e Var1 != var1)?
|
|
|
|
|
Not really related to your question, but I hope you are aware that you can convert between code pages/encodings in a few lines (this looks like UTF-8 read as for example cp1252).
If it is indeed the case do something like this:
byte[] bytes = System.Text.Encoding.GetEncoding(1252).GetBytes(sourceString);
string result = System.Text.Encoding.UTF8.GetString(bytes);
|
|
|
|
|
I need help to write a program that includes two functions named calc_avg() and varience(). The calc_avg() function should calculate and return the average of the values stored in a static array called testvals. The array should be declared in main() and include that values 89, 95, 72, 83, 99, 54, 86, 75, 92, 73, 79, 75, 82, and 73. The varience is obtained by subtracting the average from each value in testvals, squaring the values obtained, adding them, and dividing by the number of elements in testvals. The values returned from calc_avg() and varience() should be displayed in main()???
|
|
|
|
|
No - we won't do your homework. You need to try to do it yourself. This problem is kind of trivial - have you been paying attention in class ?
If you get stuck, you can ask *specific* questions. Posting your homework question without trying to do it yourself is not what this forum is for.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
This sounds like homework? If so, shouldn't you be able to do this by yourself if you paid attention in class?
You say that you need help to write the program. What kind of help?
---
b { font-weight: normal; }
|
|
|
|
|
This is the part i'm stuck on, i don't understand the coding for this last part, the rest i have done, it's the end that's stalling me, i do pay attention in class but people do get stuck sometimes
thanks,
....The varience is obtained by subtracting the average from each value in testvals, squaring the values obtained, adding them, and dividing by the number of elements in testvals. The values returned from calc_avg() and varience() should be displayed in main()???
|
|
|
|
|
Right, what part are you getting stuck at? Have you squared, added, and divided the values? Are you having trouble writing the values to stdout? What's the problem?
Picture a huge catholic cathedral. In it there's many people, including a gregorian monk choir. You know, those who sing beautifully. Then they start singing, in latin, as they always do: "Ad hominem..."
-Jörgen Sigvardsson
|
|
|
|