Results 1 to 10 of 10

Thread: SendMessage EM_STREAMIN

  1. #1
    ChimpFace9000
    Guest

    Post SendMessage EM_STREAMIN

    This is my code..

    Code:
    SendMessage(hEditMain, EM_STREAMIN, SF_TEXT, EditStream);
    The error...

    Code:
    error C2664: 'SendMessageA' : cannot convert parameter 4 from 'struct _editstream' to 'long'
            No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
    EditStream is a structure. I putting (long) next to it and it wont work. Any ideas?

  2. #2
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    Try declaring the EditStream structure as long
    Baaaaaaaaah

  3. #3
    ChimpFace9000
    Guest
    But then it wont be an editstream structure.

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Try passing a pointer using &EditStream (you'll need a cast).
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5
    ChimpFace9000
    Guest
    I tired &EditStream, didnt work. Whats a cast?

  6. #6
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Code:
    long location;
    char *ptr;
    char val = 5;
    
    ptr = &val; // Fine
    location = (long)ptr; // Needs the cast to change indirection level
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  7. #7
    ChimpFace9000
    Guest
    Oh ok, i know what those are. Ive tried every combination i could think of of those.

  8. #8
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Does it fail to compile, or fail to work properly?
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  9. #9
    Megatron
    Guest
    You need to convert it to LPARAM. Try this:
    Code:
    SendMessage(hEditMain, EM_STREAMIN, SF_TEXT, (LPARAM) &EditStream);

  10. #10
    ChimpFace9000
    Guest
    Parksie, it fails to compile.

    Megatron, i get this error
    Code:
    error C2440: 'type cast' : cannot convert from 'struct _editstream' to 'long'
            No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
    Edit:
    Megatron, i forgot to add the '&', and it works now. Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width