Solved

dll add a unit

Posted on 2009-07-11
9
338 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

895 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now