|
-
Aug 27th, 2005, 02:16 AM
#1
Thread Starter
Fanatic Member
Callback or events?
What are the advantages and disadvantages of using callbacks instead of events in a client/server, without RA, setting?
Speed? Distribution issues? OS requirements?
I've pretty much stayed away from com/dcom as we've always been concerned about 9x issues and wanted to avoid having system requirements imposed on users but since I'm about to distribute an app for which dcom is required I'm considering implementing callbacks.
-
Aug 27th, 2005, 08:44 AM
#2
Re: Callback or events?
I don't know if there are any speed advantage of using a callback instead of an event, but I don't think so. However you can't use callbacks in VB since VB can't call a function by address (except from a trick I published here that uses CallWindowProc). Using events is the prefered way of handling callbacks from COM/DCOM components.
-
Aug 27th, 2005, 09:08 AM
#3
Re: Callback or events?
VB can call a function by an Address using the AddressOf command.
-
Aug 27th, 2005, 09:18 AM
#4
Re: Callback or events?
 Originally Posted by Jacob Roman
VB can call a function by an Address using the AddressOf command. 
No, VB can pass the address of a function by using the AddressOf keyword. But you can't call that function using that address.
-
Aug 27th, 2005, 09:20 AM
#5
-
Aug 27th, 2005, 12:33 PM
#6
Re: Callback or events?
anotherVBnewbie,
If you're considering implementing callbacks how do you think you're going to do it? (I don't mean this in a rude way because you can actually do it, but there are a variety of ways to).
-
Aug 27th, 2005, 12:37 PM
#7
Thread Starter
Fanatic Member
Re: Callback or events?
Okay, I finally got up from my nap 
It seems that the term "callbacks" has 2 uses with the most common association being with API calls, when being referenced in relation to VB anyway.
However,the second use of the term is the one I am interested in. I found this article on the MS site entitled "SAMPLE: VB5DCOM.EXE: Using Callbacks and WithEvents with DCOM" The sample client/server application demonstrates both methods of the server interacting with the client so maybe I just need to further develope the demo and perform some test but since I'm a lazy bird.....
I asked about the speed because I have a Pop3 component which supports both methods and the associated documentation says that callbacks can be up to 30 times faster. Not knowing whether that is specific to this particular component's implementation or an "across the board" condition is why I'm asking. Actually, thar reference to callback speed is what prompted me to start looking into this.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|