Solved

LPCOLESTR

Posted on 1998-01-23
1
2,381 Views
Last Modified: 2008-02-01
I need to work with LPCOLESTR.

If I am correct, it's the address of a string right?

How do I then convert, say a string value to a LPCOLESTR?

0
Comment
Question by:Nightjar
[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
1 Comment
 
LVL 32

Accepted Solution

by:
jhance earned 20 total points
ID: 1178826
An LPCOLESTR is not a pointer to a string but rather a pointer to a constant OLESTR.  An OLESTR is an OLE String which is just a wide string.  It's defined in wtypes.h as:

#define OLESTR(str) L##str

and an LPCOLESTR is:

typedef /* [string] */ const OLECHAR __RPC_FAR *LPCOLESTR;

so an LPCOLESTR is a pointer to a constant OLECHAR, or a pointer to a constant WCHAR.

So how do you make an OLESTR?  Like this:

LPCOLESTR myOleStr;
myOleStr = OLESTR("This is an OLESTR");
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
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 learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

705 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