Results 1 to 3 of 3

Thread: ExTextOut outputs random characters

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2010
    Posts
    2

    ExTextOut outputs random characters

    Hi,

    I'm sort of new to the whole Windows API.. I was stuck between posting my thread here or C# forum since my code is in C#.. Anyway, I've injected a .dll and I'm successfully capturing ExTextOut function calls and sending the text to the command prompt window. However, my text from the "lpString" seems to be just all random characters (Is this some kind of pointer or is this the text and it is just in need of some formatting??

    I've been doing some research and have come across similar issues and seen people pass around ETO_GLYPH_INDEX. I'm not sure how to go about using ETO_GLYPH_INDEX? Can anyone give me some insight?

    Thanks

  2. #2
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: ExTextOut outputs random characters

    Without seeing the actual code involved it's difficult to guess what the cause may be. However as a general rule, when passing strings to / from APIs with VB, they have to be passed ByVal since the string variable address in VB is actually the address of the address. If the API is returning a sting you must initialise it (eg fill with spaces) to at least the length of the data to be returned. Not doing this can cause unpredictable results and more often than not VB crashes.

    EDIT: I've just noted that your code is in C, so the above is not going to be of much use! (Sorry about that)

    I suspect a Mod will move this thread to the appropriate forum.
    Last edited by Doogle; Aug 20th, 2010 at 12:14 AM.

  3. #3
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: ExTextOut outputs random characters

    It's an API I've never seen and isn't found on AllAPI. Doubtful any VB people will be able to help with this. Probably best placed in the C# forum, might have a better chance of this being a generic type of problem (like Doogle mentioned with the ByVal stuff).


    Has someone helped you? Then you can Rate their helpful post.

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