Assigning contents of string to user-defined type 
Author Message
 Assigning contents of string to user-defined type

I am using a third-party control (ASocket from Mabry) to receive data
in a connected socket.  The control gives me the data as a string.  I
would like to take this string and copy it into a user-defined type
"as is".

So, if I had

MyData as UserType
t as String

t = ASocket.ReceiveBuffer    ' the third-party control
MyData = t                               ' what I would like to do

This, of course, doesn't work - I get a type conversion error, since
they are by no means the same type.

I'm trying to do something that in C would be done with:

memcpy (&MyData, t, sizeof (MyData));

I don't want VB to interpret it as a string;  I just want to copy it
"as is".  Does anyone have any suggestions?

Steve Boyko
NB Power



Sat, 28 Aug 1999 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Assigning recordset recodset to a user Defined Data Type

2. enumerating contents of a user-defined type?

3. User Control - User-defined type not defined

4. User Defined Type to String, Why not?

5. Passing Strings as members of User Defined Types to an API call

6. Passing Text Delimited String into User Defined Data Type

7. Redefining string data as user defined type

8. Passing String into a User-Defined Type(Structure)

9. from user defined type to string : HELP!!!!

10. Convert a User-Defined Type to a large string

11. Copying strings to user-defined types in VB4

12. Converting String To User Defined Type

 

 
Powered by phpBB® Forum Software