|
Cool, Daniel!
Let us see if other people has experience to share why emitting NOP will facilitate edit-and-continue feature?
regards,
George
|
|
|
|
|
Daniel is correct, I verified this with reflector:
static void Main(string[] args)
{
if(true)
{
Console.Write("hello");
{
{
{
}
}
}
}
}
got emitted as:
.method private hidebysig static void Main(string[] args) cil managed
{
.entrypoint
.maxstack 1
.locals init (
[0] bool CS$4$0000)
L_0000: nop
L_0001: ldc.i4.0
L_0002: stloc.0
L_0003: nop
L_0004: ldstr "hello"
L_0009: call void [mscorlib]System.Console::Write(string)
L_000e: nop
L_000f: nop
L_0010: nop
L_0011: nop
L_0012: nop
L_0013: nop
L_0014: nop
L_0015: nop
L_0016: ret
}
with one nop for each { and }
|
|
|
|
|
Cool, Roger!
But why NOP will facilitate edit-and-continue feature?
regards,
George
|
|
|
|
|
how can I read data from Video Capture Card
please help me
thanks .
en.mahdi
|
|
|
|
|
en.Mahdi wrote: please help me
Have you tried helping yourself yet?
google[^]
there's plenty of info there that'll help you . . .
|
|
|
|
|
|
Hi, I built an windows form application..
Now I copied the whole project folder into another location and I run it from there, it runs..
But when I make changes to the code or to the form design in this new location, it dosent do so and runs the old code..
Does it link to the older location??
How do I make this new code run from my new location without making changes to my old location or the old files??
|
|
|
|
|
Hi My Friend
In the Build menu select clean solution and then select clean "Your Project name" and after run your project and enjoy.
|
|
|
|
|
Reza Shojaee wrote: In the Build menu select clean solution and then select clean "Your Project name" and after run your project and enjoy.
Thanks for your answer...
But what does this "Clean Solution" mean??
|
|
|
|
|
I removes any intermediate files and rebuilds the whole solution from scratch.
So if you make changes and they don't get compiled (so the compiler is a little confused and has missed your changes) you have to tell it to rebuild everything.
My current favourite word is: Bacon!
-SK Genius
|
|
|
|
|
Hi ,
In my project i have some dll (which written in c).
i want to use in my c# app. most of the function i am able to call, but following list of func. i don't know how to handle. any help is appreciated.
int foo(void *Buffer,UInt32 BufferLength,byte** Image);
and other is callback from DLL TO C# APP. (I implemented, but after callback, application crash).
|
|
|
|
|
How about:
int foo(IntPtr Buffer, int BufferLength, ref IntPtr Image);
I don't know if that will work or not, but it looks alright.
My current favourite word is: Bacon!
-SK Genius
|
|
|
|
|
Hi,
in addition to the above, if you need to pass a pointer to a managed object,
use the GCHandle class to pin the object, get its handle, pass it on, and when
done free the handle.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Good Day,
I wish to have a Console Application in my WinApp. I want to use it as a sort of a "Debug Window".
Is there an easy way to do this?
Thanks!
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
goto project properties, select ouput type console application.
it will give gui+console. (which is very useful for debug).
|
|
|
|
|
Hi,
can any one guide me to How to Connect Ordacle DB via C#? Also, on the client macghine where I will deploy the final executable, do I require to provide separate oracle driver also? Or only using only the executable any client machine eill be able to connect?
Any pointers will be useful
Thanks,
Sankalp
|
|
|
|
|
Dude make a habbit of searching the answer on google before posting here
Go to www.google.co.in type there ' connect orcale c#.net' and you will find many .. links to your question ....
For a quick reference use ODBC data provider to connect to oracle database..
Regards
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
I have a windows form with some buttons and I am having problems setting focus on the buttons.
Basically an array of buttons gets passed in to the the form along with a default button as follows:
public void Show (Button defaultSelectedButton, Buttons[] btns)
{
foreach (Button btn in btns)
pnlButtons.Controls.Add (btn);
defaultSelectedButton.Focus();
}
however defaultSelectedButton.Focus(); does not seem to have any effect and the button with focus is always the first button that was added to pnlButtons.
Does anyone know how to apply focus to a particular button?
thanks
|
|
|
|
|
You might try first changing the foreach statement to just a for statement. Foreach statements have an odd way of going through the order of the buttons.
If that doesn't do anything, if the for loop you might try comparing a unique aspect of the defaultSelectedButton and a button in the btns array (I would use the Text property). If the unique aspects are the same then use focus.
If neither of those suggestions work, post back and I will try to find another alternative.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Why no use AddRange for adding the buttons, then you don't need a loop at all.
And of course, make sure that defaultSelectedButton is actually one of the buttons in the array, rather than a copy of.
I've just done a test and dynamically added a button to a form, then called myButton.Focus() and the newly added button does indeed get focus, so check up on the defaultSelectedButton, because it should be working.
My current favourite word is: Bacon!
-SK Genius
|
|
|
|
|
I just wanted to add that
- foreach loops the same way as you would probably yourself with a for loop (nothing strange about it, really) --> keep the foreach, because it is better readable
- Focus should work, to debug the problem, try to have a look at the ActiveControl property of your form or user control to see, which control has currently the focus and whether that control has a validate method that prevents setting of the focus to the button.
Urs
-^-^-^-^-^-^-^-
no risk no funk
|
|
|
|
|
Good Day,
Say I have a single dimension array as such:
int MyArray[] = {1,2,3,4,5,6,7,8,9,10};
And I want to randomly shuffle the contents of that array. I did a google search but the results were crappy.
Can anyone guide me on how to accomplish my this task?
Thanks!
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
apstring ShuffleAns(apstring ans1,apstring ans2,apstring ans3,apstring ans4)
{
apstring set[4]={"","","",""};
set[0]=ans1;
set[1]=ans2;
set[2]=ans3;
set[3]=ans4;
apstring rval[4]={"","","",""};
bool used[4];
for(int k=0;k<4;k++)
used[k]=false;
Random* rnd=new Random();
int icount=0,inum=0;
while(icount<4)
{
inum=rnd->Next(0,4);
if(used[inum]==false)
{
rval[icount]=set[inum];
used[inum]=true;
icount++;
}
}
apstring rvalr=rval[0];
rvalr+='~';
rvalr+=rval[1];
rvalr+='~';
rvalr+=rval[2];
rvalr+='~';
rvalr+=rval[3];
return rvalr;
}
This is some code that I reuse/translate for all of my projects. I took this particular piece of code from my who wants to be a millionaire program so this randomizes the answers. (This is in C++ by the way, but if you have problems understanding it just post back)
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Thank you Mr. Stockwell, I'll just convert this to C#.
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
I do it differently. Instead of shuffling the whole array (or collection), I randomly select one item from it at a time as needed.
|
|
|
|