Solved

DDE code kills DDEML.dll and USER.exe

Posted on 1998-03-19
1
242 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

739 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