Information générale
Catégorie:
Code, syntaxe and commandes
>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()?
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement