Questions tagged [lpstr]

21 questions
2
votes
1 answer

C++ Function pointer incorrect types

I need to use the following function but I'm in trouble with the args: In this case the IP Address is not setting. cwbCO_SysHandle system; LPSTR ipAddress = ""; ULONG ipLength = 32; cwbCO_GetIPAddress(system, ipAddress, &ipLength); I know I need to…
ProtectedVoid
  • 1,293
  • 3
  • 17
  • 42
2
votes
2 answers

(C++/WinAPI) Reversing LPSTR

i have some problems to reverse LPSTR. Here is my function: LPSTR Reverse(LPSTR a_lpText) { int nTextLength = strlen((char*)a_lpText); LPSTR lpReversed = (LPSTR) GlobalAlloc(GPTR, nTextLength + 1); for (int i = 0; i < nTextLength; ++i) …
1
vote
1 answer

SendKeys does not work from pre-defined LPSTR.

I have a QTimer connected to a TimerHandler function. The TimerHandler should do my SendKeys function that I declared in the public section of my header. If I manually type in the text for the SendKeys function it gives an correct output. But if I…
HitomiTenshi
  • 514
  • 2
  • 6
  • 20
1
vote
4 answers

Split LPSTR and add up values as a long

I am trying to take an LPSTR in C++ such as "12,30,57" and split it and then add up all of the numbers (they are all non-decimal) that are returned from the split operation into a resulting long value. This is not homework I can assure you. It's…
Keith Adler
  • 20,880
  • 28
  • 119
  • 189
1
vote
1 answer

How to save ofn.lpstrFile to string properly?

Hi i am trying to make a GUI for image compare software. The idea is to choose a picture with OPENFILENAME, then get its address with ofn.lpstrFile then make a histogram for that image. So i use: return(ofn.lpstrFile); I can cout the address or…
Viktor Bendik
  • 97
  • 3
  • 11
1
vote
1 answer

Calling dll in python 3 with LPSTR

I have a .dll named my.dll, with 4 functions, called in python 3.5 using: myDLL = ctypes.cdll.LoadLibrary(Path:\to\my.dll) My problem is calling a function that has LPSTR: #include "stdafx.h" #include "newheader.h" double _stdcall…
Itay Livni
  • 2,143
  • 24
  • 38
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
1 answer

What does this error mean: "error C2664 cannot convery arguement 7 from 'TCHAR (*)[261]' to 'LPSTR'

I'm new to coding and I'm not too sure how I'd go about fixing this issue. The error is as follows: error C2664: 'BOOL GetVolumeInformationA(LPCSTR,LPSTR,DWORD,LPDWORD,LPDWORD,LPDWORD,LPSTR,DWORD)': cannot convert argument 7 from 'TCHAR (*)[261]'…
0
votes
2 answers

why passing string to a function which accepts LPSTR does noy work?

Following code gives empty string and length = 0, but while debugging I can see the childDisplayName has correct name. CHAR fileSystemName[MAX_PATH + 1] = { 0 }; DWORD serialNumber = 0; DWORD maxComponentLen = 0; string…
aromahola
  • 190
  • 1
  • 12
0
votes
1 answer

Calling C++ function with LPStr return value from C#

I have a C++ dll in 64-Bit, which contains a function that returns an LPStr. I would like to call this function in C#. The function declaration looks like this: __declspec(dllexport) LPSTR __stdcall function(int16_t error_code); In my C# code I…
Pete
  • 75
  • 1
  • 2
  • 13
0
votes
1 answer

C++ - Using GetPrivateProfileString without buffer

I'm using GetPrivateProfileStringA to read some things from a .ini file. I have some other class where I save things along with a string array. I have to use it like this to get a proper string into the ControlAlt array: char…
ikt
  • 3
  • 4
0
votes
2 answers

How do you append a char[256] to the contents of an edit control?

I am working on a small GUI calculator project and I need to append something to the contents of an edit control. The function I am currently using is: int CharControl = 256; void AddToEditMainText(char WhatToAdd[CharControl]) { char…
Forrest4096
  • 159
  • 1
  • 8
0
votes
1 answer

C++ Add LPSTR buffer to char array

Here is the situation: I have a class in which has a method in which I have a loop that overwrites a buffer with a new letter every iteration and the buffer's datatype is LPSTR. My question is, how I could take all the letters that are generated…
Forivin
  • 14,780
  • 27
  • 106
  • 199
0
votes
1 answer

How to resolve “ invalid conversion from 'const char*' to 'LPSTR {aka char*}' [-fpermissive] "

I use Qt Creator and this code : CreateProcess(NULL,string("curl -F \"api_key=XXX\" -F \"filetype=mp3\" -F \"track=@"+execpath+"\\sound.mp3\" \"http://developer.echonest.com/api/v4/track/upload\"").c_str(), NULL, NULL, TRUE, CREATE_NO_WINDOW, NULL,…
AmirH
  • 57
  • 11
0
votes
1 answer

C++ - Convert LPSTR to const char* in MinGW under Windows

I'm having trouble converting from LPSTR to const char* in MinGW under Windows. #include #include #include #include int main() { DIR *dir; struct dirent *ent; LPSTR buffer; GetCurrentDirectory(100,…
zeroslash
  • 23
  • 7
1
2