SPONSORS:






User Tag List

Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Nov 2001
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    returning strings with SendMessage

    We've used SendMessage in the past with a dummy value for LPARAM. However, I would now like to be able to return a string value in LPARAM. I've seen examples of returning a LONG, and that seems straightforward, but I can't seem to get the string to work. I've tried to simplify this as much as possible. Would appreciate advice from those familiar with this.

    SilkTest:
    C++ code:
    When running the Silk code, I first get a "as a string" messagebox. Then, I get the "DOH!" messagebox. Obviously, sRect also does not printed in SilkTest.
    Thanks for any help you can give!

  2. #2
    Senior Member
    Join Date
    Jan 2001
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: returning strings with SendMessage

    If you put the keyword "out" infront of your argument in SendMessage, then you will be able to get a return value from arguments.

    Ex:

    [ ] LRESULT SendMessage (HWND hWnd, UINT uiMsg, WPARAM wParam, out LPARAM lParam) alias "SendMessageA"


    Now lParam can actually get values. code not tested but it should work.


    ------------------
    Also it might be possible that some string under win32 can't be converted correctly to silk's string type.

    [This message has been edited by GodKnows (edited 12-14-2001).]

  3. #3
    Senior Member
    Join Date
    Oct 1999
    Location
    Tyngsborough, MA
    Posts
    211
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: returning strings with SendMessage

    I believe an LPARAM is a LONG. I don't think there's a way to cast it to a LPTSTR.

    If you run your C++ in the debugger and check the value of LPTSTR string you should find that it could not be evaluated.

    I'm interested to see if you can do this. Please post your results.

    ------------------

  4. #4
    Junior Member
    Join Date
    Aug 2001
    Posts
    27
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: returning strings with SendMessage

    I am not sure whether you can access the memory of other process?

    ------------------

 

 

Posting Permissions

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

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 05:30 AM.

Copyright BetaSoft Inc.