Solved

EResNotFound in DLL

Posted on 1997-06-19
2
457 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

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

Title # Comments Views Activity
IExtractImage Delphi 14 205
calling Tcolordialog in dll make the form disappear 8 103
Process Javascript errors with Delphi TWebBrowser 1 113
Delphi application Soap connection 5 96
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
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 …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

920 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

15 Experts available now in Live!

Get 1:1 Help Now