Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Access Violation axctrls.pas

Posted on 2003-12-05
3
Medium Priority
?
634 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 600 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Integration Management Part 2
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

877 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