Solved

EResNotFound in DLL

Posted on 1997-06-19
2
451 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)
2 Comments
 
LVL 2

Accepted Solution

by:
icampbe1 earned 200 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 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