题
stdole32.tlb contains all base type definitions, and every lib must import it, if we use MIDL. But when I created ATL DLL project, lib file looks like that
import "oaidl.idl";
import "ocidl.idl";
[
uuid(4CA3ADAD-AE53-4D80-AF26-176BAF8223B1),
version(1.0),
]
library FirstATLLib
{
importlib("stdole2.tlb");
};
I can't google what is in stdole2.tlb? Does it contain stdole32.tlb? And what else? Can someone helps me to find out?
解决方案
You can use Windows SDK COM/OLE Object Viewer
to open the type library and see what is there inside:
It defines certain interfaces and type you can use in your type library, since you make them available through referencing stdole2.tlb
.
其他提示
stdole2.tlb
is a newer version of stdole32.tlb
. This is evident from the IDL exported using OleView:
From stdole2.tlb:
// typelib filename: stdole2.tlb
[
uuid(00020430-0000-0000-C000-000000000046),
version(2.0),
helpstring("OLE Automation")
]
library stdole
{
...
From stdole32.tlb:
// typelib filename: stdole32.tlb
[
uuid(00020430-0000-0000-C000-000000000046),
version(1.0),
helpstring("OLE Automation")
]
library stdole
{
...
This is confirmed by observing that they both have the same uuid
but that stdole2
has a later version
attribute.
Furthermore if you compare the IDL for both of them you can see specifically how the newer one differs from the first. Mainly it adds some attributes to a few interfaces, and also adds a bunch of new typedefs, interfaces, etc. (Too long to add here and not really needed to answer the question).
Curiously unlike a DLL there are no file attributes (Details tab of the Properties view in Windows Explorer) with version or other info.