Article # 699, added by Geoworks, historical record
| first |
previous |
index |
next |
last |
How to copy text from a VisMonikerWithText.
Here's an example of how to copy the text out of a textual VisMoniker, as well as how to copy the text from a text chunk. Notice that when copying the text from the VisMoniker we must add in the defined constant VMWT_text. @start DataResource, data; @visMoniker MyTextMoniker = "Blahblah"; @chunk TCHAR MyTextChunk = "blah blah"; @end DataResource; @method TestProcessClass, MSG_TEST_PROCESS_TEST { TCHAR buffer[20]; TCHAR *ptr; MemLock( OptrToHandle( @MyTextMoniker ) ); ptr = LMemDeref( @MyTextMoniker ); strcpy( buffer, ptr + VMWT_text ); ptr = LMemDeref( @MyTextChunk ); strcpy( buffer, ptr ); MemUnlock( OptrToHandle( @MyTextMoniker ) ); }