Solved

dll add a unit

Posted on 2009-07-11
9
340 Views
Last Modified: 2012-05-07
I'm still working on a dll with delphi. I try just to add a unit to that dll and get an application excetion, see the madshi screen dumps for details.
This unit contains a class  TPointList = Class (TList) with several functions, this unit is already used by 3 other programs without any strange behaviour or known bug.
I  could add another unit with a simillar list like TPointList without any problem to my dll project.

do not expect a complete solution for the answer to this post, any good idea on debugging and finding the reason is welcome.

ee-dll-1.jpg
ee-dll-2.jpg
0
Comment
Question by:BdLm
  • 5
  • 3
9 Comments
 
LVL 22

Accepted Solution

by:
8080_Diver earned 125 total points
ID: 24836599
The error message is pretty much telling you what the problem is, the trick is in combining an accurate interpretation of the message with what you are trick ing do in the DLL.  I am forced to guess on some of this though.
This sounds a bit like you are trying to create something in your application directly from the code in the DLL.  The problem may also be that you are trying to refer to the DLL's TPointList directly rather than through functions/procedures which are exposed by the DLL.
Is this unit a dynamically loaded DLL or a statically lodaed one?
0
 
LVL 21

Assisted Solution

by:developmentguru
developmentguru earned 375 total points
ID: 24859991
 I would load Delphi with the source of the DLL and place breakpoints on all of the calls, set the Host application (under Run | Parameters) to the test program and run it.  This will allow you to step through the calls within the DLL and see if the error is explained that way.

  The most common issue I have seen with DLLs causing unknown exceptions is a misaligned call stack.  To check this I generally check the size of the data being pushed onto the stack versus the amount being taken off the stack by the DLL function (you must use the CPU view to do this).  If the two sizes do not match up then you know you have a parameter size mismatch which is causing a stack misalignment.  This can cause a wide range of error types.
0
 
LVL 8

Author Comment

by:BdLm
ID: 24867013
may be I found a hot hint on the error root cause, assume it is the free pnp image lib, more to come shortly
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 8

Author Comment

by:BdLm
ID: 24874203
the reason: I used a few units which included QDialog, QGraphics  and a few other which used dialog, graphics, ...
now I deleted all the q-Units from Borland and used the default version, the dll is now running a bit more  :-)

I did not understand why applications did not claim or create run time errors the dll is failing to compile ....
0
 
LVL 21

Assisted Solution

by:developmentguru
developmentguru earned 375 total points
ID: 24878371
It is likely failing to compile due to the components you removed that it was using.  Did you want help making it compile without the extra components?
0
 
LVL 8

Author Comment

by:BdLm
ID: 24878389
thanks for the offer, compile is now no problem, but I have to eval the other APPS IF SOMETHING HAPPEND while changing so many include files ,   this will be a time break on this question
0
 
LVL 8

Author Comment

by:BdLm
ID: 25057894
Hi,

after removing QForms by Forms, can compile and run that DLL project.
What to to with your points ?

Can someone explain why QForms and Forms do not beat each other inside a APP but a fatal if used inside a DLL ? That  makes sense to accept as the answer ...  OK for you both?



Best

B.


0
 
LVL 21

Assisted Solution

by:developmentguru
developmentguru earned 375 total points
ID: 25074981
I am unfamiliar with QForms.  I would be more likely to believe that there is a bug in QForms that is causing the problem within the DLL.  If I were you I would be curious to put back as little QForms functionality as I could and try to determine which piece of functionality causes the error to re-occur.

If we helped you to arrive at a solution, split out the points based on who was the most help.
0
 
LVL 8

Author Closing Comment

by:BdLm
ID: 31602480
the solutution was QForms and Forms interaction, anyhow the tips posted are helpful ,
not sure if only a Delphi 7 issue or also other versions are affected
Thanks,
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

785 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