Solved

Access Violation axctrls.pas

Posted on 2003-12-05
3
629 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:
Mohammed Nasman earned 200 total points
ID: 9885919
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
ID: 9886164
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
ID: 12288567
Using the delphi 7 version did not fix the problem.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

685 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