• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 336
  • Last Modified:

Assertion Failure in OCX

I encounter an "Assertion Debug Failure" when deleting an ocx from a dialog box with "Afxwin1.inl" "Line : 558" error message. Can anyone tell me what has gone wrong?
0
KeithTeo
Asked:
KeithTeo
  • 2
1 Solution
 
chensuCommented:
Nobody can tell you what is wrong with so little information.
0
 
ZoppoCommented:
Hi KeithTeo,

After a look int afxwin1.inl(line 558) I at least can tell you the problem is that somehow a CDC::SelectObject(CBitmap*) is called against a CDC object with a m_hDC == NULL               :)

I would think a OnDestroy function is trying to select a previously 'unselected' bitmap into a dc without testing the return value from GetDC() or something else ...

hope that helps,

ZOPPO
0
 
chensuCommented:
The content of line 558 may vary with different versions of Visual C++.
0
 
KeithTeoAuthor Commented:
Thanks. You are right. I did try to delete a bitmap CDC object with a m_hDC == NULL. I manage to solve that already. Appreciated your help.
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now