• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 482
  • Last Modified:

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

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
Klaren
Asked:
Klaren
  • 2
  • 2
1 Solution
 
jkrCommented:
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
 
PerryDKCommented:
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
 
jkrCommented:
DLLs are always PE. The .lib formats differ.
0
 
KlarenAuthor Commented:
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
 
KlarenAuthor Commented:
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now