Solved

C Run Time Library Problem in Delphi???

Posted on 2006-06-14
5
354 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

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…
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…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

813 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

17 Experts available now in Live!

Get 1:1 Help Now