Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Compile error with "oleauto.h"

Posted on 2003-12-08
6
Medium Priority
?
1,830 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
  • 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's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

877 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