|

<br />
void CFileChangeEvent::stopProcessThread()<br />
{<br />
TRACE( "> > > > CFileChangeEvent::stopProcessThread() entered - Event handles < %X, %X >, Event ID < %s >\n",<br />
m_hProcessStopEvent, m_hProcessRespEvent, getIdentifier() );<br />
<br />
::SetEvent( m_hProcessStopEvent );<br />
}<br />
<br />
UINT CFileChangeEvent::workerThread( LPVOID lpParam )<br />
{<br />
CFileChangeEvent* pEvent = (CFileChangeEvent*)lpParam;<br />
HANDLE hProcessStopEvent = pEvent->getProcessStopEvent();<br />
<br />
for( ; iterFile != vecFifFiles.end() && ! bCancelled;<br />
iterFile++ )<br />
{<br />
Do some work here<br />
<br />
<br />
DWORD dwWaitStatus = ::WaitForSingleObject( hProcessStopEvent, 1 ); <br />
if ( dwWaitStatus == WAIT_FAILED )<br />
{<br />
TRACE( "> > > > CFileChangeEvent::workerThread() - ::WaitForSingleObject() failed - Event handle < %X >\n",<br />
hProcessStopEvent );<br />
bCancelled = true;<br />
}<br />
else if ( dwWaitStatus == WAIT_OBJECT_0 )<br />
bCancelled = true;<br />
}<br />
}<br />
Thanks for your help.
|
|
|
|
|
RoyceF,
You seem to be in the wrong forum.
Regards,
Gareth.
|
|
|
|
|
Sorry, I thought I was in the C++/MFC forum.
|
|
|
|
|
I am wondering if the WaitForSingleObject() doesn't work if the event gets set before WaitForSingleObject() is called. It seems that it would just return the correct status of the event object.
|
|
|
|
|
I have re-posted this in the C++/MFC forum. I would move it if I could. Thanks.
|
|
|
|
|
Hi everyone,
I've been working on a windows mobile application that consists of a series of dynamically generated user forms and I was wondering if anyone knows how (following activation of the On-Screen Keyboard) I would get the currently selected form item to move up so it is above the OSK. Currently when the OSK is activated it obscures the active items and worse still completely obscures items at the bottom of the form. Its gotta be possible but I'm really stuck on how I would actually do it.
I'm pretty new to C# (<6mo) and especially to programming for mobile devices. Any help would be greatly appreciated. Hopefully the solution isn't staring me in the face
Cheers,
Drew
|
|
|
|
|
Drew,
You may try setting the Top property of the selected control to a value above the keyboard showing.
For example, in the code below, I am changing the top property of the checkbox which gets hidden when the input panel is enabled:
private void button1_Click(object sender, EventArgs e)
{
this.inputPanel1.Enabled = true;
}
private void inputPanel1_EnabledChanged(object sender, EventArgs e)
{
if (inputPanel1.Enabled == true)
{
checkBox1.Top = inputPanel1.Bounds.Top - 50;
}
}
Regards,
Dave
Dave Traister
Software Engineer
ComponentOne LLC
www.ComponentOne.com
|
|
|
|
|
Hi
i want to Export/Import XML into Hastable using C# application
Thanks
sri
|
|
|
|
|
Member 4008492,
Thats nice. Good luck with that.
Regards,
Gareth.
|
|
|
|
|
What have you tried so far? We can't help without knowing what the exact problem is.
If you do a little research but don't understand, then ask about the part you don't understand. If you've written code that doesn't work right, and you don't know why (or you know why, but don't know how to fix it) then ask us for help.
There's not much good in making a statement of what you want to do, and then expecting to be given the code.
Here[^] is a simple article on using a hashtable.
And this[^] seems to show how you can read an XML file and get data on each of the nodes.
If you still need help, then feel free to ask. But don't expect other people to do all the work for you.
My current favourite word is: Bacon!
-SK Genius
|
|
|
|
|
Hello everyone,
I can not find too much materials about yield return. In MSDN sample,
http://msdn.microsoft.com/en-us/library/9k7k7cf0(VS.80).aspx
what happens behind the scene of statement, "yield return result"?
I think what happens is a object instance which implements IEnumerable (collection pattern) interface is created (but what is the type of the instance? some C# internal type?), and each time "yield return result" is called, a new element is inserted into the internal array of the instance. Any more reference documents?
thanks in advance,
George
|
|
|
|
|
Have you compiled the example code and stepped through it?
led mike
|
|
|
|
|
Sure, led mike.
Code will execute between Power method and foreach statement. But no code is shown what happens behind the scene?
regards,
George
|
|
|
|
|
.NET Reflector is your friend again.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
|
I got interested in this and investigated, and wrote a massive reply about what was happening in the IL, all commented and everything, then it didn't post properly and I lost it.
Basically, it compiles it to a private that inherits from IEnumerator inside your class. It moves your code into the MoveNext routine of the private class, and splits it up with a case statement so each time MoveNext is called, it does the next bit of your routine up to the next yield return statement, and then sets the Current property of the private to be your yield return value. This means when you stick your class in a foreach loop, the foreach loop calls GetEnumerator, which returns the private class, and then calls MoveNext and keeps looking at the Current property.
Just write a simple class that implements IEnumerable, and a GetEnumerator() method, compile it, and take a look with reflector, you'll see what I'm babbling on about.
Simon
|
|
|
|
|
Cool, Simon. I have studied the code into the reflector, since I am a beginner for the reflector, I have a basic question, the code below means,
there is an internal variable whose name is <>1__state and type is int?
there is an internal variable whose name is <counter>5__1 and type is int?
private int <>1__state;
public int <counter>5__1;
regards,
George
|
|
|
|
|
Yes, that's right. That's what I was talking about. The variables named with < and > signs in them. They're named like that to ensure no clashes can occur with your variables because those characters aren't allowed to be used in variable names in c#
Simon
|
|
|
|
|
Great Simon!
I have also made some study from sample expansion of code from C# specification, at top of this page,
http://msdn.microsoft.com/en-us/vcsharp/aa336809.aspx[^]
especially 10.14.6 implementation examples.
My current confusion is, I think the yield return grammar is of too flexibility, any ideas in what situation should we use it (in the implementation samples, it is used in for loop, while loop and foreach loop, too flexibility to grasp)?
regards,
George
|
|
|
|
|
Has anyone had any experience with this technology?
I'm trying get some examples in C#.NET 2.0 but my attempts have been futile. The SDK provided by the developer only seems to let you download examples if you have .NET 1.0 installed.
Does anyone know of any good C#.NET 2.0 examples floating around?
modified on Thursday, May 1, 2008 9:38 AM
|
|
|
|
|
Hello everyone,
In the section "Finalization and Performance" of MSDN document,
http://msdn.microsoft.com/en-us/library/ms973837.aspx
What means "Older objects needing finalization might have to wait for dozens if not hundreds of gen0 collections before their space is reclaimed."? I am especially confused about what means "wait for dozens" and "if not...", seems there are some dependencies between gen2 collection and gen0 collection?
thanks in advance,
George
|
|
|
|
|
No, what happens is, there are three generations of objects. Briefly
Objects get created. They exist in gen0.
When gen0 is collected ( quickly ), they move to gen1 if they are still being held.
After time, if they still exist, they go to gen2.
For efficiency, gen2 items are collected far less often than gen0, So, if something stayed around for a while, it will take longer to be collected.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks Christian,
I understand your points, but what means "if not hundreds of gen0 collections before their space is reclaimed"?
regards,
George
|
|
|
|
|
Because those hundreds of gen0 collectiosn occur before the next gen2 collection
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks Christian,
1.
You mean in GC, if gen2 collection is decided to run, then gen2 collection has to wait for gen1 collection complete, and gen1 has to wait for gen0 collection complete?
2.
GC could only decide to run gen0 only, or gen1 + gen0, right?
regards,
George
|
|
|
|