CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 1999
    Posts
    1

    new -- Program hanging at the new statement



    Hi,

    Guys my program and computer is hanging at the new statement (when I am trying to

    allocate memory for a charecter pointer). When I tried to debug through the new

    statement, I found that my program is hangin at HeapAlloc call (which is called

    from the dbg_alloc). Please give your suggestion regarding this


    waiting for your help



  2. #2
    Join Date
    Apr 1999
    Posts
    2

    Re: new -- Program hanging at the new statement



    Hi,


    i think the problem could be the place where you use 'new' operator. if it is outside the scope of the pointer you may get the problem. same problem i got long back.


    Pol Pal

  3. #3
    Join Date
    Apr 1999
    Posts
    1

    Re: new -- Program hanging at the new statement





    Just check the scope of the pointer.




  4. #4
    Join Date
    Apr 1999
    Posts
    2

    Re: new -- Program hanging at the new statement





    Murali,

    sorry for my poor english.


    problem could be with the pointer declaration or you may be overwriting the pointer. use realloc .




  5. #5
    Join Date
    Apr 1999
    Posts
    1

    Re: new -- Program hanging at the new statement





    May be using globally declared pointer

  6. #6
    Join Date
    Apr 1999
    Posts
    30

    Re: new -- Program hanging at the new statement



    Use a

    try

    {

    }

    catch(CMemoryException* e)

    {

    e -> ReportError();

    }

    on it and check the error

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

Featured