Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Access Violation axctrls.pas

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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

670 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