Solved

EResNotFound in DLL

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi Form ownership 4 125
LAN or WAN ? 11 106
DBGrid or StringGrid ? 6 120
Multi-layered image in FireMonkey 9 67
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

749 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