Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

C Run Time Library Problem in Delphi???

Posted on 2006-06-14
5
Medium Priority
?
381 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
[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
  • 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 2000 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

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

721 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