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

x
?
Solved

EResNotFound in DLL

Posted on 1997-06-19
2
Medium Priority
?
482 Views
Last Modified: 2011-10-03
I have written a DLL in Delphi 1.2 that reads values over the serial port and then displays them in different graphical formats. I also have an MDI C program (written by someone else) that calls my DLL. USUALLY when there are several MDI Child windows open & some simple disk access has been performed, and then my DLL is called I get an EResNotFound exception. It is trappable, and on the second call to my DLL everything works just fine. The exception occurs during the line: MainForm := TMainForm.Create(Application); Also it ONLY occurs under Windows 3.11, with Windows 95 it works ok. It is not a memory availability problem as there is more than enough around.I am already aware of the StrToFloat problem in Delphi 1 DLL's and I have compensated for it.The problem has an uninitialised memory/wrong segment feel to it, but I can't seem to find out why or where.I would be grateful if anybody can throw any light on the problem at all.
0
Comment
Question by:Ray(2)
[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 Comments
 
LVL 2

Accepted Solution

by:
icampbe1 earned 400 total points
ID: 1337212
It's hard to decide to comment or answer with a question like this.  If you have written the dll in D1 (I assume that you want to run on both Win31 and Win95 platforms) then I'm not sure how applicable the Application object is in the create call within the dll.  You might try creating the mainform with a NIL as the owner parameter.  This necessitates a modal display though.  Is that OK?

Also, look for some var that might have been declared as global within the dll.  A second call under some circumstances will stomp on the previous value of the var.  This should be moved to a procedure where it is local and each call gets its own copy.

Ian C.
0
 

Author Comment

by:Ray(2)
ID: 1337213
Thanks for the suggestion, I have tried using 'nil' instead but the same exception occurs. The DLL is only called from one program, in about 3 different places. The DLL is always modal, ie the DLL must be closed before control is returned to the calling program. Its only a DLL because the main program had to be expanded, and I program in Delphi, the main program was in C. It doesn't really do anything fancy as far as DLL's go. A few pointers get passed, thats about it.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

704 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