|
-
Jul 13th, 2001, 01:17 PM
#1
Thread Starter
New Member
Help With WM_SETTEXT and SendMessage API
Last edited by Spaz; Jul 13th, 2001 at 02:42 PM.
AvengerX
AKA
Spaz
11 Years Old
-
Jul 13th, 2001, 06:07 PM
#2
You need to pass "Hello" ByVal (by value).
-
Jul 14th, 2001, 10:17 PM
#3
Thread Starter
New Member
Thanx
Thanks for the Help, Worked Fine ( without the ByVal i would get a string of 3 cryptic characters )
AvengerX
AKA
Spaz
11 Years Old
-
Jul 15th, 2001, 11:57 AM
#4
Your welcome.
The reason you were getting those crypting characters was because WM_SETTEXT is taking the actual value. When you pass an address, it think the address number is the value.
-
Jul 15th, 2001, 03:50 PM
#5
Fanatic Member
It might work better if you ignore those "X As Any" and "X As SomeUDT" parameters, and change them to "ByVal X As Long", and then send in VarPtr(something), or StrPtr(somestring), since it's operating on the addresses anyway. Then you don't have to stick ByVal in front of any parameter you use in a function where it appears As Any in the declaration. There could be cases where the function might allow for you to pass in NULL under certain conditions, and if the param itself is a UDT, you may not want to have to include the type for the param. The only one I can think of as an example is CreateDC. One of the params is a DEVMODE struct, but if you just want to create a display DC, you give it NULL. If you change the param to "ByVal lpDevmode As Long", you can just give it 0 in that position, and it won't think you're trying to give it an initialization struct. And then you don't need to include the DEVMODE type in the module (since it's not even needed for making up a display DC).
I'm baaaack...
VB5 Professional Edition, VC++ 6
Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se
I feel special because I finally figured out how to loop midis: Post link
I'm a fanatic too 
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
|