Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Compile error with "oleauto.h"

Posted on 2003-12-08
6
Medium Priority
?
1,805 Views
Last Modified: 2008-08-08
Hi,

I'm new to Visual C++ 6.0.  When I try to compile my code, I get an error message trying to compile this line,

#include "oleauto.h"

It says,

c:\program files\microsoft visual studio\vc98\include\oleauto.h(30) : error C2146: syntax error : missing ';' before identifier 'IID_StdOle'
c:\program files\microsoft visual studio\vc98\include\oleauto.h(30) : fatal error C1004: unexpected end of file found
Error executing cl.exe.

Anyone know what's causing this? I'm using the include as I'm trying to use SAFEARRAYS.

Thanks,
Malcolm
0
Comment
Question by:malramsay
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 24

Expert Comment

by:shivsa
ID: 9901198
u should be using
#include <oleauto.h>
in old C++ convention.

or
#include <oleauto>
in C++ convention.

0
 

Author Comment

by:malramsay
ID: 9901242

Hi, I'd thought of that already (sorry, I probably should have said).  If I change the line to

#include <oleauto.h>

I still get the same error,

c:\program files\microsoft visual studio\vc98\include\oleauto.h(30) : error C2146: syntax error : missing ';' before identifier 'IID_StdOle'
c:\program files\microsoft visual studio\vc98\include\oleauto.h(30) : fatal error C1004: unexpected end of file found
Error executing cl.exe.

And if I use, "#include <oleauto>" I get an error about not finding the file,
"fatal error C1083: Cannot open include file: 'oleauto': No such file or directory"

Any other ideas?
0
 
LVL 24

Expert Comment

by:shivsa
ID: 9901271
check your oleauto.h file and check for IID_StdOle, it looks like syntex error in that file.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:malramsay
ID: 9901299
Crap.  I thought you were going to tell me that.  I've checked the file and here's the first 30 lines (as the error is on the 30th line).  I'm a VB not a C++ programmar, so I'm a bit out of my depth.  Does anything look strange to you?  If I can't get this to work can I simply get another oleauto.h file on the web somewhere? Thanks.

//+---------------------------------------------------------------------------
//
//  Microsoft Windows
//  Copyright 1992 - 1998 Microsoft Corporation.
//
//  File:       oleauto.h
//
//  Contents:   Defines Ole Automation support function prototypes, constants
//
//----------------------------------------------------------------------------

#if !defined( _OLEAUTO_H_ )
#define _OLEAUTO_H_

// Set packing to 8 for ISV, and Win95 support
#ifndef RC_INVOKED
#include <pshpack8.h>
#endif // RC_INVOKED

//  Definition of the OLE Automation APIs, and macros.

#ifdef _OLEAUT32_
#define WINOLEAUTAPI        STDAPI
#define WINOLEAUTAPI_(type) STDAPI_(type)
#else
#define WINOLEAUTAPI        EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
#define WINOLEAUTAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
#endif

EXTERN_C const IID IID_StdOle;
0
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 9901334
Are you using 'oleauto.h' without including any windows headers? Try adding

#include <windows.h>
#include <objbase.h>
0
 

Author Comment

by:malramsay
ID: 9901367

D'oh!  Thanks jkr - I had been using <windows.h> but not <objbase.h> as well.  I thought it might be something easy like that 'cos I'm such a novice!

I'll have to look up what objbase does exactly....

Thanks also shivsa - I'll no doubt be posting more questions over the next couple of days as I try to get my head around this project.
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question