BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

VC ++ static lib file.. options for bds 2006?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Compatibility with MFC)
View previous topic :: View next topic  
Author Message
softcoder
Guest





PostPosted: Tue Jul 25, 2006 11:21 pm    Post subject: VC ++ static lib file.. options for bds 2006? Reply with 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?

Thanks

--
Mark Vejvoda
website: www.soft-haus.com
blog: www.soft-haus.com/blog
Back to top
Darko Miletic
Guest





PostPosted: Wed Jul 26, 2006 12:16 am    Post subject: Re: VC ++ static lib file.. options for bds 2006? Reply with quote



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





PostPosted: Wed Jul 26, 2006 3:43 am    Post subject: Re: VC ++ static lib file.. options for bds 2006? Reply with 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.

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





PostPosted: Wed Jul 26, 2006 4:20 am    Post subject: Re: VC ++ static lib file.. options for bds 2006? Reply with quote

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





PostPosted: Wed Jul 26, 2006 5:38 am    Post subject: Re: VC ++ static lib file.. options for bds 2006? Reply with quote

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





PostPosted: Wed Aug 02, 2006 1:26 am    Post subject: Re: VC ++ static lib file.. options for bds 2006? Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Compatibility with MFC) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.