"Jesse Sanders" <[EMAIL PROTECTED]> wrote:
> The MSSoapLib is a COM library used via the interop and yes,
> the project was ported from VB6.  I am not sure what the threading
> model is.  I have searched everywhere to find out, but I cannot find
> anything that would tell me.

How about the registry?..  All COM components declare their threading model
in the registry, so that would be the first place to look.  (Well, all
well-written ones do.)  Find out the class's CLSID, look that up under
HKEY_CLASSES_ROOT\CLSID in the registry, and underneath the InprocServer32
key for the component there should be a ThreadingModel value.  I'm guessing
that this value is Apartment in your case.  (Or possibly it is absent.)

If that's right, the COM component is single threaded.  If the
ThreadingModel is absent you're stuffed - all instances of the component
will have to run on the same thread.  You'll have to stop using the
component to get around this problem.  (But then why are you using a COM
component to make a call into a web service anyway?  .NET provides all sorts
of native support for this, so you shouldn't need an interop solution!)

If it's Apartment, you'll need to make sure that each of your threads
intialize COM to use an STA.  To do this make this the first thing you do in
each newly-launched thread:

  Thread.CurrentThread.ApartmentState = ApartmentState.STA;

See if that fixes the problem.



> So, this all being said, I like the idea of sockets, but I don't even
> know where to start.  The SOAP code I sent yesterday is the ported
> interop code from VB6.  Can anyone help me convert this to sockets
> or to the .NET framework?  Any links or leads are always appreciated.

Well .NET has built-in SOAP support, so it should be fairly straightforward.
But I would need more information on what the service you are trying to use
requires.  (I'm not familiar with the library you're using, plus I'm not
really a VB guy, so it's difficult to me to infer what it's trying to do.)


--
Ian Griffiths
DevelopMentor

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to