Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
i have a ocx with vc6,and no error when run this ocx in windows2003 and winXp ,now i want to run in win7,and i find some wrong when test this ocx in TSTCON32.EXE , and i found the error where i run to AddButtons. the error dlg is shown with the words like "Unhandle exception in TSTCON32.EXE(kernel32.dll) 0xC0000005 Access Violation". someone can help me? many thanks.

and the flowwing is the code :
CToolBar m_ToolBar;
CToolBarCtrl  objToolBarCtrl = m_ToolBar.GetToolBarCtrl();
TBBUTTON objButton;
 
objButton.idCommand = IDB_ANSWER;
objButton.iBitmap = 0;
objButton.fsStyle = TBSTYLE_BUTTON;
objButton.fsState = TBSTATE_ENABLED;
 
objToolBarCtrl.AddButtons(1, &objButton);
Posted
Updated 23-Jul-12 16:49pm
v2

ocx -> runs in Internet Explorer?

So check the privileges of the process which run this code. (and try with higher rights)

I guess the problem is, that some SendMessage has no rights to send the message for some security issues.

Alter the process rights or think about other ways to accomplish your "use case".
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900