|
Its nothing to do with the list being "protected" from change - it is due to the nature of Rectangle. It is a value type, which means you effectively operate on a copy of it when calling Offset after it is unboxed from the ArrayList.
try this as your move method:
public void Move(int x, int y)
{
for(int i=0;i<this.rects.Count;i++)
{
Rectangle rect = (Rectangle)this.rects[i];
rect.Offset(x,y);
this.rects[i] = rect;
}
}
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
Hi to everyone,
I am writing a c# program that uses a native c++ dll. In the c++ dll I have a function which allocates space for a char array and returns it as follows:
char * my_func(size)<br />
{<br />
char * pOut = new char[size];<br />
...<br />
...<br />
return pOut;<br />
}
In C# part I wrapped the function as follows:
<br />
[DllImport("my_dll.dll", EntryPoint="my_func")]<br />
public static extern IntPtr my_func(int size);<br />
I am using the function in my code as follows:
<br />
IntPtr pData = my_func(nSize);<br />
byte[] arrByte = new byte[nSize];<br />
Marshal.Copy(pData, arrByte, 0, nSize);<br />
...<br />
The problem is how can I free the memory allocated in the native c++ dll by the new operator.
Thanks
|
|
|
|
|
i got this exception while calling Timer.Start()
Number must be either non-negative or -1.
Parameter name: dueTime
can any one tell me the reason.
timer interval is set to 180000.
Regards
Shajeel
|
|
|
|
|
Hi
Are the optional parameters are allowed in C#. If yes how they r implemented?
|
|
|
|
|
johnprakasht wrote: Are the optional parameters are allowed in C#.
Yes.
johnprakasht wrote: If yes how they r implemented?
It's a trick of the compiler.
Any other question?
I thought you might ask how to declare them!
with the param keyword.
As in
Console.WriteLine(string format, params object[] arguments);
|
|
|
|
|
If you mean optional parameters like those in VB.Net: No you won't find this in C#. Generally just make overloads of a function with different parameter combinations.
|
|
|
|
|
Optional parameteres not allowed same as VB.net here.
way of implementation is that you must create oveloaded methods as below:
public GetTest(string str1)
{
....
}
public GetTest(string str1,string str2)
{
....
}
|
|
|
|
|
Hi Friends,
Can anyone tell me how to embed images in email.
I need to put some images in the email.(inline images not attachments)
Thanks,
Sushant Duggal.
|
|
|
|
|
|
Ketan Majumdar wrote: http://www.devmail.net/help/devmail.samples.sending.embedding.html[^]
Hi,
This code uses the dll compiled and developed by devmail.com, the complete code is not available.
thanks
Sushant Duggal.
|
|
|
|
|
|
Ketan Majumdar wrote: Finally stumbled upon the way to create email messages with embedded images in ASP.NET 2.0. (Note that this doesn't work for ASP.NET 1.1, sorry to say.)
^) it deosnot work with framework 1.1
thans once again
Sushant Duggal.
|
|
|
|
|
is .net framework necessary to run a c#.net app.
if have another way, plz help me.
|
|
|
|
|
You MUST read your previous "SAME" question.
The answer is NO.
That is the concept of C#.
If you don't want to use .NET Framework, then write your code
using old C++.
|
|
|
|
|
but i am not familiar with c++. plz can u give me any tutorial for me.thanks.
|
|
|
|
|
But sorry, I cannot tell you how to write a C++ code. Just find some books about that.
|
|
|
|
|
|
lols....
Sushant Duggal.
|
|
|
|
|
but i dont get any desired way. i want to run c#.net app without any framework. cause my client does not want to download any additional package.thanks.
|
|
|
|
|
but i dont get any desired way. i want to run c#.net app without any framework. cause my client does not want to download any additional package.thanks.
|
|
|
|
|
|
I'm wondering why Bill didn't implement document.selection for WebBrowser control in C# as it's the case for JavaScripts (http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/obj_selection.asp).
How can I get the selected text of a WebBrowser now?
|
|
|
|
|
how can i create Barcodes in C# ?
|
|
|
|
|
Search in Codeproject. There are a lot of articles about that. Use keyword "create barcode"
|
|
|
|
|