Using named pipe to communicate between unicode and non-unicode processes on windows
If a process with unicode enabled creates a named pipe, it must pass a LPCTSTR for the pipe name, in this case a LPCWSTR. Will a second process wihtout unicode be able to open that pipe by passi开发者_运维百科ng a LPCSTR for the pipe name?
Also, can I call CreateNamedPipeW or CreateNamedPipeA and ignore whether unicode is enabled, or do I have to call the appropriate one?
Processes aren't Unicode or non-Unicode, they're just processes. The Unicode/non-Unicode distinction applies only to windows and window-related objects.
You can call either of the two functions. The A version merely converts the string to UTF-16 and passes it to the W function.
精彩评论