|
Yes, it means
(1) get the IUnknown pointer
(2) get the ICustomized pointer via IUnknown->QueryInterface
(3) call ICustomized->WhateverMethod()
(eventually perform cleanup...)
on the other hand, access via IDispatch is quite different.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks CPallini,
Good answered.
regards,
George
|
|
|
|
|
Hi CPallini,
Just through of another question, to implement dual interface is easy, i.e. making the component implement a customized interface, and making the customized interface inherits IDispatch. So, I think since it is easy, every COM component should implement it and be a dual interface. Why implementing dual interface is not mandatory -- i.e. for some other reasons, developer will not implement dual interface?
regards,
George
|
|
|
|
|
George_George wrote: Just through of another question, to implement dual interface is easy, i.e. making the component implement a customized interface, and making the customized interface inherits IDispatch. So, I think since it is easy
Most of COM components implement dual interface.
George_George wrote: So, I think since it is easy, every COM component should implement it and be a dual interface.
(1) Is not that easy if you're doing it hand-crafting (without the help of a wizard or a framework such MFC or ATL )
(2) Keeping COM requirements minimal is (IMHO) a good design approach.
George_George wrote: i.e. for some other reasons, developer will not implement dual interface?
Because, for instance, all the clients (of the COM server they're building) are written in VTABLE
binding language (like C++ or VB6 clients). AS you know VTABLE binding
is more efficient than IDispatch mechanism.
Final note: if you don't need a feature, why doing efforts to implement it?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Cool, CPallini!
have a good weekend,
George
|
|
|
|
|
George_George wrote: Why implementing dual interface is not mandatory
Keeping COM requirements minimal is a good design approach IMHO (and building a dual interface is not that easy, without wizards or framework, like MFC or ATL , support).
George_George wrote: i.e. for some other reasons, developer will not implement dual interface?
Because none of the intended clients need it (for instance C++ or VB6 clients don't need IDispatch). As you know IDispatch mechanism is less efficient than VTABLE binding.
Anyway most of COM servers actually implement dual interface (by free choiche).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi CPallini,
I further question. If we want to support IDispatch, all types in methods' parameter/return value must be auomtation compatible? If yes, why?
regards,
George
|
|
|
|
|
Because automation clients have no clue of other types.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks CPallini,
But can't we include the complex type definition in IDL and build the IDL into typelib and let client use the typelib?
regards,
George
|
|
|
|
|
AFAIK automation clients don't use typelib s.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Sorry my bad, CPallini. I always write C++ native client actually.
If the automation client (I think you mean client like VB or JScript) does not use typelib, what will they use to invoke? Just read some document about interface/coclass/methods signature information and use GUID or ProgID, then call IDispatch.invoke?
regards,
George
|
|
|
|
|
Yes, VBScript clients, for instance, do something like this.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks CPallini,
Sorry we are talking about two things.
I mean VB -- Visual Basic. Any way, here are my questions, let us talk VB and script language (VB Script or JScript) separately.
1. Could VB client use TLB file?
2. Could script client use TLB file?
3. If I define customized type (e.g. a structure) in IDL file, use such customized type as input parameter or return type for some methods, and generate related TLB. Could VB client use such methods?
4. If I define customized type (e.g. a structure) in IDL file, use such customized type as input parameter or return type for some methods, and generate related TLB. Could script client use such methods?
regards,
George
|
|
|
|
|
George_George wrote: I mean VB -- Visual Basic. Any way, here are my questions, let us talk VB and script language (VB Script or JScript) separately.
I suppose 'VB' standing for 'Visual Basic 6' .
George_George wrote: 1. Could VB client use TLB file?
AFAIK Yes.
George_George wrote: 2. Could script client use TLB file?
Nope.
George_George wrote: 3. If I define customized type (e.g. a structure) in IDL file, use such customized type as input parameter or return type for some methods, and generate related TLB. Could VB client use such methods?
I don't know.
George_George wrote: 4. If I define customized type (e.g. a structure) in IDL file, use such customized type as input parameter or return type for some methods, and generate related TLB. Could script client use such methods?
Nope.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks CPallini!
For item 4, you mean for script client, if I define customized type (e.g. a structure) in IDL file, use such customized type as input parameter or return type for some methods, and generate related TLB. Script client can not use such methods? I feel surprised so confirm here again.
regards,
George
|
|
|
|
|
Scripts client use only VARIANT datatype only via IDispatch .
Of course, you know, this is going on my arrogant...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks CPallini,
I did some search but find no results. Do you have any documents referrals which describes whether script language could use TLB or not?
regards,
George
|
|
|
|
|
Oh, well no. But I'm pretty sure: VBScript & JScript (I'm not talkingt about the .NET one) have only VARIANT datatype and can only access COM components via IDispatch .
You may have a look to VBScript or JScript reference documentation on MSDN .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
Thanks Sandip,
I am a little losting the context you are talking about. Do you mean in order to implement a dual interface,
- we need an additional customized interface, which implements IDispatch?
- or we need implement both an additional customized interface (and the customized interface inherits from IUnknown) and also implement IDispatch?
- or both the above two ways are fine?
regards,
George
|
|
|
|
|
SandipG wrote: I think things shoudl be clear after this.
ROTFLMAO! This must be your first reply to George!
led mike
|
|
|
|
|
Steve Echols wrote: Been so long since I've done it, I'm a bit fuzzy on the details.
Yep, that's it, and that pretty much is the detail.
led mike
|
|
|
|
|
Thanks led mike,
As you are here. Let me just rate your reply and ask you a question.
To implement dual interface is easy, i.e. making the component implement a customized interface, and making the customized interface inherits IDispatch. So, I think since it is easy, every COM component should implement it and be a dual interface. Why implementing dual interface is not mandatory -- i.e. for some other reasons, developer will not implement dual interface?
regards,
George
|
|
|
|
|
I've been writing a TCP/IP client program: C++, Winsock, Win32, multithreaded. Anyway, after I send a message or two and a subsequent receive, I then get a 10053 from Winsock. Windows XP. I am completely updated with MS so it isn't an old system dll. I checked their knowledge base and there's nothing that I haven't done - there isn't much anyway. What really kills me is that other TCP/IP programs: web browsers, email clients, FTP clients, etc... are operating fine. Is there some sort of trick that I am missing?
To reiterate, it works perfectly for at least one 'send' and 'recv'. The client is communicating with Apache.
Any ideas? (What's left of my hair is falling out over this!)
I've also removed my anti-virus and turned off my firewall to see if that will clear it up - it didn't.
modified on Friday, September 12, 2008 5:03 AM
|
|
|
|
|
10053 WSAECONNABORTED
An established connection was aborted by the software in your host machine.
LitteWindow wrote: Any ideas?
Yes - you're doing something wrong.
What does your send and receive code look like?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|