asynchronous com+ calls

  • Thread starter Thread starter 6954
  • Start date Start date
6

6954

Hi!

i need to implement some asynchronous call to my com+ component, but i
need it to return some values (e.g. results of sql select statement).
obviously queued components and MSMQ are out of the question...

anyone has any ideas how to implement it? or just a guideline maybe?

thank you
 
Are you trying to use the asynchronous ability that COM+ proxies expose,
or do you just want to make an asynchronous call in general? If the answer
is the latter, why not just run the call on another thread? Or better yet,
create a delegate with the same signature and then make the call to your
proxy, using the IAsyncResult returned from the async call on the delegate.

Hope this helps.
 
Nicholas

if i use delegates, can i get specific data back to the calling thread
(like with sinchronous calls), or do i just get something like "method
executed correctly" information? and could you perhaps point me to some
more documentation on that subject (delegates and iasync) if its not
too much of a problem

thanks

Are you trying to use the asynchronous ability that COM+ proxies expose,
or do you just want to make an asynchronous call in general? If the answer
is the latter, why not just run the call on another thread? Or better yet,
create a delegate with the same signature and then make the call to your
proxy, using the IAsyncResult returned from the async call on the delegate.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

6954 said:
Hi!

i need to implement some asynchronous call to my com+ component, but i
need it to return some values (e.g. results of sql select statement).
obviously queued components and MSMQ are out of the question...

anyone has any ideas how to implement it? or just a guideline maybe?

thank you
 
6954,

Take a look at the IAsyncResult interface. There should be
documentation there on how you would get a result from the async call when
you are done.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

6954 said:
Nicholas

if i use delegates, can i get specific data back to the calling thread
(like with sinchronous calls), or do i just get something like "method
executed correctly" information? and could you perhaps point me to some
more documentation on that subject (delegates and iasync) if its not
too much of a problem

thanks

Are you trying to use the asynchronous ability that COM+ proxies expose,
or do you just want to make an asynchronous call in general? If the
answer
is the latter, why not just run the call on another thread? Or better
yet,
create a delegate with the same signature and then make the call to your
proxy, using the IAsyncResult returned from the async call on the
delegate.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

6954 said:
Hi!

i need to implement some asynchronous call to my com+ component, but i
need it to return some values (e.g. results of sql select statement).
obviously queued components and MSMQ are out of the question...

anyone has any ideas how to implement it? or just a guideline maybe?

thank you
 
thx nick!

I read it and did some code but now i get this error: "An unhandled
exception of type 'System.OverflowException' occurred in mscorlib.dll

Additional information: Arithmetic operation resulted in an overflow."

i'm using a delegate with matching signature of remote method. here is
following code:

MyRemoteCom.Class MyCom= new MyRemoteCom.Class();
MyDelegate caller = new MyDelegate(MyCom.MyMethod);
IAsyncResult result = caller.BeginInvoke(null, null);
Thread.Sleep(2000);
label1.Text=caller.EndInvoke(result);

this looks pretty straightforward but somehow the "endinvoke" part
throws forementioned error. The remote method is simple string
returning method with no other code. If i use sync call like:
label1.text=MyCom.MyMethod() works just fine

what could be the problem here?
thanks

6954,

Take a look at the IAsyncResult interface. There should be
documentation there on how you would get a result from the async call when
you are done.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

6954 said:
Nicholas

if i use delegates, can i get specific data back to the calling thread
(like with sinchronous calls), or do i just get something like "method
executed correctly" information? and could you perhaps point me to some
more documentation on that subject (delegates and iasync) if its not
too much of a problem

thanks

Are you trying to use the asynchronous ability that COM+ proxies expose,
or do you just want to make an asynchronous call in general? If the
answer
is the latter, why not just run the call on another thread? Or better
yet,
create a delegate with the same signature and then make the call to your
proxy, using the IAsyncResult returned from the async call on the
delegate.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi!

i need to implement some asynchronous call to my com+ component, but i
need it to return some values (e.g. results of sql select statement).
obviously queued components and MSMQ are out of the question...

anyone has any ideas how to implement it? or just a guideline maybe?

thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top