Powered by discountASP.NET
referal ID: sdtref
Why recommend discountASP.NET?

Archives
Steve Trefethen Steve's RSS Feed Subscribe or via email
What's this?
Contact me Send mail to the author(s)
About Me
View my LinkedIn profile

Add to Google
Subscribe with Bloglines
MCP Microsoft Certified Professional

Falafel Software
ActiveFocus Project Management Solution by Falafel Software
Online or OnSite TestComplete Training
Blogroll
Recent Comments
My Online Tools
Stats
Total Posts: 441
This Year: 46
This Month: 2
This Week: 0
Comments: 1526
Tags
Disclaimer
The posts on this weblog are provided �AS IS� with no warranties, and confer no rights. The opinions expressed herein are my own personal opinions and do not represent my employer�s view in any way.
 Sunday, July 24, 2005

Actionbands, Accessibility and the Delphi IDE

Posted @ 9:46AM by Steve Trefethen

Categories: Accessibility | ActionBands | Delphi | IDE | VCL

Tags:  |  |  |  | 

You may or may not know that the Delphi IDE uses the ActionBands VCL components for its main menu and as a result does not support Accessibility (not good, I know). I'm happy to report that with our next release of Delphi this problem has been resolved. We've added MSAA support to the ActionBand components and therefore the IDE's menus will support accessibility. Unfortunately, we're unable to retrofit the technology to work with previous releases although it was considered.

 Tuesday, November 16, 2004

Using the MSAA IAccessible interface within a Delphi Application

Posted @ 12:58PM by Steve Trefethen

Categories: Accessibility

Tags:

I've been investigating Microsoft's IAccessible interface recently and thought I would begin a series of posts related to using IAccessible in a Delphi application from an MSAA server perspective.  From the MSDN:

”The IAccessible interface is the heart of Microsoft Active Accessibility. Applications implement this Component Object Model (COM) interface to represent their custom user interface elements, which can include their client area as accessible objects, if necessary.”

In order to start using IAccessible the first step is to import the oleacc.dll type library which provides us with the necessary interface declarations.  Having dug into this interface a bit I can save you a little time and simply give you the TLIBIMP command line necessary to properly import this type library.

tlibimp -Hs- -Hr- -Ftoleacc -Ps- -O- %systemroot%\SYSTEM32\OLEACC.DLL

If you'd like to import this type library from within the IDE make sure to set Delphi's type library importer so that it does not map the interface declarations as safecall since some of the interfaces require a specific HRESULT.  To do that select Tools|Options and change the Type Library option for “Safecall function mapping” to “Do not map”.

The second step is to check the declaration of NotifyWinEvent API located in Windows.pas to make sure it's correct.  I found that it wasn't declared as stdcall which resulted in an AV whenever I called it.  If you ever find yourself getting an AV when you call a Windows API function double check the declared calling convention of the function import before going any further.

Here is the corrected declaration:

procedure NotifyWinEvent(event: DWORD; hwnd: HWND; idObject, idChild: Longint); stdcall;

Ok, now that we have those two steps out of the way we've opened the door to enabling our Delphi applications through MSAA.  Since this is a fairly large topic I'm going try and tackle it in small pieces so stay tuned for the next step.  In a future post I'll begin to discuss actually putting this interface to use.

[UPDATED: Dec 2, 2004 2:14pm PST] Chris Hesik of the Delphi development team has written this article where he discusses, among other things, one method for debugging calling convention declaration errors.