|
Isn't goto supported in switch statements only?
switch (something)
{
case A:
goto B;
case B:
break;
}
Sometimes this is very useful.
-^-^-^-^-^-
no risk no funk
|
|
|
|
|
Hi,
I have some struct that one of the fields of it is some ArrayList.
I also have some function in my project that one of the parameters that need to get is ArrayList.
Now ... in starting of my program - the ArrayList is null and in this function i do "new ArrayList" in case this ArrayList is null.
But (!!!) when i getting into this function i see that the allocate of the new ArrayList is OK and i adding new object into this ArrayList - but in out of this function i see that this ArrayList is null (!!!) of course and all the object that i add to it are missing.
How can it be ? as far as i know the parameters in this case are always delivered by reference.
What to do to solve this problem ?
Thanks for any help.
|
|
|
|
|
the argumnent name you receive int your method is just like another pointer to your reference so when you associate a new object to it you will lose the old reference object
for doing this you must use out or ref before it (simply out).
<br />
<br />
ArrayList arr = null;<br />
NewArr(out arr);<br />
}<br />
<br />
static void NewArr(out ArrayList arr)<br />
{<br />
arr = new ArrayList();<br />
}<br />
Good Luck
|
|
|
|
|
Yanshof wrote: as far as i know the parameters in this case are always delivered by reference
No, by default parameters are passed by value, as in C;
you can force them to be passed by reference by adding a "ref" or "out" keyword
(or an ampersand in C)
if you pass a value type, nothing more is to be said.
if you pass a reference type, the "value" is the reference, so the callee can use it,
change what it is refering to, but can not change the reference itself as seen by the
caller; if passing a reference type with "ref"/"out" keyword, then the callee can change
the reference itself as seen by the caller.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/AllLanguages/General
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hi there,
Here i am stucked with a problem regarding windows application
can any one plz help me on finding that, is it possible to detect a default palyer set on the local system.
I want to detect the default player set on teh local system where application is running.
Thanks in advance
Hello Forum
Always be in touch to help about the topic ASP.NET
|
|
|
|
|
sulabh2020 wrote: default palyer
I assume you meant "player", which begs the question: player of what?
/ravi
|
|
|
|
|
I am talking about anyu media player(like winamp, juke box etc..) including Windows medis player.
Hello Forum
Always be in touch to help about the topic ASP.NET
|
|
|
|
|
can i increase the array a runtime,like in vb,redim keyword do, is it possible in c#,
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
|
sir in 2.0?
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
Sonia Gupta wrote: sir in 2.0?
You just do yourself what the Resize method does; create a new array and copy the values to it.
---
single minded; short sighted; long gone;
|
|
|
|
|
ok thanks
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
It's actually in .NET 2 and beyond, so it's available now.
David Anton
http://www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
C++ to C# Converter: converts C++ to C#
C++ to VB Converter: converts C++ to VB
Instant C++: converts C# to C++/CLI and VB to C++/CLI
|
|
|
|
|
You can't resize an array in .NET.
Create a new array and copy the items to it.
(That's what the ReDim command does in VB.NET.)
---
single minded; short sighted; long gone;
|
|
|
|
|
ok thanks
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
hi i want to read the pen drive autorun file and want to add my own file there at startup.
Secondly from where can i get information about what happens when any drive is double-clicked.
thanx in advance
|
|
|
|
|
Hey ya'll
Has anyone ran across this error in VS2005? WTF?
"The designer loader did not provide a root component but has not indicated why."
As a general rule doesn't display this message the designer just doesn't display anything so I have to reload it after every change?
Thanks,
Mike
Life is not measured by the number of breaths we take, but by the
moments that take our breath away. "George Carlin"
|
|
|
|
|
I get the following error when trying to reference my .exe project:
Error 3 The type or namespace name 'FormAAACS' could not be found (are you missing a using directive or an assembly reference?) C:\BBB.cs 45 9 CCCLib
There is already a reference to the Library but when I try to pass information from my Library to my .exe project the compiler doesn't recognize the "using BBB(namespace)" for the .exe project.
I appreciate any help, thanks in advance.
Michael
|
|
|
|
|
an EXE or DLL project can refer to another DLL project by:
- adding a reference in the Solution pane
- and adding a using statement, mentioning the required namespace
AFAIK an EXE or DLL project can not refer to another EXE project.
If that does not help, watch the file name and line number of the error message.
And make Visual display line numbers !!!
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/AllLanguages/General
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
The problem is that I have a dll which is a member of the same solution as the exe project, but the dll does not recognize the exe, yet the exe recognizes the dll.
|
|
|
|
|
Ok, I got a piece of code and I can't seem to compile it... I don't quite know how to ask the question so here goes. I have the following code:
public interface X : _Collection
{
[DispId(0)]
Y this[object ]
{
get;
set;
}
}
Where Y is another interface.
I get an 'Identifier expected' message when I compile. Can anyone explain this code and a possible solution?
Thanks!
|
|
|
|
|
You have forgotten to give the argument in the indexer a name.
Y this[object index]
---
single minded; short sighted; long gone;
|
|
|
|
|
Hello friends,
I’m trying to elaborate one program capable of create one image based on RGB data.
In this case, I receive RGB values one by one (i.e. serial) … for example,
for (int posX = 0; posX < 200; posX++)
{
______for (int posY = 0; posY < 200; posY++)
______{
____________color = Color.FromArgb(r, g, b);
____________bitmap.SetPixel(posX, posY, color);
______}
}
Where bitmap is 200x200 image and r, g and b contains the RGB values received in serial. But this is too slow ...
So I ask if there is anyone that have a better way to do this ... for instance, if there is any class that build three arrays (R, G and B) and define them as one image, instead of building the image pixel by pixel.
Thank you so much for your attention ... best regards,
Iuri Figueiredo :->
|
|
|
|
|
Hi,
are you receiving the pixel values over a serial line ?
if so 200 * 200 * 3 = 120KB assuming 8-bit per color component.
At say 9600 Bd (=1000 B/s) this will take 2 minutes to transfer.
If your data source is much faster than that, the lack of speed
would be caused by the SetPixel method itself; there is a faster
approach using unsafe code and pointers.
There are some fine articles on this, search for "image" and
author "Christian Graus".
But first tackle your image source sitation !
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/AllLanguages/General
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Well, to be honest, the data will arrive from one CMOS camera with JPEG encoder:
http://www.sparkfun.com/commerce/product_info.php?products_id=7906
I don’t have this working for know (because I’m waiting for this component), but I was figuring out how I would receive the data. They say that:
“The Parallel Video Interface (PVI) generates the video output of the TC5747. The interface consists of a vertical frame-start signal and a 10-bit parallel data bus with clock and qualify signals. It supports parallel and serial modes of operation. The PVI produces a clock signal (the CLK_OUT pin), a 10-bit data bus, DOUT[9 ] and qualifying signals that are synchronous to that clock. On each determining edge of CLK_OUT, a single data byte is transferred on the data bus, if qualified by the VALIDH signal. The DOUT[9 ] bus carries either the Bayer grid data, the YUV 4:2:2 output data, the RGB data (RGB565, RGB666 or RGB444) or JPEG code according to the TCIF_OUTPUT_FORMAT host command.”
So it seems that RGB data come at 10-bit parallel … however, I still don’t understand the difference between RGB data and JPEG data.
|
|
|
|