last day (14 days later) » 

9:21 PM
-3
Q: C++ creating a LPWSTR object

jeyejowOk, im having a small (big) problem with my code. Basicly i made a program that works with arguments. This is how an example call to my program looks like: abc.exe F: You can see that the argv[1] will be "F:". Now here comes the part were im having troubles with. I need to create a LPWSTR obj...

 
Unclear, what you're asking. Are you having difficulty concatenating strings? Are you strings using different encodings? Do you want to get a wide character string of your arguments? Something else?
 
@IInspectable I want to store the arguments has a LPWSTR, but i want it to be store like this LPWSTR = "\\\\.\\" + *argv[1]; cmon i literraly explain what i wanted to do in the question...
@πάνταῥεῖ can you make an awnser solving my problem?
 
That doesn't help to clarify your problem. Please answer the questions I asked.
 
@IInspectable , ok ill try to be more detailed. I have a program that works with arguments. Assuming that it only takes one arguments and it is stored in *argvc[1], i want to make a LPWSTR object that containts this L"\\\\.\\" plus the value of *argv[1].... i dont understand what you arent understanding....
 
The value of *argv[1] is a single character. Besides that, why do you keep refusing to answer, what character encoding (and data type) argv is?
 
9:21 PM
@IInspectable its char* argv[]
@user4581301 well you can create an LPWSTR object, i dont understand what you are saying :v
 
Either change your project to Unicode character encoding (which any application in this millennium should be anyway), or call CommandLineToArgvW, and stuff the results into a std::wstring for concatenation.
 
i think every one here got my question wrong, my program needs a LPWSTR obj. And i need that object to be the same as a argument that is passed by calling the program like this: abc.exe F: (in this example, the argument is "F:"). Im looking for a way to make a LPWSTR object that the value = L"\\\\.\\"+ *argv[1]. (*argv[1] hold the argument). @IInspectable
 
LPWSTR is a macro, that expands to wchar_t*, a simple pointer, not an object. The real issue here is, that you haven't understood the problem you need to solve. You need to fix that first.
 
@IInspectable maybe you arecorrect, can you please make an awnser explaining me why i am wrong and how to solve my current problem? It seems that i am not understanding the situation at all
 
I cannot answer a question, that's not clear. If you need help, you're going to have to fix the question first.
 
9:21 PM
lets talk here
how should i edit my question?
did you understand what i was trying to do?
 

last day (14 days later) »