Solved

LPCOLESTR

Posted on 1998-01-23
1
2,342 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

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

Suggested Solutions

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…
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 viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
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.

730 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