I’m trying to import a dll, namely msado15.dll. I can do this fine with the solution;
#import <C:\\Program Files\\Common Files\\System\\ado\\msado15.dll> \
rename( "EOF", "AdoNSEOF" )
but I can’t really distribute anything with this in.
I’ve tried going through the registry and found a libid for it, and so am trying:
#import "libid:2DF8D04C-5BFA-101B-BDE5-00AA0044DE52" rename( "EOF", "AdoNSEOF" )
but I get these errors
1>Timestream.cpp(5): warning C4010: single-line comment contains line-continuation character
1>Timestream.cpp(6): warning C4278: ‘RGB’: identifier in type library ‘2DF8D04C-5BFA-101B-BDE5-00AA0044DE52’ is already a macro; use the ‘rename’ qualifier
1>Timestream.cpp(6): warning C4278: ‘RGB’: identifier in type library ‘2DF8D04C-5BFA-101B-BDE5-00AA0044DE52’ is already a macro; use the ‘rename’ qualifier
1>Timestream.cpp(6): warning C4278: ‘RGB’: identifier in type library ‘2DF8D04C-5BFA-101B-BDE5-00AA0044DE52’ is already a macro; use the ‘rename’ qualifier
1>Timestream.cpp(6): warning C4278: ‘RGB’: identifier in type library ‘2DF8D04C-5BFA-101B-BDE5-00AA0044DE52’ is already a macro; use the ‘rename’ qualifier
1>Timestream.cpp(6): warning C4278: ‘RGB’: identifier in type library ‘2DF8D04C-5BFA-101B-BDE5-00AA0044DE52’ is already a macro; use the ‘rename’ qualifier
1>Timestream.cpp(6): warning C4278: ‘RGB’: identifier in type library ‘2DF8D04C-5BFA-101B-BDE5-00AA0044DE52’ is already a macro; use the ‘rename’ qualifier
How do I get this to work, and is this the best way of doing it? I’ve looked in the other questions regarding msado15.dll, but they seem to be on different issues.
Thanks,
James
That’s a type library, but it is the wrong one. Which explains all the errors you get. Start regedit.exe and navigate to
HKCR\TypeLiband scroll to the libid you asked for. Note how the 2.0\0\win32 key points to MSO.DLL. That’s an Office type library.To find the proper guid, run OleView.exe from the Visual Studio Command Prompt. File + View Typelib and navigate to msado15.dll. You’ll see the guid you need right at the top, the uuid() attribute on the library section:
thus:
Beware that this is a very old one, you ought to use msado28.tlb