?
Solved

LPCOLESTR

Posted on 1998-01-23
1
Medium Priority
?
2,463 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 40 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

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

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…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
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.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

650 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