Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

DDE code kills DDEML.dll and USER.exe

Posted on 1998-03-19
1
Medium Priority
?
252 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 200 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

649 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