Discussion:
DispCallFunc() : How does it works?
(too old to reply)
David K. Kim
2003-11-03 01:08:05 UTC
Permalink
I saw the above "DispCallFunc()" called
at IDispEventSimpleImpl::InvokeFromFuncInfo() in <ATLCOM.h>.
But I don't know how it works.
What's that function?
Igor Tandetnik
2003-11-03 17:58:49 UTC
Permalink
Post by David K. Kim
I saw the above "DispCallFunc()" called
at IDispEventSimpleImpl::InvokeFromFuncInfo() in <ATLCOM.h>.
But I don't know how it works.
What's that function?
It's an undocumented function from oleaut32.dll that can invoke a method
on a dual interface, given a description of the method's signature and
parameters passed to IDispatch::Invoke. It handles all the details of
parsing parameters from DISPPARAMS structure, coercing them to
appropriate types, building a stack frame, calling the method, and
packing the result into the variant.
--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
David K. Kim
2003-11-03 23:41:38 UTC
Permalink
Thanks Igor.

Then, one more question I have is
what differences between the ITypeInfo::Invoke() and the
IDispatch::DispCallFunc()
are.
Both of them do the same things and using the same stuffs, aren't they?

Thank you very much, in advance.
Post by Igor Tandetnik
Post by David K. Kim
I saw the above "DispCallFunc()" called
at IDispEventSimpleImpl::InvokeFromFuncInfo() in <ATLCOM.h>.
But I don't know how it works.
What's that function?
It's an undocumented function from oleaut32.dll that can invoke a method
on a dual interface, given a description of the method's signature and
parameters passed to IDispatch::Invoke. It handles all the details of
parsing parameters from DISPPARAMS structure, coercing them to
appropriate types, building a stack frame, calling the method, and
packing the result into the variant.
--
With best wishes,
Igor Tandetnik
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
Igor Tandetnik
2003-11-03 23:53:13 UTC
Permalink
Post by David K. Kim
Then, one more question I have is
what differences between the ITypeInfo::Invoke() and the
IDispatch::DispCallFunc()
are.
Both of them do the same things and using the same stuffs, aren't they?
First, there's no such thing as IDispatch::DispCallFunc(). DispCallFunc
is a standalone API function, not a member of IDispatch.

Second, to use ITypeInfo::Invoke you need to have a type info in the
first place. ATL uses DispCallFunc in an implementation of
IDispEventSimpleImpl which happens not have an ITypeInfo pointer handy.

As to whether they are using the same stuff, I do suspect strongly that
ITypeInfo::Invoke uses DispCallFunc internally.
--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
Alexander Nickolov
2003-11-04 00:03:38 UTC
Permalink
IDispatch doesn't have a method called DispCallFunc, perhaps you
confuse it with the global undocumented function you and Igor
discussed? As for ITypeInfo::Invoke, it's very possible it has a one
line implementaiton calling this undocumented function. Do I have
to explain you the difference between a documented and an
undocumented API?
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: ***@mvps.org
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
Post by David K. Kim
Thanks Igor.
Then, one more question I have is
what differences between the ITypeInfo::Invoke() and the
IDispatch::DispCallFunc()
are.
Both of them do the same things and using the same stuffs, aren't they?
Thank you very much, in advance.
Post by Igor Tandetnik
Post by David K. Kim
I saw the above "DispCallFunc()" called
at IDispEventSimpleImpl::InvokeFromFuncInfo() in <ATLCOM.h>.
But I don't know how it works.
What's that function?
It's an undocumented function from oleaut32.dll that can invoke a method
on a dual interface, given a description of the method's signature and
parameters passed to IDispatch::Invoke. It handles all the details of
parsing parameters from DISPPARAMS structure, coercing them to
appropriate types, building a stack frame, calling the method, and
packing the result into the variant.
--
With best wishes,
Igor Tandetnik
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
David K. Kim
2003-11-04 03:21:20 UTC
Permalink
Post by Alexander Nickolov
IDispatch doesn't have a method called DispCallFunc, perhaps you
confuse it with the global undocumented function you and Igor
discussed?
Yes, I was confused.
There's no IDispatch::DispCallFunc().
Post by Alexander Nickolov
As for ITypeInfo::Invoke, it's very possible it has a one
line implementaiton calling this undocumented function. Do I have
to explain you the difference between a documented and an
undocumented API?
Do you mean by this that ITypeInfo::Invoke() have to call
the "undocumented API function DispCallFunc()" internally
or, ITypeInfo::Invoke can be implemented with DispCallFunc()?

Anyway, Yes, Please.

