Solved

Compile error with "oleauto.h"

Posted on 2003-12-08
6
1,772 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
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!

 

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 125 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

  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 …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
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.

630 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