Solved

conversion of ms vc++ 5.0 project to build a dll via wizard to borland -

Posted on 2000-05-03
6
173 Views
Last Modified: 2010-04-02
Hello.

I have a .dsp (a file that represents an microsoft project) which is used to build a dll to interface with a product I need to interface with. The product vendor supplies the code for a "bare" dll, and you can put your own goodies in it at different interface points - i.e. function1 might be called at startup, function2 when the user does a common action in the product, etc.

I tried using the wizard to convert ms projects to borland, but I get at link time the error:

[LINKER ERROR] Unable to open file 'OLDNAMES.LIB'

I don't see this file in the project manager anywhere... can anyone explain why it is there, how I can remove it, and why I should or should not remove it?

Thanks Much!

Jeff Kish
0
Comment
Question by:kishj
  • 3
  • 2
6 Comments
 
LVL 30

Expert Comment

by:Zoppo
Comment Utility
Hi kishj,

I found following in MSDN about oldnames.lib:

----------------------------------------------------------------------------------------------------------------------
Backward Compatibility
The compiler views a structure that has both an old name and a new name as two different types. You cannot copy from an old structure type to a new structure type. Old prototypes that take struct pointers use the old struct names in the prototype.

For compatibility with Microsoft C professional development system version 6.0 and earlier Microsoft C versions, the library OLDNAMES.LIB maps old names to new names. For instance, open maps to _open. You must explicitly link with OLDNAMES.LIB only when you compile with the following combinations of command-line options:

/Zl (omit default library name from object file) and /Ze (the default — use Microsoft extensions)

/link (linker-control), /NOD (no default-library search), and /Ze
For more information about compiler command-line options, see Compiler Reference in the Visual C++ Programmer’s Guide.
----------------------------------------------------------------------------------------------------------------------

It seems that VC++ uses this OLDNAMES.LIB as a default library.
I don't know if it would be helpful sending you this lib. If you want to try it, post your email here (but I'll have to go in about half an hour, so I don't know if I can do it today).

I don't know anything about borland's libs but perhaps there's a lib for this purpose too...

hope that helps,

ZOPPO
0
 
LVL 14

Expert Comment

by:AlexVirochovsky
Comment Utility
1. I think, best way: forget about dsp file and make you own IDE : it is very simple.
2. If i understand right, you want use
some DLL, maked by VS, in BC. It is not very easy:
  2.1. You can use LoadLibrary
  2.2  If you want use lib files:
      With help of  impdef.exe make DEF
      file and change it by BC rules.
      With help of implib.exe and def
file make lib file and insert in in you
      project.
0
 

Author Comment

by:kishj
Comment Utility
Adjusted points from 100 to 130
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:kishj
Comment Utility
Not quite sure I stated my issue correctly. Thanks for responding. Here it is again.

A Customer of ours buys cmms system from company. Lets call the product MAX.
When the customer runs MAX, it uses MAX.DLL.
Functions in MAX.DLL are called when MAX starts up, terminates, and also whenever it realizes the user is doing something significant in the application. These functions in the MAX.DLL are called entry points.

The cmms company includes source code and a .dsp file for MAX.DLL which does nothing right now. This means that anyone can rebuild MAX.DLL and stick goodies in it.

To integrate my application with the customers MAX product they purchased, I need to put goodies in the MAX.DLL - however I use Borland tools.

I am having difficulty figuring out how to write the dll using Borland such that the dll will look the same as far as the interface goes (the functions that make up the entry points) - you know .. what I need to do to headers and def files, etc. to make the borland output dll ok to use.

I am looking for a simple example possibly.

Either this or I can try to compile the dll using VC 5.0 and build new functions in a borland dll and try to call the new functions from the vc 50 built dll. (yeah I have vc 5.0, but I really don't want to rely on it).

A function in the VC 5.0 code might look like this:

BOOL WINAPI LibInit( BOOL  bFirstInit,
                       LPCSTR Information,,
                       LPCSTR MoreInformation)

Hope this is clearer - thanks for reading.

Jeff
0
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 130 total points
Comment Utility
Make dll in BC very simple: you
chouse "dll" type in TargetExpert,
inlude you text, it is all!
After link BC creates lib file, too,
that you can use for call functions
from dll.
Examples you can find in BC5\examples\wondows\dlldemo directory, or
i can send you(write you EMail).
0
 

Author Comment

by:kishj
Comment Utility
The end solution was not so easy as you proposed, but close. Thanks for your time.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

772 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

10 Experts available now in Live!

Get 1:1 Help Now