|
-
Jul 18th, 2001, 02:53 AM
#1
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?
-
Jul 18th, 2001, 02:19 PM
#2
PowerPoster
Try declaring the EditStream structure as long
-
Jul 18th, 2001, 02:28 PM
#3
But then it wont be an editstream structure.
-
Jul 18th, 2001, 03:29 PM
#4
Monday Morning Lunatic
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
-
Jul 18th, 2001, 05:13 PM
#5
I tired &EditStream, didnt work. Whats a cast?
-
Jul 18th, 2001, 05:16 PM
#6
Monday Morning Lunatic
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
-
Jul 19th, 2001, 12:33 AM
#7
Oh ok, i know what those are. Ive tried every combination i could think of of those.
-
Jul 19th, 2001, 05:21 AM
#8
Monday Morning Lunatic
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
-
Jul 19th, 2001, 12:11 PM
#9
You need to convert it to LPARAM. Try this:
Code:
SendMessage(hEditMain, EM_STREAMIN, SF_TEXT, (LPARAM) &EditStream);
-
Jul 19th, 2001, 01:30 PM
#10
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|