"Alexander Nickolov" <***@mvps.org> wrote in message news:***@TK2MSFTNGP10.phx.gbl...
IDispatch doesn't have a method called DispCallFunc, perhaps you
confuse it with the global undocumented function you and Igor
discussed? As for ITypeInfo::Invoke, it's very possible it has a one
line implementaiton calling this undocumented function. Do I have
to explain you the difference between a documented and an
undocumented API?

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: ***@mvps.org
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
Post by Alexander Nickolov
Thanks Igor.
Then, one more question I have is
what differences between the ITypeInfo::Invoke() and the
IDispatch::DispCallFunc()
are.
Both of them do the same things and using the same stuffs, aren't they?
Thank you very much, in advance.
Post by Igor Tandetnik
Post by David K. Kim
I saw the above "DispCallFunc()" called
at IDispEventSimpleImpl::InvokeFromFuncInfo() in <ATLCOM.h>.
But I don't know how it works.
What's that function?
It's an undocumented function from oleaut32.dll that can invoke a method
on a dual interface, given a description of the method's signature and
parameters passed to IDispatch::Invoke. It handles all the details of
parsing parameters from DISPPARAMS structure, coercing them to
appropriate types, building a stack frame, calling the method, and
packing the result into the variant.
--
With best wishes,
Igor Tandetnik
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
Alexander Nickolov
2003-11-04 18:40:08 UTC
Permalink
The difference between a documented and undocumented APIs
is that you can use documented ones and count on them working
in new versions and service packs. OTOH, undocumented APIs
can disappear or get drastically changed under your feet at any
time. Code using undocumented APIs is not robust and creates
most maintenance problems. In short, never use undocumented
APIs.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: ***@mvps.org
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
Post by David K. Kim
Post by Alexander Nickolov
IDispatch doesn't have a method called DispCallFunc, perhaps you
confuse it with the global undocumented function you and Igor
discussed?
Yes, I was confused.
There's no IDispatch::DispCallFunc().
Post by Alexander Nickolov
As for ITypeInfo::Invoke, it's very possible it has a one
line implementaiton calling this undocumented function. Do I have
to explain you the difference between a documented and an
undocumented API?
Do you mean by this that ITypeInfo::Invoke() have to call
the "undocumented API function DispCallFunc()" internally
or, ITypeInfo::Invoke can be implemented with DispCallFunc()?
Anyway, Yes, Please.
IDispatch doesn't have a method called DispCallFunc, perhaps you
confuse it with the global undocumented function you and Igor
discussed? As for ITypeInfo::Invoke, it's very possible it has a one
line implementaiton calling this undocumented function. Do I have
to explain you the difference between a documented and an
undocumented API?
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
Post by Alexander Nickolov
Thanks Igor.
Then, one more question I have is
what differences between the ITypeInfo::Invoke() and the
IDispatch::DispCallFunc()
are.
Both of them do the same things and using the same stuffs, aren't they?
Thank you very much, in advance.
Post by Igor Tandetnik
Post by David K. Kim
I saw the above "DispCallFunc()" called
at IDispEventSimpleImpl::InvokeFromFuncInfo() in <ATLCOM.h>.
But I don't know how it works.
What's that function?
It's an undocumented function from oleaut32.dll that can invoke a method
on a dual interface, given a description of the method's signature and
parameters passed to IDispatch::Invoke. It handles all the details of
parsing parameters from DISPPARAMS structure, coercing them to
appropriate types, building a stack frame, calling the method, and
packing the result into the variant.
--
With best wishes,
Igor Tandetnik
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
David K. Kim
2003-11-05 00:13:10 UTC
Permalink
Thanks a lot

"Alexander Nickolov" <***@mvps.org> wrote in message news:ecVE#***@TK2MSFTNGP09.phx.gbl...
The difference between a documented and undocumented APIs
is that you can use documented ones and count on them working
in new versions and service packs. OTOH, undocumented APIs
can disappear or get drastically changed under your feet at any
time. Code using undocumented APIs is not robust and creates
most maintenance problems. In short, never use undocumented
APIs.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: ***@mvps.org
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
Post by David K. Kim
Post by Alexander Nickolov
IDispatch doesn't have a method called DispCallFunc, perhaps you
confuse it with the global undocumented function you and Igor
discussed?
Yes, I was confused.
There's no IDispatch::DispCallFunc().
Post by Alexander Nickolov
As for ITypeInfo::Invoke, it's very possible it has a one
line implementaiton calling this undocumented function. Do I have
to explain you the difference between a documented and an
undocumented API?
Do you mean by this that ITypeInfo::Invoke() have to call
the "undocumented API function DispCallFunc()" internally
or, ITypeInfo::Invoke can be implemented with DispCallFunc()?
Anyway, Yes, Please.
IDispatch doesn't have a method called DispCallFunc, perhaps you
confuse it with the global undocumented function you and Igor
discussed? As for ITypeInfo::Invoke, it's very possible it has a one
line implementaiton calling this undocumented function. Do I have
to explain you the difference between a documented and an
undocumented API?
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
Post by Alexander Nickolov
Thanks Igor.
Then, one more question I have is
what differences between the ITypeInfo::Invoke() and the
IDispatch::DispCallFunc()
are.
Both of them do the same things and using the same stuffs, aren't they?
Thank you very much, in advance.
Post by Igor Tandetnik
Post by David K. Kim
I saw the above "DispCallFunc()" called
at IDispEventSimpleImpl::InvokeFromFuncInfo() in <ATLCOM.h>.
But I don't know how it works.
What's that function?
It's an undocumented function from oleaut32.dll that can invoke a method
on a dual interface, given a description of the method's signature and
parameters passed to IDispatch::Invoke. It handles all the details of
parsing parameters from DISPPARAMS structure, coercing them to
appropriate types, building a stack frame, calling the method, and
packing the result into the variant.
--
With best wishes,
Igor Tandetnik
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
Loading...