Solved

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

Posted on 2004-04-06
5
463 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
  • 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
returning a dereferenced pts in C++ 10 149
convert char array to number in c 5 85
Least Squares Curve Fitting 4 77
Embarcadero C++ builder XE10.1 Berlin TRegistry declaration 1 29
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

778 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