| View previous topic :: View next topic |
| Author |
Message |
softcoder Guest
|
Posted: Tue Jul 25, 2006 11:21 pm Post subject: VC ++ static lib file.. options for bds 2006? |
|
|
We have a third party static lib file which was written for bcb3, new
versions support vc ++. We only call 7 methods but they do use classes for
params... what would be the best option to get this working with a bds 2006
project?
Thanks
--
Mark Vejvoda
website: www.soft-haus.com
blog: www.soft-haus.com/blog |
|
| Back to top |
|
 |
Darko Miletic Guest
|
Posted: Wed Jul 26, 2006 12:16 am Post subject: Re: VC ++ static lib file.. options for bds 2006? |
|
|
softcoder wrote:
| Quote: | We have a third party static lib file which was written for bcb3, new
versions support vc ++. We only call 7 methods but they do use classes for
params... what would be the best option to get this working with a bds 2006
project?
|
a) get a source code and recompile it in BDS.
b) write dll in visual c++ that uses that static lib and exports some
functions which you can use to call in BDS. |
|
| Back to top |
|
 |
softcoder Guest
|
Posted: Wed Jul 26, 2006 3:43 am Post subject: Re: VC ++ static lib file.. options for bds 2006? |
|
|
Neither will work here since:
a) not an option
b) the methods take classes which if i use the vc++ static lib.. I won't be
able to pass classes.
Other ideas?
"Darko Miletic" <darko (AT) vmn (DOT) com.ar> wrote in message
news:44c66df4 (AT) newsgroups (DOT) borland.com...
| Quote: | softcoder wrote:
We have a third party static lib file which was written for bcb3, new
versions support vc ++. We only call 7 methods but they do use classes
for params... what would be the best option to get this working with a
bds 2006 project?
a) get a source code and recompile it in BDS.
b) write dll in visual c++ that uses that static lib and exports some
functions which you can use to call in BDS. |
|
|
| Back to top |
|
 |
Alex Bakaev [TeamB] Guest
|
Posted: Wed Jul 26, 2006 4:20 am Post subject: Re: VC ++ static lib file.. options for bds 2006? |
|
|
softcoder wrote:
| Quote: | b) the methods take classes which if i use the vc++ static lib.. I won't be
able to pass classes.
Other ideas?
|
You still can use "C" interfaces. Just pass 'this' parameter to them and
internally they will call an appropriate method. 'this' can be returned
as an opaque handle, if so desired.
..a |
|
| Back to top |
|
 |
Darko Miletic Guest
|
Posted: Wed Jul 26, 2006 5:38 am Post subject: Re: VC ++ static lib file.. options for bds 2006? |
|
|
softcoder wrote:
| Quote: | Neither will work here since:
a) not an option
b) the methods take classes which if i use the vc++ static lib.. I won't be
able to pass classes.
|
Than you will have to write wrappers for that.
For example you have class like this that needs to be passed to method:
class test {
public:
test() : m_ptr(NULL) {}
test(somebasictype* ptr) : m_ptr(ptr) {}
~test() {}
void release() { if (!m_ptr) delete m_ptr; m_ptr=NULL; }
private:
somebasictype* m_ptr;
};
///dummy interface
void SomeMethod(const test& t) ;
So you write a pure function that takes raw data as imput and internally
constructs desired classes to call method:
extern "C" void __declspec(dllexport) MySomeMethod (somebasictype* t) {
test p(t); //create instance of class
SomeMethod(t); //pass it to real method
}
etc.
This is just a crude non-realistic sample to demonstrate the idea.
Darko |
|
| Back to top |
|
 |
Kerry Culligan Guest
|
Posted: Wed Aug 02, 2006 1:26 am Post subject: Re: VC ++ static lib file.. options for bds 2006? |
|
|
I am not sure if this will help, however, I used the command line utility tlib to create a library that BCB could use from a VC++ library or dll. There should be some information on tlib in the help files.
Kerry |
|
| Back to top |
|
 |
|