473,406 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

AfxHookWindowCreate problem with activex object on windows form

hello fellow programmers,

can anyone help me with the following problem. I have a activex control
embedded on a windows form in C#. When I make the form an mdichild of the
parent application, I get an exception in wincore.cpp on line 626. If the
form is neither modal or a child, the is no problem, the form displays and
the control is functional. However, if I settle for this, the form will not
be inside the application frames container, and just will float on the
desktop. Below I have attached the wincore.cpp code where the failure occurs.
It occurs on the following statement:
"ASSERT(pThreadState->m_hHookOldCbtFilter != NULL); ". When I try to debug,
managed code will not allow me to step into the interop.activex.dll. How do
I solve this?
void AFXAPI AfxHookWindowCreate(CWnd* pWnd)
{
_AFX_THREAD_STATE* pThreadState = _afxThreadState.GetData();
if (pThreadState->m_pWndInit == pWnd)
return;

if (pThreadState->m_hHookOldCbtFilter == NULL)
{
pThreadState->m_hHookOldCbtFilter = ::SetWindowsHookEx(WH_CBT,
_AfxCbtFilterHook, NULL, ::GetCurrentThreadId());
if (pThreadState->m_hHookOldCbtFilter == NULL)
AfxThrowMemoryException();
}
ASSERT(pThreadState->m_hHookOldCbtFilter != NULL);
ASSERT(pWnd != NULL);
ASSERT(pWnd->m_hWnd == NULL); // only do once

ASSERT(pThreadState->m_pWndInit == NULL); // hook not already in progress
pThreadState->m_pWndInit = pWnd;
}


Nov 17 '05 #1
0 1873

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: rufus | last post by:
Hi, On the project I am working on we need to encapsulate all data and business logic in an activex dll. My question is: How do I do this? How can I access the form objects ie text boxes,...
3
by: Ben Taylor | last post by:
Hi I am trying to build, more for a learning project than anything, an ASP.NET web application in C# that will run on my local machine, which has now successully got IIS installed on it (XP pro)....
2
by: Christian Kreimer | last post by:
Hi I created an C# windows forms application that holds a user control. The user control itself is an editor for geographical information systems and is based on an ActiveX Library for providing...
0
by: Brett | last post by:
I'm trying to use an ActiveX control that works fine in VB.NET but not in C#. The VB projects places the ActiveX control on a form. The C# project doesn't because the control is used in a non...
0
by: ann | last post by:
Hi, I am trying to add an ActiveX control on my ASP.NET web form (the language for code behind is C#). I have some client-side vbscript to handle events from the html input buttons. In the...
2
by: Miky | last post by:
Hi, I have the following problem: I have a .CFM web page and I have to populate, from VB, two textboxes on it. I was thinking using sendkeys (even if I don't like it too much) but when I...
4
by: david | last post by:
I could not find the option to do it. Anyone know it? Example?Thank you. By the way, how to add an ActiveX Control to a html file? Example? Thank you. David
16
by: bloggsfred00 | last post by:
I need to read incoming bytes on a COM port but I do not want to have the script hang if there is nothing to read. Is there any way to have PHP interrogate a COM port buffer to see if there is...
2
by: deccio | last post by:
I have create an activex Control with Visual studio 2005 and framework 2.0 in c# to add drag & drop functionality to upload multi file. When I use it in a windows form it work fine. Infact if I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.