D
D
Dutymy2021-07-26 18:04:26
C++ / C#
Dutymy, 2021-07-26 18:04:26

How to assign a WCHAR* constant value?

Hello I have a constexpr WCHAR* targetWindowName = L"myApp"; but I cannot assign a constant value to a variable, the function using the targetWindowName value must accept WCHAR *
How can you still assign a constant value to targetWindowName?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
res2001, 2021-07-26
@Dutymy

Declare an array
WCHAR targetWindowName[]
and copy your constant there using, for example,std::wcsncpy

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question