-1

I'm trying to run 'CreateProcess' in c, with a custom string that I build. When I'm using a simple string like:

TCHAR command[]= _T("MyApp.exe -OPTION1 -OPTION2")

Everything seems to work fine.

But as I try to build a custom string (with getting MyApp OPTIONS from an other source), and concatenate the options to the string "MyApp.exe" using sprintf_s or swprintf_s the string I get is the same, but the process gives me an exit code of (2) - meaning (FILE_NOT_FOUND).

I'll be grateful for any help..

Isaac
  • 29
  • 6

1 Answers1

0

I've managed to find the answer,

If anyone had the same problem, you need to open your project's properties, and enter to:

Configuration Properties-> General

then set 'Chracter Set' to Not Set

Isaac
  • 29
  • 6