Re: [ADVANCED-DOTNET] Message Queue and Windows Service

2003-06-05 Thread Emilio D'Angelo Yofre
The Receive method of MessageQueue class is a thread-blocking method. The parameterless overload has an infinite timeout. Exerpt from MSDN library: "Use a call to Receive when it is acceptable for the current thread to be blocked while it waits for a message to arrive in the queue. Because this

Re: [ADVANCED-DOTNET] SoapSuds issues and InvalidCastException

2003-06-05 Thread Alasdair Mackintosh
Trey Nash <[EMAIL PROTECTED]> writes: > If you instruct soapsuds to export the metadata into an assembly with the > same name as your server, the problem should go away. The proxy is trying > to find the assembly that the objref references and it cannot find it. > This is the real problem. It's

Re: [ADVANCED-DOTNET] SoapSuds issues and InvalidCastException

2003-06-05 Thread Trey Nash
Hi, I tried taking your example and breaking it down a bit. I changed the return type of getUtility to return an ObjRef. I then did the following in getUtility(): return( RemotingServices.Marshal(new UtilityClass()) ); Then, on the client side of the fence I unmarshaled to an Object. The ObjR

Re: [ADVANCED-DOTNET] Message Queue and Windows Service

2003-06-05 Thread Duncan Godwin
Hi, Have a look at the System.Timers namespace, set an interval and your code will callback on that interval which is far more efficient in my opinion than continually looping. This namespace has been designed with windows services in mind, I usually put the poll interval in the application conf

[ADVANCED-DOTNET] CONTEXT_E_ABORTED while disposing a ServicedComponent

2003-06-05 Thread Chetverikov, Oleg
According to the generally accepted recommendation, it is necessary to call Dispose on a component derived from ServicedComponent, regardless of JITA or pooling settings. Unless you want to hold on to the component state (which is not a good thing, but it is a topic for a different discussion) I

Re: [ADVANCED-DOTNET] access to a legacy DLL with a C++ API

2003-06-05 Thread Philip Nelson
--- Steve Clark <[EMAIL PROTECTED]> wrote: > Thanks for the suggestions. I'll try them out. It seems unavoidable, > that I'll have to replicate the legacy API in a wrapper class of some sort. I can't speak from personal experience here but swig (http://www.swig.org/) has an "experimental" imple

Re: [ADVANCED-DOTNET] SoapSuds issues and InvalidCastException

2003-06-05 Thread Alasdair Mackintosh
Urs Muff <[EMAIL PROTECTED]> writes: > I would strongly recommend (and Ingo does too) to create a metadata library > with interfaces. This assembly only contains all the interfaces and you can > easily use the same assembly on the client and on the server. The server is > then implementing those

Re: [ADVANCED-DOTNET] XML Serialization

2003-06-05 Thread Christoph Schittko
> [System.Xml.Serialization.XmlTypeAttribute( > TypeName = "SensorID.Reader.Agile")] > public class AgileReaderSettings : IReaderSettings > { >private int m_noAntennas; >private string m_ipAddress; >private int m_port; >private int m_autoIDTimeout; >private int m_s

Re: [ADVANCED-DOTNET] Message Queue and Windows Service

2003-06-05 Thread Wallace B. McClure
You will eat up the process doing that. Use BeginReceive to process messages as they come in. Wally - Original Message - From: "Paulo Sacramento" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, June 04, 2003 10:28 AM Subject: Re: [ADVANCED-DOTNET] Message Queue and Windows S

Re: [ADVANCED-DOTNET] Message Queue and Windows Service

2003-06-05 Thread Edmund Maher
Bar- Here's a snippet for code I'm working on that is exactly what you are trying to do...I think you just need to set it up to be async using events (This code is from a good Wrox book, Data-Centric .NET programming with C#). All other code in my service is boilerplate from VS.NET: The

Re: [ADVANCED-DOTNET] Message Queue and Windows Service

2003-06-05 Thread Wallace B. McClure
Use BeginRecieve(). With BeginRecieve, you won't block in a hard loop. When a message is recieved in the queue, an event is fired that there is a message in the queue. here is the info on BeginRecieve: ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemMessagingMessageQueue ClassBeginReceiveT

Re: [ADVANCED-DOTNET] XML Serialization

2003-06-05 Thread Akshay Arora
> [System.Xml.Serialization.XmlTypeAttribute( > TypeName = "SensorID.Reader.Agile")] > public class AgileReaderSettings : IReaderSettings > { >private int m_noAntennas; >private string m_ipAddress; >private int m_port; >private int m_autoIDTimeout; >private int m_s

Re: [ADVANCED-DOTNET] RegisterWaitForSingleObject / DuplicateHandle [Win32]

2003-06-05 Thread Mike Woodring (DevelopMentor)
> However, the RegisterWaitForSingleObject() method requires an > instance of > the WaitHandle class as argument. How do I come from the > IntPtr that is > returned by DuplicateHandle() to a WaitHandle instance? > > For some odd reason the WaitHandle class is abstract, so I > also need to > fig

[ADVANCED-DOTNET] XML Serialization

2003-06-05 Thread Mohamed Benyounes
Hi, I am serializing a class that contains int and string type members and an arrayList of enumerated type. Here is are the members of my class: [System.Xml.Serialization.XmlTypeAttribute( TypeName = "SensorID.Reader.Agile")] public class AgileReaderSettings : IReaderSettings { priv

Re: [ADVANCED-DOTNET] access to a legacy DLL with a C++ API

2003-06-05 Thread Steve Clark
Thanks for the suggestions. I'll try them out. It seems unavoidable, that I'll have to replicate the legacy API in a wrapper class of some sort.

Re: [ADVANCED-DOTNET] Message Queue and Windows Service

2003-06-05 Thread Pant, Nishant
Why do u want to poll the queue??? U can set up MSMQ triggers which are event based. U just tell the trigger if a msg appears on this queue .such and such method shud b called in ur Component. That's it!! - Regards Nishant Pant -Original Message- From: Zecharya Bar [mailto:[EMAIL P

Re: [ADVANCED-DOTNET] Message Queue and Windows Service

2003-06-05 Thread Paulo Sacramento
What's keeping you from using a thread? Something like: Thread mainThread; protected override void OnStart(string[] args) { string queuePath = @".\private$\myQueue"; MessageQueue myQueue; if (! MessageQueue.Exists(queuePath)) { MessageQueue.Create(queuePath); } myQ

[ADVANCED-DOTNET] Message Queue and Windows Service

2003-06-05 Thread Zecharya Bar
Hi, I'm beginning to experiment with Microsoft Message Queues and have run into a simple problem. I would like a Windows Service I'm creating to monitor continuously a MSMQ, and upon receiving a message, call another method. How do I get the service to continually check the queue? I've tried

[ADVANCED-DOTNET] RegisterWaitForSingleObject / DuplicateHandle [Win32]

2003-06-05 Thread Henrik Enemark Rasmussen
>From the help to RegisterWaitForSingleObject: "The wait thread uses the Win32 WaitForMultipleObjects function to monitor registered wait operations. Therefore, if you must use the same native operating system handle in multiple calls to RegisterWaitForSingleObject, you must duplicate the handle u

Re: [ADVANCED-DOTNET] SoapSuds issues and InvalidCastException

2003-06-05 Thread Urs Muff
I would strongly recommend (and Ingo does too) to create a metadata library with interfaces. This assembly only contains all the interfaces and you can easily use the same assembly on the client and on the server. The server is then implementing those interfaces. Here is a sample (and that works