Mindaugas,

So, what difference do you see between Harbour.dll and "general puporse dll". Why Harbour.dll could not be a general puporse dll? What are requirements for dll to be a general puporse?

Dependance on CRTL. MS provides one with system, but
some compilers do not depend on it (Borland for example).

It's not the case. The problem is C standard Runtime
library. Each C compiler has its own dynamic CRTL designed
and compiled for that compiler. Harbour uses C Runtime
library extensivly. If I would like to create and use
Harbour dll which uses *dynamic C Runtime library" I will
not be able to do so - following your aproach.
And in fact I do this. My HbWxW uses Harbour dll AND
dynamic CRTL (Borland build).

Not sure I've got your idea well... I'll try to ask a two questions:

1) Can we link static C RTL to harbour.dll? I mean all C RTL functions like memcpy(), etc. will be inside inside harbour.dll, but not Borland's cc3250.dll. This way our harbour.dll will be "self contained" it will not depend on external borland's code.

What you've written is true. But that's not the case. The
problem is *dynamic* CRTL. Especially the threaded one.
For Borland it is cc3250mt.dll (Bcc 5.5). Some programs
REQUIRE to be built using dynamic threaded CRTL. Try to
build a dll which is used in threads and is not built
against cc3250mt.dll with Borland and you'll see what
I am talking about.

2) If 1) is true, do we have any other problems to use BCC compiled harbour.dll with another C compiler?

It's not true. See above.

OK, I see some problems here. Some functions depends on structures created by RTL, for example I guess we'll have GPF if we allocate memory using Borland's malloc() (from harbour.dll) and free it using Microsoft's free() (from main app). This should be solved by forcing main app to use .dll hb_xgrab(), hb_xfree().

And you consider it as a valid solution ?
What if I wanted to write some C extensions,
mainly to deal with so called "worker threads" ?
Or I would like to use 3-rd party dll which
uses malloc() internally ?
Come on. Be serious. You are a programmer.

Or do you want to have a "final word" again ?

No need for final word. Final solution would be better.

Perhaps more problems could by found, but I really think there is a solution for the problem. I used various .dll, for example: zlib.dll, libcairo.dll, libmysql.dll, ace32.dll, gtk, MrSID, etc, etc. I did not care that compiler it was compiled. I've used it from both GCC and Borland. Original binary distribution very ofter come with COFF import library (perhaps MSVC), but I've used Borland's implib.exe, and used created import library with success.

Perhaps you did not use dynamic CRTL with those dlls in Borland.

--

Marek

----------------------------------------------------------------------
Zobacz cala prawde o Lukaszu Podolskim!
kliknij >>> http://link.interia.pl/f1e57

_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to