| View previous topic :: View next topic |
| Author |
Message |
Leroy Casterline Guest
|
Posted: Fri Dec 16, 2005 3:57 pm Post subject: Using BCB6 .lib with BCB2006? |
|
|
I've got a library build for BCB6 that it looks like I'm going to have
to make work with BCB2006 if possible.
The library is the Cypress Semiconductor CyAPI interface to their USB
driver. I've just been informed that Cypress is not going to make the
library available for BDS2006. I've appealed, but think I have little
chance of success.
Since *all* of the commercial development I've been doing for the last
6 or 7 years depends on this library, I'm feeling a bit stuck.
I've tried to use the library as is with BDS2006, but my USB calls
fail (as I expected they would). Is there any way to make this library
work short of rebuilding it from source?
|
|
| Back to top |
|
 |
Simon Farmer Guest
|
Posted: Fri Dec 16, 2005 4:30 pm Post subject: Re: Using BCB6 .lib with BCB2006? |
|
|
You could always put the library in a BCB6 DLL and export the functions.
Then you can call that form BDS2006.
Simon
|
|
| Back to top |
|
 |
Leroy Casterline Guest
|
Posted: Fri Dec 16, 2005 4:32 pm Post subject: Re: Using BCB6 .lib with BCB2006? |
|
|
On Fri, 16 Dec 2005 16:30:02 -0000, "Simon Farmer"
<simon-farmer (AT) first-degree-systems (DOT) com> wrote:
| Quote: | You could always put the library in a BCB6 DLL and export the functions.
Then you can call that form BDS2006.
Simon
|
That sounds interesting. Can you give me an idea of how to do that?
Would I write function in the DLL for each of the library functions,
then pass the call into the library?
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Fri Dec 16, 2005 4:54 pm Post subject: Re: Using BCB6 .lib with BCB2006? |
|
|
"Leroy Casterline" <casterle (AT) ccltd (DOT) com> wrote
| Quote: | That sounds interesting. Can you give me an idea of how to do that?
Would I write function in the DLL for each of the library functions,
then pass the call into the library?
|
Yes.
Gambit
|
|
| Back to top |
|
 |
Simon Farmer Guest
|
Posted: Fri Dec 16, 2005 5:08 pm Post subject: Re: Using BCB6 .lib with BCB2006? |
|
|
| Quote: | That sounds interesting. Can you give me an idea of how to do that?
Would I write function in the DLL for each of the library functions,
then pass the call into the library?
|
Yes, it's easy!!!
Create a DLL project in C++ Builder 6 and add the library to it.
For each function write an interface call to it. So if you had a function :-
int StartUSB(int USBHandle,bool Check);
then you would do the following:-
extern "C" int __declspec(dllexport) CallStartUSB(int USBHandle,bool Check)
{
return(StartUSB(int USBHandle,bool Check));
}
Then when you have the DLL you can do a ImpLib on it to create the C++
Builder 2006 .LIB file.
Another way of doing it is to add the LIB to the DLL and create a DEF file
with the exports in. Although i've had great success in Visual C++ with this
I have had some problems in Borland C++ as you have to make sure you have
the calling conventions exactly right.
Let me know if you need anymore information.
Simon
|
|
| Back to top |
|
 |
Leroy Casterline Guest
|
Posted: Fri Dec 16, 2005 7:48 pm Post subject: Re: Using BCB6 .lib with BCB2006? |
|
|
On Fri, 16 Dec 2005 17:08:14 -0000, "Simon Farmer"
<simon-farmer (AT) first-degree-systems (DOT) com> wrote:
That sounds like exactly what I need. Thanks to you and Remy.
|
|
| Back to top |
|
 |
|