Wrox Programmer Forums
|
BOOK: Ivor Horton's Beginning Visual C++ 2005
This is the forum to discuss the Wrox book Ivor Horton's Beginning Visual C++ 2005 by Ivor Horton; ISBN: 9780764571978
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Ivor Horton's Beginning Visual C++ 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 25th, 2008, 12:30 PM
Authorized User
 
Join Date: Oct 2005
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need Solution to Chapter 20

I'm having a great deal of difficulty following what's going on in Chapter 20. I'm getting confused between company name and customer name, which he seems to use interchangeably. There are other inconsistencies with the naming of controls that are confusing me too.

My code wouldn't compile.

I compared my code with his and altered it where they differed. I also renamed the controls where I found differences in the names. This time it compiled, but I'm getting a run-time error in file dlgdata.cpp where it asserts false because pSite is NULL.

HWND CDataExchange::PrepareCtrl(int nIDC)
{
    ASSERT(nIDC != 0);
    ASSERT(nIDC != -1); // not allowed
    HWND hWndCtrl;
   COleControlSite* pSite = NULL;
    m_pDlgWnd->GetDlgItem(nIDC, &hWndCtrl);
    if (hWndCtrl == NULL)
    {
      // Could be a windowless OCX
      pSite = m_pDlgWnd->GetOleControlSite(nIDC);
      if (pSite == NULL)
      {
           TRACE(traceAppMsg, 0, "Error: no data exchange control with ID 0x%04X.\n", nIDC);
           ASSERT(FALSE);
           AfxThrowNotSupportedException();
      }
    }
    m_idLastControl = nIDC;
    m_bEditLastControl = FALSE; // not an edit item by default

   return hWndCtrl;
}

Does anyone have the solution to this and would I be able to use it if I altered the database path to my machine?


Dan Crossley
__________________
Dan Crossley
 
Old January 26th, 2008, 08:12 AM
Authorized User
 
Join Date: Oct 2005
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've fixed it.

In Figure 20-15, page 1007, the name of the Cancel button should be "IDC_CANCEL", not "IDC_CANCELORDER", in order to match the code from the book and for it to run correctly. Similarly, in Figure 20-17 the name of the edit box to the right of the "Order ID" label should be "IDC_NEWORDERID", not "IDC_NEWORDER_ID". Also in Figure 20-17, the name "IDC_PRODCUCTNAME" should obviously be "IDC_PRODUCTNAME".

Dan Crossley





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 20 Problem with PictureInfo joergUmbricht BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 0 September 30th, 2007 02:57 AM
Chapter 20 WebService: My.Request joergUmbricht BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 0 September 30th, 2007 02:44 AM
chapter 20 basic authentication egivler BOOK: Beginning ASP.NET 1.0 3 June 29th, 2004 09:16 PM
Chapter 20 masegui JSP Basics 0 April 1st, 2004 07:54 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.