Solved

Creating a driver in Borland? Incompatibility Borland/MS Visual Studio?

Posted on 2004-04-06
5
467 Views
Last Modified: 2013-12-14
I want to use a Firewire camera with a program I've written in Borland C++ Builder 6. The problem is that I can't get it working in Borland.

Here are some details:

I have the source code of a Firewire driver (CMU). I compile the driver (.SYS) with DDK and I compile the library (.DLL) with Microsoft Visual Studio .NET. Then, I link it to a project compiled in MS Visual Studio .NET and everything works.

The thing is, I want to compile my project in Borland for various reasons. Now, I can't just link my Borland project to the DLL compiled in MS Visual Studio, because of an incompatibillity issue. So I want to compile the driver and .DLL immediately in Borland. Like that, everything is compiled in Borland and I won't encounter incompatibilities.

The problems:
First, I don't know how to compile the driver (.sys) in Borland. I have no idea. So I continue to use the .sys file created by the DDK of windows.
Secondly, I was able to create the DLL in Borland. It compiled. However, My program is not able to initialize the camera. (and this was no problem in the Windows project mentioned earlier).

Basically, what I'm looking for is some explanation about how to make drivers in Borland and about the possible problems that exist when using a .SYS generated by DDK with a .DLL generated by Borland.

I hope I made myself clear. Hoping for a clear answer.

Thanks,
Arnoud
0
Comment
Question by:Klaren
[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
  • 2
  • 2
5 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 150 total points
ID: 10768759
1st of all, forget about compiling the driver with BCB - it is both cumbersome (if possible at all) and unecessary, since drivers are accessed via 'CreateFile()' and 'DeviceIoControl()'. If your program is not able to initialize the camera, there's a different problem.
0
 
LVL 4

Expert Comment

by:PerryDK
ID: 10768877
It is possible.  The problem lies in the fact that the dll's are not compatible with both compilers.  So what you need to is convert the Microsoft DLL (which is in coff format) to one that is compatible with the borland compilers (which expect the omf format)

Go to your C prompt.

type coff2omf  c:\Microsoft\Some.dll c:\Borland\Some.dll

obviously the path names and the name of the dll will differ but hope you get the picture.

This will generate a .lib file which you need to add to your borland project.

If you get an error about missing the dll when you run you app place the dll in the same directory as your executable or place it in the system32 directory.

Hope this helps.  Do a search on google or borlands community pages for coff vs omf if you want to know the details about this.

If you have any other questions about this issue just ask.
0
 
LVL 86

Expert Comment

by:jkr
ID: 10769130
DLLs are always PE. The .lib formats differ.
0
 

Author Comment

by:Klaren
ID: 10773067
Using coff2omf is not going to help me I'm afraid, because that only works with C code, not with C++ (classes).
Here is an interesting link about that: http://www.bcbdev.com/articles/vcdll2.htm

I've tried to convert the LIB from VC to Borland, but there are no nice ways of doing it. I have been adviced to recompile in Borland, since I have the source code myself.

As I understand from jkr, there is no need to try to compile the .SYS with Borland. Thanks for that.
So what's left, is my the problem of not being able to initialize the camera after compiling it in Borland, although I didn't have a problem with the VC compiled version. Does anybody have any experience in this area? What kind of difficulties exist that I'm not aware of?



0
 

Author Comment

by:Klaren
ID: 10888196
Hi,

No answers have been submitted during the last week, so it's time to reward the writer of the accepted answer.

Unfortunately, my problem has not been solved. However, thanks to jkr I'm not trying to find out how to create  a .sys in Borland anymore. I appreciate the extended answer of PerryDK, but I was already very much aware of that incompatibility, so it did not help me solve the problem in any way.

Everybody is still invited to give hints about this. Anything is welcome.

Arnoud
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Create a path if not exists 7 124
oracle 11g 23 150
Android development question 2 108
C++ statement T∗ begin(Vector<T>& x) 5 42
When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

732 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