Results 1 to 6 of 6

Thread: Crashing help!!! [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Location
    Basingstoke
    Posts
    86

    Question Crashing help!!! [RESOLVED]

    The below code causes my VB code to crash with the ' The memory could not be "read" ' error.

    BSTR WINAPI FormatID(HWND hWnd, LPCSTR sLine)
    {
    char *tmp = new char[strlen(sLine)];
    int n;

    n = <to be calculated>;
    strcpy(tmp, sLine);
    return BSTR(tmp[n]);
    }

    What I am trying to do is get the n'th character from sLine.

    Any ideas, thanks in advanced.
    Last edited by DrHippyHomer; Dec 9th, 2002 at 04:41 AM.

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