Solved

Access Violation axctrls.pas

Posted on 2003-12-05
3
623 Views
Last Modified: 2008-02-01


  I am using Delphi 5 to create an active form that runs inside of a webpage.  It runs fine 99% of the time.

However, I occasionally get an access violation on the following line in the axctrls.pas unit.

//...

function TActiveFormControl.ObjQueryInterface(const IID: TGUID; out Obj): HResult;
begin
  Result := S_OK;
  if not Control.GetInterface(IID, Obj) then  //<-------------- access violation on this line.
    Result := inherited ObjQueryInterface(IID, Obj);
end;

//...


Any ideas what could be causing this?

I have heard that there are activeX related bugs in Delphi5.  Can anyone confirm whether this is something that could be fixed with an upgrade to Delphi7?

If anyone has Delphi7, does the implementation of this function look differrent?

Thank you.  
 
0
Comment
Question by:wolsen
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
mnasman earned 200 total points
Comment Utility
Here's the implementation of the function in Delphi 7

function TActiveFormControl.ObjQueryInterface(const IID: TGUID; out Obj): HResult;
begin
  Result := S_OK;
  if IsEqualGUID(IID, IUnknown) or not Control.GetInterface(IID, Obj) then
    Result := inherited ObjQueryInterface(IID, Obj);
end;

I'm not sure if that will solve your problem, but HTH
0
 
LVL 2

Author Comment

by:wolsen
Comment Utility
Thank you.

Yes, this looks differrent from the Delphi5 implementation:

function TActiveFormControl.ObjQueryInterface(const IID: TGUID; out Obj): HResult;
begin
  Result := S_OK;
  if not Control.GetInterface(IID, Obj) then
    Result := inherited ObjQueryInterface(IID, Obj);
end;

The access violation occurs at Control.GetInterface(IID, Obj). So, as long as the second half of the or statement does not get evaluated, it should be fine?

I will try using the delphi 7 version, and see how it works.
0
 
LVL 2

Author Comment

by:wolsen
Comment Utility
Using the delphi 7 version did not fix the problem.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now