General information
Category:
Coding, syntax and commands
>Sys(0) returns machine name and the user name.
Correct. If you need one or the other, use GETWORDNUM().
>As to your "proper solution", it is too complicated for my needs and my technical level. Don't take it personally though.
>Thank you.
It's one of those things, once you get it setup it's useful for 50+ other projects you never thought of before. C# surely has built-in facilities to access named pipe data. And on the VFP side there's surely some existing library which does this. If not, the CreateWindow() function can be a [Dllimport] and you just need a marshaling handler for the class. There are surely examples for that as well. For the HGLOBAL, you Lock() it whenever you want to access data. This returns a C pointer you can reference in C# to create a string, and then Unlock() afterward and then GlobalFree() it.
It's not complex. And there are surely examples available which will take you through it.
I would still recommend using Win32 functions. They'll provide you with everything you need. The [Dllimport] definitions are the key part, but for most common ones there are surely examples online which will tell you how to define them.
Did you ever get the sample I posted working for GetUserNameA()?
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only