|
I have a Windows.Form that handles events from an object that is executing on a different Thread. I use the following code (modified for posting) to handle events that use a custom EventArgs class:
Private Sub TheEventHandler(ByVal sender As Object, ByVal args As CustomEventArgs)
If Me.InvokeRequired Then
Me.BeginInvoke(New TheClass.CustomEventHandler(AddressOf TheEventHandler), New Object() {sender, args})
Else
...
End If
End Sub
This works fine. I use the following code (modified as well) for handling events that are defined using EventHandler and are passed EventArgs.Empty:
Private Sub TheEventHandler(ByVal sender As Object, ByVal args As EventArgs)
If Me.InvokeRequired Then
Me.BeginInvoke(New EventHandler(AddressOf TheEventHandler), New Object() {sender, args})
Else
...
End If
End Sub
When the code is executing on the non-GUI thread, the sender variable references the object executing on the other Thread (as it should since I fire the event passing Me as the source). However, after the "recursive" call to itself back on the GUI thread, the sender object references the Form that is handling the event. Why is the object being passed into BeginInvoke as the first item in the args array being replaced by the Form object? This doesn't happen in the case of non-EventHandler events (at least ones I created).
Any ideas?
I know I can get around it by just writing my own empty EventHandler delegate, but that seems silly...
|
|
|
|
|
I am using .NET Remoting to access a Class Library that I created in VB.NET.
This class library contains a reference to a COM + component that is used by
several functions. I am able to get the Remoting to work for most functions
but as soon as I try and call a function that is using the COM + component
the app freezes. I don't get any error messages, it just seems to hang. Is
there something I need to do in order to use a COM + component when
Remoting?
|
|
|
|
|
I am using .NET Remoting to access a Class Library that I created in VB.NET. This class library contains a reference to a COM + component that is used by several functions. I am able to get the Remoting to work for most functions but as soon as I try and call a function that is using the COM + component the app freezes. I don't get any error messages, it just seems to hang. Is there something I need to do in order to use a COM + component when Remoting?
|
|
|
|
|
|
I have a .NET service that creates multiple instances of the service from the same executable. According to the documentation I only require a single ServiceProcessInstaller class and a ServiceInstaller class for each instance of the server. This is true also for services that contain more than one service.
The problem I have is with using a user account to run the service. Setting the ServiceProcessInstaller.Account property to the user value and entering a password and login always yields an error during the installation process saying that the account/password combination is invalid.
Now the peculiar part - this only happens on NT4 boxes, Win2K and XP do not exhibit this problem. The number of instances of the service is controlled by a configuration file, setting the number of instances to 1 also causes the problem to go away.
I can find little or no information about this on either newsgroups or MS support pages. Can anyone else confirm this is actually more than a local problem that we have? Better still, does anyone know a solution to the problem?
Thanks,
Jason.
modified 10-Jul-19 21:02pm.
|
|
|
|
|
Hi all,
I have a windows application that uses remoting and is hosted in IIS. Its name is test.exe and the client config is called test.exe.config. They are both in the same virtual dir.
If I start it locally, the statement RemotingConfiguration.Configure("plato.exe.config"); executes fine and everything works.
However, if I start the application from its URL, i get a file not found exception: the config file could not be found.
The idea is: I start the application with its URL, the application should read the client config file that's on the server to get the remoting configuration out of it (instead of hardcoding it in the exe).
I searched but cannot find a solution for this. Anyone?
|
|
|
|
|
In a browser-based scenario, the HTML file must use the <link> element to explicitly point to the configuration file.
How low can you go ? (MS rant)
|
|
|
|
|
Thanks for the quick response. Could you give some details of how I should do that?
The html file looks simple:
Start Plato
In Plato.exe, there's a line with:
RemotingConfiguration.Configure("plato.exe.config");
and here it fails because config file is not found.
Thanks!
|
|
|
|
|
ref[^]
How low can you go ? (MS rant)
|
|
|
|
|
First, your "rel" attribute needs to have a value of "configuration", not just "config". Also, the default machine.config configurations don't allow any access to the "bin" subdirectory. Your application and it's associated .config file should be in a publicly-accessible directory.
Also, when you're dealing with Web-deployed apps such as we are (very, very big), make sure you run "gacutil /cdl" to clear the TAC (note: not GAC) from time to time, especially if you're not using automatically versioning in the AssemblyVersion attribute (we're not because of configuration headaches).
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
I just type in the URL to the executable, for example: http://dev/plato/bin/plato.exe, so I don't really need a html file...
So the problem remains: how can I make the following line:
RemotingConfiguration.Configure("plato.exe.config");
not throw a 'file not found' exception when i start the application via its URL?
|
|
|
|
|
How can i install the .net Framework SDK 1.1 successfully after i having installed the visual studio.net ? everytime i try to setup the SDK,it was interrupted with Message "Before you can install Tools or Samples,Microsoft.NET Framework1.1 must be installed...".What's the problem,can you help me?Thanks
|
|
|
|
|
The message is a bit confusing if you don't have the page still open for the SDK... In order to install the SDK for .NET 1.1 you need to first install the runtime for 1.1.
I don't have the links handy at the moment but you should be able to get the runtime from the same place you got the SDK link.
James
Sig code stolen from David Wulff
|
|
|
|
|
I got the SDK from MS site,but i can't find the RunTime you said,and my .net Framework is version 1.0.
|
|
|
|
|
|
How can i install the .net Framework SDK 1.1 successfully after i having installed the visual studio.net ? everytime i try to setup the SDK,it was interrupted with Message "Before you can install Tools or Samples,Microsoft.NET Framework1.1 must be installed...".What's the problem,can you help me?Thanks
|
|
|
|
|
I have a custom listview control that spawns a worker thread. This thread periodically updates the information in the list, in particular a time column. There are times when this control is not in view, or is completely disabled. When I call Thread.Suspend() on this worker thread, my cpu utilization topps out at 100% and stays there. I can't figure out why this is happening, and I'd like to avoid aborting the thread and restarting it every time the GUI hides this listview.
Has anyone encountered such a problem before, or does anyone know why calling Suspend on a thread causes cpu usage to go up to 100%? Thanks.
|
|
|
|
|
Hi,
I wrote a Collection Class(viz: MYCollection)
(Derived from Collection Base).
And have added methods for Add() and Remove().
I have used this Class in a Custom Control,
and exposed a Property of type MyCollection.
Now, the VS.Net IDE does show the Collection Editor
Dialog Box for the Property,but when I add items to the
collection using the Collection Editor, the changes
are not persisted. (ie: The IDE does not Generate code
for the Items added to the collection).
What is to be done to persist the Items Added using
the Collection Editor (ie: to make the VS.Net generate code for the Added Items, just like it does for ListView
Items Collection, for Example)
Someone please help me....
Thanks
|
|
|
|
|
If you look at the CollectionEditor class you will see you only need to implement the indexer (this[index]) in your derived class for this to work.
Cheers
"There are no stupid question's, just stupid people."
|
|
|
|
|
Hi there,
here is my problem: i need a certain class to be used in a webmethod an a client. In order to do so i made a little library called ChatLib containing the class ChatMsg. Both, webservice and client, have the line "using Chatlib;", but the proxy (which is generated by the Visual Studio) seems to do something different.
The Compiler tells me that he is not able to convert 'chatclient02.localhost.ChatMsg' to 'ChatLib.ChatMsg' (referring to a line in the windows form, where i want to start the webmethod).
(in german: "Implizite Konvertierung des Typs 'chatclient02.localhost.ChatMsg' zu 'ChatLib.ChatMsg' nicht möglich.")
exchanging the line "using Chatlib;" by "using chatclient02.localhost;" in the client makes the compiler happy but the program does not run properly which means that there are system exceptions thrown.
i would be grateful for every answer especially those, that support the usage of Visual Studio.NET
|
|
|
|
|
Can any explain about this..
Just think that you are running three seperate .NET applications, now how many instances of CLR will be in memory?.
Thanks
Best Regards
Venkatraman Kalyanam
Chennai - India
"Being Excellent is not a skill, it is an attitude"
|
|
|
|
|
Using a reverse lookup tool, I could see that with 2 .NET apps loaded, I had 2 instances of mscoree.dll loaded, and the same for mscorlib.dll.
(mscoree.dll is the bootstrap PE for .NET apps)
(mscorlib.dll is the main portion of the CLR)
How low can you go ? (MS rant)
|
|
|
|
|
The answer is not easy.
As any DLL in the system, Window will try to keep only one physical copy of the CLR. The DLL will be remapped on each process, and normally only one physical copy will be on memory.
There are some questions like rebasing, which can affect this and sometimes there may be more than one physical copy of the CLR, but this is a more rare event with .NET assemblies than with normal DLLs.
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
I do not know about the no. of copies, but what I understand is the memory consumption shown by task manager is not really true.
HTH
Kannan
|
|
|
|
|
The "mem usage" is known for being untrustable, regardless of the process. The "VM size" is trustable.
How low can you go ? (MS rant)
|
|
|
|