Delphi Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreDelphi Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 28th, 2013, 09:58 AM
Seedling Seedling is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 1 Seedling User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 15 sec
Reputation Power: 0
Delphi 7 Automation library weird bug

I've noticed a recurring bug in Delphi 7 that is really puzzling me.

What happens is, I'm testing an "ActiveX library" project (running a Delphi 7 executable, also within the project group), and occasionally rebuilding the library project will cause functions to be duped in the co-class .pas file. The functions that are duped are redirected via those duped functions, but these are empty inside. And if it's a function that returns an IDispatch, it omits the word IDispatch.. resulting in build error messages.

Code:
    function ReadFile(const FileName: WideString; var MapFileRec: IMapFileRec;
      var bSupport: WordBool): IDispatch; safecall;
    function TranslateFromNativeFormat(const FileRec: IMapFileRec): IDispatch;
      safecall;
    function TranslateToNativeFormat(const SemiMapData: IDispatch;
      FormatType: TMWHFileDataType): IMapFileRec; safecall;
    procedure WriteFile(const aSemiMapData: IDispatch;
      const FileName: WideString; FileType: TMWHFileDataType); safecall;  function ISemiMapFile.ReadFile = ISemiMapFile_ReadFile;
    function ISemiMapFile.TranslateFromNativeFormat = ISemiMapFile_TranslateFromNativeFormat;
    function ISemiMapFile.TranslateToNativeFormat = ISemiMapFile_TranslateToNativeFormat;
  
    function ISemiMapFile_ReadFile(const FileName: WideString;
      var MapFileRec: IMapFileRec; var bSupport: WordBool): ; safecall;
    function ISemiMapFile_TranslateFromNativeFormat(
      const FileRec: IMapFileRec): ; safecall;
    function ISemiMapFile_TranslateToNativeFormat(const SemiMapData;
      FormatType: TMWHFileDataType): IMapFileRec; safecall;

And the following is added in the implementation section:
Code:
function TSemiMapFile.ISemiMapFile_ReadFile(const FileName: WideString;
  var MapFileRec: IMapFileRec; var bSupport: WordBool): ;
begin

end;

function TSemiMapFile.ISemiMapFile_TranslateFromNativeFormat(
  const FileRec: IMapFileRec): ;
begin

end;

function TSemiMapFile.ISemiMapFile_TranslateToNativeFormat(
  const SemiMapData; FormatType: TMWHFileDataType): IMapFileRec;
begin

end;


This example caused a build error, so it's easily spotted and fixed, but I've had occurances where functions were effectively dummied out because of the dupes with me none the wiser (until the software started to fail where it didn't before).

It would be nice to know if anyone ever has had similar issues, and a way to steer away from the iceburg, rather then patch the holes as they appear.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreDelphi Programming > Delphi 7 Automation library weird bug

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap