Solved

DDE code kills DDEML.dll and USER.exe

Posted on 1998-03-19
1
246 Views
Last Modified: 2013-11-19
why does this code eat memory and wind up GPFing the system?


CheckDlg::OnOK()
{
        // TODO: Add extra validation here
        DWORD pidInst =0;
        WORD result = DdeInitialize(&pidInst,DdeCallback,APPCMD_CLIENTONLY
,0L);
       
        //create a string handle for the Dde conversation
        HSZ server = DdeCreateStringHandle(pidInst,"MrktLink",CP_WINANSI);
       
        HSZ topic = DdeCreateStringHandle(pidInst,"Rates",CP_WINANSI);

        //connect to the DDE server application
        HCONV thisconv = DdeConnect(pidInst,server,topic,NULL);
        bool ok =  (thisconv !=NULL);

        DdeFreeStringHandle(pidInst,server);
        DdeFreeStringHandle(pidInst,topic);
        int t =0;
        HSZ item = DdeCreateStringHandle(pidInst,"NZD",CP_WINANSI);
        m_TOTAL=0;
        while (t <20)
        {
                HDDEDATA nzdat = DdeCreateDataHandle(pidInst,0,0,0,item,CF_
TEXT,NULL);
                LPDWORD result =0;
                nzdat = DdeClientTransaction(NULL,0L,thisconv,item,CF_TEXT,XT
YP_REQUEST,1200,result);
                LPDWORD sizereturned=0;
                CString tempText2 =(CString) DdeAccessData(nzdat,sizereturned);
                DdeUnaccessData(nzdat);
                DdeFreedataHandle(nzdat);
                m_RESULT = tempText2;
                m_TOTAL +=1;
                UpdateData(false);
        }
0
Comment
Question by:bryceb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
byang earned 100 total points
ID: 1317097
You never updated "t" in the while loop, so (t<20) is always true. That's an endless loop at least.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question