Look up the #import statement in regards to namespaces. It allows you to import a library into a namespace so that it doesn't interfere with the default namespace.
"Norman Bullen" <norm[ at ]BlackKittenAssociates.com> wrote in message news:98adnfvwRMkH24PUnZ2dnUVZ_h6dnZ2d[ at ]earthlink.com...
[Quoted Text] > Scott McPhillips [MVP] wrote: >> "Norman Bullen" <norm[ at ]BlackKittenAssociates.com> wrote in message >> news:-OCdnb15jotJUYHUnZ2dnUVZ_q3inZ2d[ at ]earthlink.com... >> >>> Microsoft Office support document WC0993 supplies a list of defined >>> constants that can be used in Visual Basic and VBA applications to >>> automate Excel. The document begins with the notice "This article was >>> written about products for which Microsoft no longer offers support. >>> Therefore, this article is offered "as is" and will no longer be >>> updated." >>> >>> Presumably this is because it refers to Excel 97. Also Visual >>> Basic and VBA have been supplanted by Visual Basic .Net. >>> >>> Is there a newer list for Excel 2003 or 2007? I don't care if it's for >>> .Net because I'm going to convert whatever I can get into #define >>> statements to be used with C++. >> >> >> >> You don't want to do this by hand. All of the COM interfaces and defined >> constants can be imported (using #import) to a C++ project. This >> automates the production of the .h files. For a Word project I #imported >> MSO.DLL, VBE6EXT.OLB, and MSWORD.OLB, all of which were installed by >> Office 2007. Then use ATL to make life livable with these things. >> > Thanks! > > I've done the #import and the compiler generated a header file containing > the Excel constants. However, it causes two syntax error when I include > it. It's easy enough to fix but I'm surprised that Microsoft lets this > happen. > > The generated header contains a declaration of a function DialogBox() with > no arguments. The Windows header file which are included earlier contain a > #define macro DialogBox which requires four parameters so this declaration > fails because too few arguments for a macro. > > -- > Norm > > To reply, change domain to an adult feline. >
|