Posted on 2001-08-28
Last Modified: 2008-03-17
can I use AfxOleInit in a plain old console app if I include afxdisp.h?

what's up with that.

it keeps giving me errors.
Question by:bebonham
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
  • 2

Expert Comment

ID: 6433115
I don't think so.  The "Afx" prefix usually means MFC land and takes you out of console app into Windows land.
LVL 86

Accepted Solution

jkr earned 50 total points
ID: 6433153
It is possible, but that requires a lot of work (see e.g. which describes this for DB classes, but it's mainly the same for OLE support).

But, as this function does nothing but initialize the OLE libraries, why don't you use 'OleInitialize()'? That would give the same result...

Author Comment

ID: 6433229
I am trying to take a SDK written in MFC type stuff and use it in my C++ console program.

I am probably only prolonging my suffering to continue to try...maybe I should give up and try an MFC only approach.

Thanks, I will try.


Author Comment

ID: 6433260
it is still giving errors...

this mfc stuff is really frustrating!!!

Since the SDK uses COleDispatchDriver....maybe that is why I have to use MFC?

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
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 learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

718 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