|
is there some way to get notified when a form/window /whatever gets "idle"
here is the scenario:
i have a datasouce which will raise events as soon as something changes in it.
i want to do some extra processing on the data once the datasource is fully filled.
when i fill my datasource , the datasource will raise events a couple of times untill it is filled.
so i cant do the processing when the events fire, since that would make it process unfinished data.
so what i would like to know if it is possible to get notified once the current thread/form/whatever is not doing any more work??
//Roger
|
|
|
|
|
See the Application.Idle event.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hello,
I know using try-catch means a performance drop.
I wana know in which part or parts the drop actually happens, does it occurs only when catching an exception or even "trying" a block of code means a drop in comparisson to the same code not inside try block in situation that no exception occurs?
Thanks,
---
"Art happens when you least expect it."
|
|
|
|
|
it will only cost you once the error occurs
|
|
|
|
|
nt
---
"Art happens when you least expect it."
|
|
|
|
|
Exceptions are expensive inside intensive repeatitive operations. Avoid them at all costs!
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
didnt i understand somewhere that foreach get implemented as a block which ends in an exception?
________________________________________
Gosh, it would be awful pleas'n, to reason out the reason, for things I can't explain.
Then perhaps I'd deserve ya, and be even worthy of ya..
if I only had a brain!
|
|
|
|
|
TuringTest1 wrote:
didnt i understand somewhere that foreach get implemented as a block which ends in an exception?
sure there is a catch block, but only as a last resort!
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
Hi everyone,
Is there a simple and straightforward way to detect / enumerate all computers on a LAN? (I'm trying to create a very simple WOL app.)
Any references where to start? I've been looking some sample but all I could find was C++ or Java code which I'm unfamiliar with.
Thanks in advance,
Rado
Radoslav Bielik
http://www.neomyz.com/poll [^] - Get your own web poll
|
|
|
|
|
|
Thanks for the tip. As I have never worked with active directory I'd like to ask if it is possible to query the computers on a LAN without using active directory, or is the active directory part of every windows-based LAN? I have tried to run the demo but it throws a COM exception at startup
Rado
Radoslav Bielik
http://www.neomyz.com/poll [^] - Get your own web poll
|
|
|
|
|
Radoslav Bielik wrote:
or is the active directory part of every windows-based LAN?
No
That only works for Active Directory.
Mazy
No sig. available now.
|
|
|
|
|
|
If you want to create a game or comsething try to send a multicast message.
There is a tutorial in Here. Simply type multicast and you will get it.
|
|
|
|
|
I asked this question a while back, and the answer I got was to use P\Invoke and NetServerEnum function.
Here's a snippet of the code I used.
[StructLayout(LayoutKind.Sequential)]
internal class ServerInfo
{
public int platformid;
[MarshalAs(UnmanagedType.LPWStr)]
public string name;
public int majorver,minorver;
public int type;
[MarshalAs(UnmanagedType.LPWStr)]
public string comment;
}
class Class1
{
[STAThread]
static void Main(string[] args)
{
ArrayList arr = GetMachine();
foreach (ServerInfo si in arr)
{
Console.WriteLine("{0} , {1}, {2}, {3}, {4}, {5}",si.name,si.comment,si.platformid,si.majorver,si.minorver,si.type);
}
[DllImport("Netapi32.dll")]
private static extern int NetServerEnum(string servername, int level, out IntPtr buffer, int maxlen,
out int entriesread, out int totalentries, uint servertype, string domain, int resumehandle);
[DllImport("Netapi32.dll")]
private static extern int NetApiBufferFree(IntPtr ptr);
private static ArrayList GetMachine()
{
int eread,etot;
IntPtr buffer;
int l = 200;
int size = Marshal.SizeOf(typeof(ServerInfo));
int res = NetServerEnum(null,101,out buffer,-1,out eread, out etot,3,null,0);
IntPtr p = buffer;
ArrayList arr = new ArrayList(etot);
for (int i = 0; i < eread; i++)
{
ServerInfo si = Marshal.PtrToStructure(p,typeof(ServerInfo)) as ServerInfo;
arr.Add(si);
p = (IntPtr)((int)p + size);
}
res = NetApiBufferFree(buffer);
return arr;
}
}
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
Support Bone
It's a weird Life
|
|
|
|
|
Hey Nick - thanks a lot for your code snippet, it works flawlessly! You have saved me a lot of time One more question - do you have any idea how can I get the IP address and physical address of the listed network cards?
Thanks again!
Rado
Radoslav Bielik
http://www.neomyz.com/poll [^] - Get your own web poll
|
|
|
|
|
No problem.
Unfortunately, I can't help you with the second part.
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
Support Bone
It's a weird Life
|
|
|
|
|
|
Works well all the time with only one active lan connection. With more then one screws up. (Like if there is the high speed connection.). Is there a way to choose what connection you want to use.
|
|
|
|
|
I don't know as I'm not much into Win API Perhaps you should ask Nick.
I just played with the code a little and will get back to it later as I've got a lot of work at the moment and this is for my personal use anyway.
rado
Radoslav Bielik
http://www.neomyz.com/poll [^] - Get your own web poll
|
|
|
|
|
How can I specify that a particular subroutine/thread should be executed by a particular processor for a process running on a multiprocessor system?
norm
|
|
|
|
|
ProcessThread.ProcessorAffinity
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
|
Hi, does anyone know how to add a reference (.dll) to a c# project without using the easy way, namely witout right clicking on reference and searching for the .dll, but just by righting code?
I've searched for a "referenceAdded Event" example on internet but I didn't find one...
Thanks for answers!
|
|
|
|
|
Ermm... load the assembly at runtime?
Dim x As Reflection.Assembly = System.Reflection.Assembly.LoadFile("path")
You could use this for plug-ins ...
greetz
*Niels Penneman*
Software/Dev Site Personal Site
|
|
|
|