Hi Viktor,
 
See my remarks in blue,
 
Regards,
 
JF,
 
De : harbour-boun...@harbour-project.org 
[mailto:harbour-boun...@harbour-project.org] De la part de Viktor Szakáts
Envoyé : mercredi 18 mars 2009 14:05
À : Harbour Project Main Developer List.
Objet : Re: RE: [Harbour] pCode dll
 
Hi JF,
 
1) I can rebuild harbour and it's libs with -DHB_DYNLIB and it work !!! But I'm 
not sure what's it's implied exporting all harbour function ... I must say I 
don't like.
 
2) I created a new define HB_EXPORTP like HB_EXPORT, not disabled by HB_DYNLIB 
(but protected by the OS and or compiler, like HB_EXPORT) and used solely for 
exporting two functions

extern HB_EXPORTP void     hb_vmExecute( const BYTE * pCode, PHB_SYMB pSymbols 
) HB_FLATTEN_ATTR;  /* invokes the virtual machine */
extern HB_EXPORTP PHB_SYMB hb_vmProcessDynLibSymbols( PHB_SYMB pSymbols, USHORT 
uiSymbols, const char * szModuleName, ULONG ulID, USHORT uiPcodeVer ); /* 
module symbols initialization with extended information */

For that I only modified hbdefs.h, hbvm.h and hbvmpub.h

Then compiling Harbour without -DHB_DYNLIB give my exe export only two 
function, as needed for pcode only Dll.

What do you think about that ?
 
1) One problem with this is that an .exp / .lib file will be generated 
for *every* Harbour executables created, at least with MSVC. This 
is because these two symbols will now be exported from all 
Harbour executables. [ I've been dealing with this issue in the last 
few months quite heavily. ]
 
I don't understand the problem here. Sorry, I just created a small exe, just 
calling a messagebox() function within a dll and it do not created any .exp nor 
.lib file.
(MSVC 2008)
 
2) It won't solve -gc3 compiled .prg code. These need some more 
functions to be exported.
 
I've not tryed yet. What is the diff between .c pcode and real c code ? 
I can understand it could not work because of needed exported function but in 
all case, if -gc3 can avoid working dll, I don't see why those two exported 
function could avoid the use of -gc3 if we don't use any DLL ?? 
 
3) I'd use some other name, like HB_EXPORTFORCED, because 
the meaning of 'p' is very ambiguous (it was "*p*code dynamic lib 
probably, but this isn't precise).
 
OK, it was just a first try J
 
4) It's still unclear what is the importance of maindllp.c, as it's not 
used anywhere inside Harbour.
 
Maindllp.c must be compiled and linked to create the pcode dll. It is the main 
startup for the dll and also contain some function allowing the code in the dll 
to use the exe internal function vmExecute and symbol mapping.
 
Like maindllh.c is the Harbour.dll startup code.
 
I'd rather say to use HB_DYNLIB option by those who'd like this 
functionality. I'd expect it's not widely used by too many ppl, as 
such bugs have been unnoticed for at least 8 years :) Maybe there 
are other solutions without downsides.
 
L
 
[ A possible one is to have stubs for these exported functions, 
and these stubs be placed in a separate lib which would always 
be built with exported symbols. This would need special Harbour 
switch to generate code for these stubs. Probably -gc3 mode 
should be disabled in such mode. ]
 
L
 
Brgds,
Viktor
 
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to