Solved

Access Violation axctrls.pas

Posted on 2003-12-05
3
630 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi Form ownership 4 160
HTML text in the body of an email (delphi code) 12 262
Magic Software info 18 156
TAction.OnAfterExecute? 2 32
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

752 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