Re: structs for data transfer?

From: Phlip (phlip_cpp_at_yahoo.com)
Date: 09/20/04


Date: Mon, 20 Sep 2004 14:10:30 GMT

John Harrison wrote:

> Write some code to convert the struct you want to send into a char array.
> Write some code to turn that char array back into a struct. Use the first
> piece of code when you send, the second when you recieve. Trying to send
> anything more complicated than char arrays between different types of
> computers is asking for trouble.

Oh, and then you must figure out either a length system for each part of the
string, or sentinels and delimeters for the ends of strings. Then you must
figure out how to escape the delimiters if your users type them inside
strings. Then you might need a system to name each data element.

Oh, and then you might localize, and need to pack UTF-8 into your strings.

Use XML. If HTTP is slow, even to a server you programmed, then rewrite a
simpler version of it.

-- 
  Phlip
  http://industrialxp.org/community/bin/view/Main/TestFirstUserInterfaces


Relevant Pages

  • Re: Sanity check on call to imported DLL function
    ... Seems your struct declaration is wrong. ... The IntPtr DataPID should not be present ... "Default Marshaling for Strings", there is a subsection "Strings Used ... I'll try the char array ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: structs for data transfer?
    ... > John Harrison wrote: ... >> Write some code to convert the struct you want to send into a char array. ... or sentinels and delimeters for the ends of strings. ...
    (comp.lang.cpp)
  • Re: Sanity check on call to imported DLL function
    ... "Default Marshaling for Strings", there is a subsection "Strings Used ... struct StringInfoT { ... public String f1; ... I'll try the char array ...
    (microsoft.public.dotnet.languages.csharp)
  • Using VC6 code in VS 2005
    ... I'm trying to reuse a database class module that I created with VC 6.0 in ... SqlDriverConnect SqlDriverConnectW" and the compiler balks at my connect ... string being a char array. ... won't accept literal strings or char arrays as parameters. ...
    (microsoft.public.vc.language)
  • Re: Lost in loops
    ... >> I am really stuck with my program that will compare two strings and ... >> assign scores between pairs of letters. ... >> is now in a 2D char array ...
    (comp.lang.java.programmer)