CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2008
    Posts
    4

    [RESOLVED] Runtime terminated in an unusual way

    Hi.
    I'm doing a function that returns an array with some registry values, and I have a problem converting the values. It compiles fine, but when I execute it, it gives me this error: This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.

    I've been located the problem, I write here the code
    Code:
    for(i=0; i<vSize; i++);
    {
    	//Here stops.
            temp.Name = (const char*)vFromLM[i].Value;
    	temp.Path = (const char*)vFromLM[i].Data;
    	Apps.AddNode(temp);
    }
    The variables I use are

    Code:
    struct App
    {
    	string Path;		
    	HKEY Location;		
    	string Name;		
    };
    
    struct ValueData
    {
    	BYTE Data	[2048];
    	TCHAR Value [255];
    };
    
    App temp;
    LinkedList<ValueData> vFromLM;
    The operator[] of LinkedList returns a reference to ValueData.

    I don't know how to fix this, can anyone help me?

  2. #2
    Join Date
    Aug 2008
    Location
    Germany / NRW
    Posts
    37

    Re: Runtime terminated in an unusual way

    Try not to assign values, you should copy your string using lstrcpyW() / wcscpy() / strcpy() / StringCchCopy() or a similar function.

    Copy the byte array with memcpy() / wmemcpy() or a similar function.

  3. #3
    Join Date
    Dec 2008
    Posts
    4

    Re: Runtime terminated in an unusual way

    Thanks, I resolved it. It wasn't problem of assignment, but the list was empty.

Tags for this Thread

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