Click here to Skip to main content
15,921,452 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralProblems with Platform SDK Pin
Stephen Kellett16-Sep-00 5:26
Stephen Kellett16-Sep-00 5:26 
GeneralRe: Problems with Platform SDK Pin
mg29-Sep-00 6:45
mg29-Sep-00 6:45 
GeneralTransparentBlt Pin
David15-Sep-00 18:41
David15-Sep-00 18:41 
GeneralDialog resolution Pin
Roger15-Sep-00 7:40
Roger15-Sep-00 7:40 
GeneralRe: Dialog resolution Pin
Mustafa Demirhan16-Sep-00 0:00
Mustafa Demirhan16-Sep-00 0:00 
GeneralISAPI Pin
Ed K19-Sep-00 12:19
Ed K19-Sep-00 12:19 
GeneralRe: ISAPI Pin
Member 120896520-Sep-00 14:01
Member 120896520-Sep-00 14:01 
GeneralFailure to Register DropTarget only on HP Vectra and Win 2000 Pin
Member 1031214815-Sep-00 6:13
Member 1031214815-Sep-00 6:13 
I have a unique problem that is only showing up when I run Chris's grid control under windows 2000 on a HP Vectra. I can not reproduce in under any other condition.

This involves the Drag Drop registration. On the HP the registration fails on the first call.
Initially it appeared that the window handle was incorrect but this is not the case.
The grid has a proper handle and the drop target is null. In tracing the code (on the HP)

Chris's code

BOOL CGridDropTarget::Register(CGridCtrl *pGridCtrl)
{
if (m_bRegistered)
return FALSE;

// Stop re-entry problems
static BOOL bInProcedure = FALSE;
if (bInProcedure)
return FALSE;
bInProcedure = TRUE;

ASSERT(pGridCtrl->IsKindOf(RUNTIME_CLASS(CGridCtrl)));
ASSERT(pGridCtrl);

if (!pGridCtrl || !pGridCtrl->IsKindOf(RUNTIME_CLASS(CGridCtrl)))
{
bInProcedure = FALSE;
return FALSE;
}

m_pGridCtrl = pGridCtrl;

ASSERT (COleDropTarget::m_hWnd==NULL); // OK HERE
m_bRegistered = COleDropTarget::Register(pGridCtrl); // THis call failes on the HP

bInProcedure = FALSE;
return m_bRegistered;
}

COleDropTraget Code:

BOOL COleDropTarget::Register(CWnd* pWnd)
{
ASSERT_VALID(this);
ASSERT(m_hWnd == NULL); // registering drop target twice?
ASSERT_VALID(pWnd);

LPUNKNOWN lpUnknown = (LPUNKNOWN)GetInterface(&IID_IUnknown);
ASSERT(lpUnknown != NULL);

// the object must be locked externally to keep LRPC connections alive
if (CoLockObjectExternal(lpUnknown, TRUE, FALSE) != S_OK)
return FALSE;

// connect the HWND to the IDropTarget implementation
if (RegisterDragDrop(pWnd->m_hWnd,
(LPDROPTARGET)GetInterface(&IID_IDropTarget)) != S_OK)
// Failure here but when should it not??
{
CoLockObjectExternal(lpUnknown, FALSE, FALSE);
return FALSE;
}

// connect internal data
m_hWnd = pWnd->m_hWnd;
ASSERT(pWnd->m_pDropTarget == NULL);
pWnd->m_pDropTarget = this;

return TRUE;
}

In RegisterDragDrop:
The first argument is the handle to the window that excepts the drop.

Now the trace gets "lost" in the os at this point. On the HP the next viewable code in the call stack following the assert is in a CWnd::Attach with the handle of the grid and it asserts since it is not null. It seems that this should have been the handle to the droptarget.
So what is wrong with the HP's to link in this code or why does it not fail on all platforms???

On other platforms it step right though this section with no problems and all handles appear to the consistent.

I have tried this under win 2k on two other (non-HP) machines and under ME and NT4 on this HP machine and they work fine.

Anyone else having experience with this?

Thanks Mike
General*** Changing Title of a Document Frame **** Pin
Steve Lai15-Sep-00 6:02
Steve Lai15-Sep-00 6:02 
GeneralRe: *** Changing Title of a Document Frame **** Pin
Member 120896515-Sep-00 6:36
Member 120896515-Sep-00 6:36 
GeneralRe: *** Changing Title of a Document Frame **** Pin
Sam Hobbs15-Sep-00 10:41
Sam Hobbs15-Sep-00 10:41 
GeneralRe: *** Changing Title of a Document Frame **** Pin
Member 120896515-Sep-00 11:03
Member 120896515-Sep-00 11:03 
GeneralRe: *** Changing Title of a Document Frame **** Pin
Sam Hobbs15-Sep-00 10:48
Sam Hobbs15-Sep-00 10:48 
GeneralCD-ROM access Pin
Roger15-Sep-00 5:28
Roger15-Sep-00 5:28 
GeneralRe: CD-ROM access Pin
Paolo Messina16-Sep-00 23:08
professionalPaolo Messina16-Sep-00 23:08 
GeneralColors in visual c++ MFC Pin
Fredrik15-Sep-00 0:57
Fredrik15-Sep-00 0:57 
GeneralRe: Colors in visual c++ MFC Pin
Mustafa Demirhan15-Sep-00 4:52
Mustafa Demirhan15-Sep-00 4:52 
GeneralCustomized CFileDialog Pin
philippe dykmans15-Sep-00 0:10
philippe dykmans15-Sep-00 0:10 
GeneralPrint and Print Preview controls within a CView Pin
Cameron Stevens14-Sep-00 18:52
Cameron Stevens14-Sep-00 18:52 
GeneralDrag/Drop objects from one document to other documents in MDI App. Pin
Bermusa14-Sep-00 4:13
Bermusa14-Sep-00 4:13 
GeneralRe: Drag/Drop objects from one document to other documents in MDI App. Pin
Erik Funkenbusch19-Sep-00 13:14
Erik Funkenbusch19-Sep-00 13:14 
GeneralRe: Drag/Drop objects from one document to other documents in MDI App. Pin
Bermusa19-Sep-00 17:12
Bermusa19-Sep-00 17:12 
GeneralModeless dialog boxes Pin
nimrod14-Sep-00 1:26
nimrod14-Sep-00 1:26 
GeneralRe: Modeless dialog boxes Pin
Mustafa Demirhan14-Sep-00 10:01
Mustafa Demirhan14-Sep-00 10:01 
GeneralRe: Modeless dialog boxes Pin
Sam Hobbs14-Sep-00 10:59
Sam Hobbs14-Sep-00 10:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.