Solved

dll add a unit

Posted on 2009-07-11
9
345 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
[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
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
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 …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

688 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