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
Solved

C Run Time Library Problem in Delphi???

Posted on 2006-06-14
5
359 Views
Last Modified: 2010-04-05
I have developed a DLL using Microsoft Visual C++ .NET 2003 (7.1).  Works fine in the C++ environment, works filein the Visual Basic 7.1 environment.  In Delphi 5, it causes a crash.  Have isolated the crash to an  "xxx = new Object (xxx,xxx)" type statement.  The result is an exception which cannot be caught by "catch (std::exception)", only by "catch (...)", so there is little information available.  Suspect a C runtime library problem.  The DLL I have created references MSVCP71.dll and MSVCR71.dll.  Dependency walker suggests that Delphi 5 is using MSVCRT.dll.

Is the C  run time library my problem?  Is there something else I should look at?  If the C run time library is my problem, how can I compile and link the DLL so it references MSVCRT.dll (or whatever it is that Delphi 5 is using)???   Thanks in advance.

PS>> Just prior to crash, _heapchk (called from within the DLL) says the heap is OK
0
Comment
Question by:doneDad
  • 3
  • 2
5 Comments
 
LVL 10

Expert Comment

by:atul_parmar
ID: 16909492
If it is .Net compiled assembly, it can not be used with Delphi 5. Only Win32 DLL can be used with Delphi 5.
0
 

Author Comment

by:doneDad
ID: 16917006
Thanks for the comment.  The DLL is a "normal" WinTel DLL consisting of compiledfor X86 platform machine code.
0
 
LVL 10

Accepted Solution

by:
atul_parmar earned 500 total points
ID: 16918190
Hi,

The problem is with MSVCR71.dll. (I m not sure about MSVCP71.dll) see
http://support.microsoft.com/kb/326922/en-us

The solution is to put MSVCR71.dll with your applications private directory. If your application is distributable you will also need to distribute the MSVCR71.dll with your application.
0
 

Author Comment

by:doneDad
ID: 16921618
Again, thanks for the comment.  That changed the location of the crash.  I need to track down the new location as I did with the original to see if the crash is still of the same type, or maybe a new and different problem.  It'll be another day or two before I know.
0
 

Author Comment

by:doneDad
ID: 16939070
The new crash location was an unrelated problem.  Putting the MSVCR71.dll in the same directory as the C++ DLL fixed the original porblem.  Thanks foryour help.
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
Process Javascript errors with Delphi TWebBrowser 1 176
Downloading email attachments 2 79
Magic Software info 18 138
MS Access from Delphi 31 60
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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

860 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