Results 1 to 3 of 3

Thread: BSTR problem

  1. #1

    Thread Starter
    Lively Member The_Fog's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Posts
    65

    BSTR problem

    Using vc++ 6.0 I've initialized 1 bstr

    Code:
    BSTR *sRes;
    After that, I put some text in it:

    Code:
    *sRes = SysAllocString(OLESTR("Root->Left != NULL:Root->Right != NULL"));
    But here comes the tricky part.. I want to add more text into the String..
    But how?

    Anyone got an idea?
    They will try to steal everything you own,
    It goes on and on and on...


    Pain - On and On

  2. #2
    Banned jhermiz's Avatar
    Join Date
    Jun 2002
    Location
    Antarctica
    Posts
    2,492
    Im not too familiar with Windows C++ but generally in the ANSI C++ language you can reallocate memory if needed.

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    I think there is a function called SysReallocString or something like that.

    BTW, do
    BSTR sRes = SysAll...

    else you have a loose pointer.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

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