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
Solved

LPCOLESTR

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

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

Suggested Solutions

Title # Comments Views Activity
C++ get user from AD  (VS6) 7 82
Grammars for C C++ and java 1 131
best sources to up-to-date in C++? 8 89
computer science syllabus 3 88
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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

789 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