c++ - How to do type conversion for the following Scenario? -


after some set

using TCHAR buffer [MAX_SIZE]

For the former, I say that the folder's relative path is found:

c: \ Microsoft.NET \ framework \ v1.0.037 \

The above path type buffer I'm trying to do TCHAR and I concatenate "RegAsm.exe"

After I need to change the path to LPCTSTR because it's created by CreateProcess ( ) Which requires LPCTSTR

Write in areas such as

Then the compiler to error. I tried but bothered.

Anyone can help me in this aspect ....

The problem is that TCHAR and Create Process macros are what you compile for Unicode, depending on whether it is compiled or not. The warning is that GetCorSystemDirectory () will accept only one Unicode buffer. To get rid of these ANSI / Unicode problems, type this code explicitly for Unicode.

Use WCHAR for buffer instead of TCHAR Use CreateProcessW () instead of CreateProcess () - it will happily accept Unicode buffer. Use wcscat () for string combinations.

Something (error has been omitted):

  WCHAR buffer [MAX_PATH + 1]; DWORD genuine lamp; GetCORSystemDirectory (buffer, MAX_PATH, and actual lang); * (Buffer + real length) = 0; // Do not forget to eliminate string wcscat (buffer, l "regasm.exe"); CreateProcessW (/ * pass buffer * /) here;  

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -