Solved

C Run Time Library Problem in Delphi???

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

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

911 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