Questions tagged [lpwstr]

The LPWSTR type is a 32-bit pointer to a string of 16-bit Unicode characters, which MAY be null-terminated.

The LPWSTR type is a 32-bit pointer to a string of 16-bit Unicode characters, which MAY be null-terminated.

http://msdn.microsoft.com/en-us/library/cc230355.aspx

19 questions
3
votes
3 answers

'Initializing': Cannot convert from 'const wchar_t[35]' to 'LPWSTR'

i am currently learning C++ and want to change my desktop wallpaper. However i am getting this error above. #include #include #include using namespace std; int main() { LPWSTR test =…
ConfusedBacon
  • 85
  • 2
  • 8
3
votes
3 answers

Cannot convert CHAR to LPWSTR

I encountered a compilation error in Visual Studio 2015, that I am trying to convert char data to LPWSTR. Can I? Or does it work only with string types? Here is a piece of my code : ⋮ FILE *sortie; char fichier[256];// <--- HERE s my char…
VAV
  • 33
  • 1
  • 4
2
votes
3 answers

How to set a LPWSTR pointer which has been provided by reference to a function?

I am replacing an old DLL which has a function, passing an LPWSTR by reference. The functions should create a new wchar buffer and return the newly created LPWSTR pointer. I found a solution, but I think it could be solved better!? By the main…
Elduckle
  • 23
  • 4
2
votes
2 answers

Can't convert Char to LPWSTR

The following code string exePath() { string path; char buffer[MAX_PATH]; cout << "reading path\n"; GetModuleFileName(NULL, buffer, MAX_PATH); string::size_type pos = string(buffer).find_last_of("\\/"); path = string(buffer).substr(0,…
Mario Valentino
  • 65
  • 2
  • 10
2
votes
1 answer

What does this typedef mean involving LPWSTR?

I am trying to find a substitute for LPWSTR for porting a project to gcc. typedef __nullterminated WCHAR *NWPSTR, *LPWSTR, *PWSTR; What is null terminated ? so would it be safe if I did something like this: typedef WCHAR *LPWSTR
MistyD
  • 16,373
  • 40
  • 138
  • 240
1
vote
1 answer

C++ error when building DLL: argument of type const wchar_t* is incompatible with parameter of type LPWSTR

I am a complete novice to C++ programming. I need to create a DLL using header and solution files that were provided in a tutorial. I have followed basic steps from here but, I am getting following errors in the solution…
BRat
  • 71
  • 1
  • 5
1
vote
2 answers

LPTSTR contains only one letter

I'm creating a DLL for a application. The application calls the DLL and receives a string from 8 to 50 in length. The problem I'm having is that only the first letter of any message the application receives is shown. Below is the GetMethodVersion…
PonWer
  • 87
  • 1
  • 7
0
votes
2 answers

Dialog wIndow does not open

So i want to make a sort of texteditor and want to use a dialogwindow to get the filepath/file from the user. Now here is the problem. I get an error in one project that i does not get in another even though i have not changed a setting that would…
morigan
  • 23
  • 9
0
votes
3 answers

Adding elements to C++ vector

I want to learn more about C++ coding, especially to design and create a desktop application. To begin, I want to create a notification app where I can make a task by giving the task a name and content. For this, I use 2 vectors (name and…
0
votes
0 answers

Convert HWND to LPWSTR?

I have the following code: MessageBox(NULL, NULL, (LPCWSTR)FindWindow(NULL, L"Untitled - Notepad"), MB_OK); How can i make the messagebox's title be the Window Handle to notepad? Is there any effiecient and simple way to do this using c++?
Noah.Ehrnstrom
  • 172
  • 1
  • 12
0
votes
2 answers

Print opengl shader compile log with wprintf

Following the tutorials at opengl-tutorial.org , realize that I can't print the shader compile log directly with printf because I'm doing it in a windows desktop application. I tried to convert it to a LPWSTR using this method: //compile the…
programmer
  • 743
  • 4
  • 10
0
votes
1 answer

How to convert from LPWSTR** to std::vector

I have a function that works with std::vector, declared like this: void MyFunc(std::vector &vFillArray){ //.... //fill the vector with wstrings //.... } Now I would like to export my function in a DLL library and make it available to…
paul
  • 19
  • 3
0
votes
1 answer

C++ #define LPWSTR?

Ok, i have a problem in my program. I made a question about it before, but no one really understood my problem, so im trying a new approach to it this time. If you're curious this is my problem: My program takes arguments in the form of char*…
jeyejow
  • 419
  • 1
  • 5
  • 15
0
votes
0 answers

C++: Member variable order with sockets in WinCE7

I'm writing a program for WinCE7, and I'm trying to setting up a static library class that will be used by the program for TCP communication. Different member variable orders, thus, stuck the program in different ways. Parts of the…
Giack
  • 1
  • 2
0
votes
0 answers

Passing LPWSTR as Reference in a method in C++

I am passing LPWSTR as a reference in a method. The value remains in method but in callee function, it gets lost. I suspect I need to give some memory to LPWSTR but I am unable to figure out the method to do it. This is how my code looks…
1
2