How to easily pass a very long string to a worker process under Windows?

Posted by sharptooth on Stack Overflow See other posts from Stack Overflow or by sharptooth
Published on 2010-04-05T07:14:26Z Indexed on 2010/04/05 7:23 UTC
Read the original article Hit count: 285

Filed under:
|
|
|

My native C++ Win32 program spawns a worker process and needs to pass a huge configuration string to it. Currently it just passes the string as a command line to CreateProcess(). The problem is the string is getting longer and now it doesn't fit into the 32K characters limitation imposed by Windows.

Of course I could do something like complicating the worker process start - I use the RPC server in it anyway and I could introduce an RPC request for passing the configuration string, but this will require a lot of changes and make the solution not so reliable. Saving the data into a file for passing is also not very elegant - the file could be left on the filesystem and become garbage.

What other simple ways are there for passing long strings to a worker process started by my program on Windows?

© Stack Overflow or respective owner

Related posts about c++

Related posts about visual-c++