|
It doesn't work that way. In most cases, you cannot simply slap a .NET controls over a window's handle and treat that handle like a control. Not every control has an unmanaged control sitting behind it.
|
|
|
|
|
First of all Thanks very much for your reply..
and about the scenario.....
Hmmm .. that i know.. in my scenario i am having the handle to the dropdown area (control) of a combobox.
so i want to know whether we can assign/create a list control from this handle. so that i can treat it is a list control and add a control in it or do whatever accoding to the project requirement
|
|
|
|
|
I am having a hard time understanding how default system fonts are obtained in .NET. Specifically, I need to internationalize an app, and I need to be able to specify the font for various controls. What I want is something like the the old GDI call GetStockObject to return GUI font, system font, fixed width font etc. Can someone point me in the right direction?
|
|
|
|
|
Hi
I have some processing in a thread and want to fire some events into the GUI-thread. Kind of like BackgroundWorker.ReportProgress except that I will not be using the BackgroundWorker, but my own thread .
Anyone got any idea how to add some execution to the GUI-thread's event queue?
|
|
|
|
|
Sure, any Control that got created by the GUI thread (thats almost any Control!)
will let you execute stuff on that thread by calling myControl.Invoke
(or BeginInvoke).
Thats how one is supposed to let other threads manipulate said Control in the
first place.
|
|
|
|
|
But what if I dont have any Control to invoke it on? I am making a small library for my own projects, and I want to seperate the processing from the GUI. The processing does not know what components exists and just fire events (that are suppose to happen on the GUI-thread) without knowing what will happen next.
|
|
|
|
|
Aha, I see two possible ways to solve that:
1.
the official way: if your library is independent of the GUI, then it should
not be interested in the GUI thread either. If it needs something done by the app
it should use delegates/events to get the app's attention so it can process
the event. If (part of) the app's reaction needs to run on the GUI thread, then
that's the app's responsibility, so it must organize the InvokeRequired/Invoke stuff.
2.
a hack: create a GUI Control in your app, and pass it on to your library
(maybe thru a Property, possibly a static one). Now your library can use
Invoke itself. You should describe this behavior in your library's documentation
though, since now, even when called from a background thread, the library can load
the GUI thread and harm the resposiveness of the app that uses the library.
|
|
|
|
|
How about the ComponentModel?
I just looked into the Mono sourcecode for BackgroundWorker, and they heavily use the ComponentModel with AsyncOperation.Post and BeginInvoke()
Allthough I am not quite sure how it works, it looks like it could solve my problems.
|
|
|
|
|
I am not familiar with AsyncOperation class; looks promising tho.
BTW: this article[^] just popped up on the home page; it may interest you.
|
|
|
|
|
That was JUST what I was looking for. Cheers!!
|
|
|
|
|
Glad I (or rather CodeProject) could help...
|
|
|
|
|
Hi,
I've been using .NET 2.0 for almost 2 years now. I want to have a look at 3.5, is it worth while looking at it now? Beta 1 is out, does any one know when the Beta 2 will be out?
I want to get started on .NET 3.5, but I heard rumours that Beta 1 is full of errors.
Regards
ma se
|
|
|
|
|
First off, I would say decide which version you want to start learning, either v3.0 or v3.5.
The .NET Framework v3.0 is out now while v3.5 won't be released until the end of this year (or possibly the beginning of next year). That being said, both v3.0 and v3.5 have the v2.0 runtime (CLR) at their core. The differences are in the extra "bits" that have been added.
The .NET Framework v3.0 added WPF, WCF, WF, and CardSpace to the v2.0 Framework while v3.5 adds LINQ and some other bits to the v3.0 Framework.
By learning what is available in v3.5 of the Framework, you will also be learning what is in v3.0 of the Framework.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
Hi,
I've been using .NET 2.0 for almost 2 years now. I want to have a look at 3.0. If any one knows any good tutorials for dummy's in .NET 3.0, please let me know.
Regards
ma se
|
|
|
|
|
First off, I would say decide which version you want to start learning, either v3.0 or v3.5.
The .NET Framework v3.0 is out now while v3.5 won't be released until the end of this year (or possibly the beginning of next year). That being said, both v3.0 and v3.5 have the v2.0 runtime (CLR) at their core. The differences are in the extra "bits" that have been added.
The .NET Framework v3.0 added WPF, WCF, WF, and CardSpace to the v2.0 Framework while v3.5 adds LINQ and some other bits to the v3.0 Framework.
By learning what is available in v3.5 of the Framework, you will also be learning what is in v3.0 of the Framework.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
Well, 3.0 is big - WPF, WCF, WF and CardSpace. It's probably worth just picking one of the components initially and spending some time on that. For example, for now I'm tackling WF and I've looked a little at WCF. But I've yet to look at WPF or CradSpace. But I'd say WPF and WCF have more of the mindshare at the moment, in terms of what businesses are looking at. Though only a handful of got that far yet.
If you wish to look at WF, this is a good reference:
http://msdn2.microsoft.com/en-us/netframework/aa663322.aspx
I've looked at the first two articles there and built and run the application for the first.
The MSDN nuggets on WF are worth perusing.
MSDN WF Nuggets[^]
However, note that they're listed in reverse chronological order. You should start from p6.
Finally, the book Pro WF[^] by Bruce Bukovics is very accessible with lots of runnable sample apps.
Kevin
|
|
|
|
|
Thanks I will look at that. Thanks again for answering.
Regards
|
|
|
|
|
Hi,
I would like too know, from where i will be able to download the Interop.MSXML2.dll. i have to refer that in my project. i have tried the following link, http://download.microsoft.com/download/7/a/7/7a72ca2e-39cc-4600-ab36-bf3fea876a65/msxml3.msi[^]
but after installing that msi i didn't find the required dll in my machine.
pls guide me,
Thanks in advance
sebastian
|
|
|
|
|
|
I have a panel in design time.I am adding textbox into the panel at run time,first textbox added automatically.when focus left from first textbox,then a new textbox added to the panel.i have changed the autoscroll property to true,but when scrollbar cames at that time the textboxes are taking places automatically.
|
|
|
|
|
Dillipb wrote: but when scrollbar cames at that time the textboxes are taking places automatically
Not very clear with this. Better post your code
|
|
|
|
|
|
Is there a way to determine whether or not a network connection is active?
Basically i have a windows service, and i need it to fire an event whenever a packet is received or sent...(aka when the network is active?) anyone have any ideas?
xblindsidex@optonline.net
|
|
|
|
|
There is not event for this. You'll need to write your own component using a packet capture library and create and fire this event yourself.
But, you have another problem. You can't fire an event on every packet and expect some piece of code to be able to handle it. Packets can be transfered at a rate faster than your other process can process the events.
What did you plan on doing with this?
|
|
|
|
|
Well i figured out how to do it sort of...Usign a byte count, when the byte count goes up, i know there has been some net activity.
Thanks for the reply,
my next problem is that I cannot find a way to determine what URL's a person has browsed to...is there anyway to do this?
I am trying to create a logger that will log the internet activity usage of a computer...anybody have any ideas?
|
|
|
|