Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > Visual C++ 2005
|
Visual C++ 2005 For discussion of Visual C++ 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the 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 July 27th, 2007, 03:59 PM
Registered User
 
Join Date: Jul 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Run error while using CDTPicker

I have used the CDTPicker (an OLE VB control) in a few applications for some years now without the slightest problem. However, I am trying to add it to an app that I wrote some time ago under VS 6.0. We have upgraded to VS 8.0 and converted the project seemingly without any problems.

I have added the CDTPicker to the old app and it appears on the dialog after the DoModal() sequence, the control works just fine with it's dropdown and so on, but when I go to programmatically change the date in the control (or read the date as well) I get an assert condition in the following MFC code:

ASSERT(m_pCtrlSite != NULL); // not an OLE control (not yet, at least)

which is inside:

void AFX_CDECL CWnd::InvokeHelper(DISPID dwDispID, WORD wFlags, VARTYPE vtRet,
void* pvRet, const BYTE* pbParamInfo, ...)
{
ASSERT(m_pCtrlSite != NULL); // not an OLE control (not yet, at least)

if (m_pCtrlSite == NULL)
return;
}

This is because m_pCtrlSite is still NULL!

I can run (in debug) one of the applications that I have already used CDTPicker on in the past and it works perfectly and m_pCtrlSite is inited properly. I am working on the very same machine with two instances of VS running with different results for the same control.

In my debug I have:
1. copied the control from one resource editor to the other,
2. ensured that the same GUID is used to create the control in the xxx.rc file,
3. ensured that all of the values in the objects are valid through the Watch window (except m_pCtrlSite that is failing, of course)
4. compared project settings to find anything different to blame this on!

Most postings that I have read here and elsewhere state simply that the OnInitDialog() has not been completed for the dialog and the control hasn't been init'd, but I am completely through with that and the dialog page exists, with the CDTPicker controls all functioning visually before I execute the code that tries to read or write values to/from the control.

The ASSERT always fires, and the value of m_pCtrlSite is zero always, no matter where in the code I might be.

Any suggestions???

Thanks in advance!

Regards,

David





Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Query Error & Run-Time Error 3022 DavidWE Access 1 July 31st, 2008 11:17 AM
Error ! When i was trying to run aeroboy32000 Visual Studio 2008 1 January 12th, 2008 02:11 PM
Error trying to run the TBH kiekar BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 6 May 19th, 2006 03:34 PM
error when i try to run these files, anyone? anpham ASP.NET 1.0 and 1.1 Basics 1 June 27th, 2005 09:16 PM
run time error ashishroyk Java GUI 0 October 8th, 2004 01:42 AM





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