Re: [Harbour] Harbour ecosystem

2010-05-18 Thread Alex Strickland

Viktor Szakáts wrote:


In this case I tend to think for Harbour it's enough to
create a page with all the links pointing to different projects,
but more importantly (as discussed previously) to ensure that
these 3rd party projects can be compiled, linked and used in
more or less common way, f.e. by providing .hbp files to build
the project and .hbc file to link the project.


This subject has come up many times over the years, and the status quo remains, 
mainly I think because there are always good arguments pro and con. But you have 
made an excellent point here, hbmk2 can really simplify creation and usage of 
3rd party projects.


Regards
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Question about Preprocessor 2

2010-05-13 Thread Alex Strickland

Przemysław Czerpak wrote:

On Thu, 13 May 2010, CarozoDeQuilmes wrote:

Hi,


Hi, I have an little question:
This translate:
#xtranslate.  =>  myFun(  ,  )
function main()
   aeval( aTmp , { |x| level1.level2 } )
return .T.
It will be generate the followed sentence:
function main()
aeval( aTmp , { myFun( |x| level1 , level2 ) } )
return .T.
I think that it is wrong
I think the correct translation should be:
function main()
aeval( aTmp , { |x| myFun( level1 , level2 ) } )
return .T.
Am I wrong?


Yes you are ;-)
You want that PP will respect some operator precedence which
is only in your head but PP does not even know anything about
operator precedence and syntax in Clipper/Harbour language.


Could you help me understand?

Why does value1 match "|x| level1", and not "level1" ?

Regards
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] Zero Install

2010-05-10 Thread Alex Strickland

Hi Viktor

This site may interest you as a possible way around the packaging dependencies 
for various distributions:


http://0install.net/goals.html#anyoneinstall

OT, I installed visual studio 2010 (on 64 bit Win 7), and the recommended 
settings in INSTALL did not work for me:

call "%ProgramFiles%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"

had to change to:
call "%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"

because of 64bit I guess, but then there was an error in vcvarsall.bat (I don't 
recall what exactly). However, this worked:

call "%VS100COMNTOOLS%vsvars32.bat"

Maybe this is of interest.

OT2, thank you for the full video on YouTube, I enjoyed it very much .

Regards
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] HBNetIO file functions

2010-05-05 Thread Alex Strickland

Mindaugas Kavaliauskas wrote:


Here is a sample code, how I copy data.dbf to MEMIO for a much faster
report generation using memory file instead of (possibly remote) file.
If you change "data.dbf" to "net:data.dbf" you'll have a function to
NETIO file to MEMIO file.


I briefly looked to see if I thought I could write something for myself. Your 
code demonstrates interesting possibilities.



If your next question is about, why IO API is not directly accessible
via Harbour level functions, the answer is: because IO API functionality
is not as wide as all Harbour level functions. So, many Harbour
functions could not be redirected via IO API.


IO API can't be far from that goal if all file operations required to handle an 
RDD are implemented. I guess tell, seek, locking, directory manipulation and 
status (eof) at least are missing.


Thank you for the information.

Regards
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] wapi_CreateMutex

2010-05-05 Thread Alex Strickland

Viktor Szakáts wrote:


In second version you don't assign the returned
mutex handle to a variable, therefore it's
instantly released by GC, along with the mutex.


Thank you Viktor. I replaced my own naive implementation of CreateMutex with the 
wapi_ version, not realising about the garbage collection. It is rather a 
demeaning name for such an elegant system.


Thanks
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] wapi_CreateMutex

2010-05-05 Thread Alex Strickland

This code will allow me to run only one version (which I want):

   s_hMutex := wapi_CreateMutex( NIL, NIL, "HBNetSvr" )
   IF ! Empty( s_hMutex ) .AND. wapi_GetLastError() == 0
  alert("=> Hello World! OK.")
   ELSE
  alert("=> Application is running. Error")
  return
   ENDIF

This code allows me to run multiple versions, and is functionally no different 
to my eye:


   IF ! Empty( wapi_CreateMutex( NIL, NIL, "HBNetSvr" ) ) .AND. 
wapi_GetLastError() == 0

  alert("=> Hello World! OK.")
   ELSE
  alert("=> Application is running. Error")
  return
   ENDIF

Can someone explain it to me?

Regards
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] HBNetIO file functions

2010-05-04 Thread Alex Strickland

Hi

Maybe this small test will help someone to see how easy it is to read and write 
non DBF files using netio RPC.


Regards
Alex
/*
 * $Id: netiot04.prg 14415 2010-04-30 09:39:25Z druzus $
 */

/*
 * Harbour Project source code:
 *demonstration/test code for alternative RDD IO API, RPC and
 *asynchronous data streams in NETIO
 *
 * Copyright 2010 Przemyslaw Czerpak 
 * www - http://www.harbour-project.org
 *
 */

/* net:127.0.0.1:2941:topsecret:data/_tst_ */

#include "fileio.ch"

#define DBSERVER  "127.0.0.1"
#define DBPORT2941

request FILE
request FCREATE
request FOPEN
request FSEEK
request FWRITE
request NETFREAD
request FCLOSE

proc main()
   local pSockSrv
   local cFile := "hello.txt"
   local nHandle
   local cData := "Hello HBNetIO"
   local lExists
   local cBuffer

   pSockSrv := netio_mtserver( DBPORT,,, /* RPC */ .T. )
   if empty( pSockSrv )
  ? "Cannot start NETIO server !!!"
  wait "Press any key to exit..."
  quit
   endif

   ? "NETIO server activated."
   hb_idleSleep( 0.1 )

   ?
   ? "NETIO_CONNECT():", netio_connect( DBSERVER, DBPORT )
   ?

   ? "FILE:", lExists := netio_funcexec( "file", cFile )
   if lExists
  ? "FOPEN:", nHandle := netio_funcexec( "fopen", cFile, FO_WRITE )
  ? "FSEEK:", netio_funcexec( "fseek", nHandle, 0, FS_END )
   else
  ? "FCREATE:", nHandle := netio_funcexec( "fcreate", cFile )
   endif
   ? "FWRITE:", netio_funcexec( "fwrite", nHandle, time() )
   ? "FWRITE:", netio_funcexec( "fwrite", nHandle, " " + cData )
   cData := chr(13) + chr(10)
   ? "FWRITE:", netio_funcexec( "fwrite", nHandle, cData )
   ? "FCLOSE:", netio_funcexec( "fclose", nHandle )
   ?
   ? "FOPEN:", nHandle := netio_funcexec( "fopen", cFile, FO_READ )
   while !empty( cBuffer := netio_funcexec( "netfread", nHandle ) )
  ? cBuffer
   end
   ? "FCLOSE:", netio_funcexec( "fclose", nHandle )

   ?
   ? "stopping the server..."
   netio_serverstop( pSockSrv, .t. )

return


function netfread( nHandle )

local cBuffer := space( 1024 )
local nRead

if ( nRead := fread( nHandle, @cBuffer, 1024 ) ) <= 0
return NIL
endif

return left( cBuffer, nRead )
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] netiotst.prg

2010-05-04 Thread Alex Strickland

Przemysław Czerpak wrote:


This is expected. The table is open in shared mode and BRWOSE()
just like in Clipper does not have any locking code.


Yes, I understood that.


Error NETIO/1003  Read error: hb_stackInit (DOS Error 15)
Error NETIO/1002  Write error: hb_stackInit (DOS Error 15)
Error NETIO/1002  Write error: hb_stackInit (DOS Error 15)


It's also expected.



When communication errors appears NETIO subsystem as OS error
codes uses HB_SOCKET_ERR_* values defined in hbsocket.ch and
15 means HB_SOCKET_ERR_CONNABORTED what is correct value which
well describes the reason of RTE.
So all is correct and reported as expected.


Thank you for the explanation. Perhaps the "DOS Error nn" should be changed to 
something more OS agnostic in errsys.prg?


Regards
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] netiotst.prg

2010-05-03 Thread Alex Strickland

Hi

When testing netio using netiotst.prg I inadvertently caused this error by 
editing the browse.


Error DBFCDX/1022  Lock required══
Called from FIELDPUT(0)
Called from (b)FIELDBLOCK(0)
Called from DOGET(0)
Called from BROWSE(0)
Called from TESTDB(129)
Called from MAIN(60)
Error NETIO/1003  Read error: hb_stackInit (DOS Error 15)
Error NETIO/1002  Write error: hb_stackInit (DOS Error 15)
Error NETIO/1002  Write error: hb_stackInit (DOS Error 15)
C:\Users\Alex\ECR7.0\tests\hbnetio\tests>

Can someone tell me why does "hb_stackInit" appear in the NETIO messages? And 
why DOS Error 15 ("Invalid drive was specified")?


Thanks
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] Berkeley DB and SQLite

2010-05-01 Thread Alex Strickland

This is quite interesting given that we support SQLite3:

http://www.oracle.com/technology/products/berkeley-db/sql.html

To quote the page:

"This version of Berkeley DB provides a drop-in compatible version of the SQLite 
lightweight relational database library, modified to use the Berkeley DB data 
storage engine. The resulting combined product has the familiar feel of SQLite 
and the robust, scalable, concurrent storage features of Berkeley DB. Combined, 
this represents the best-of-breed minimum footprint embedded SQL database engine."


I didn't even know that Oracle had acquired Berkeley DB.

Regards
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: Netio Questions

2010-04-30 Thread Alex Strickland

Alex Strickland wrote:


If the server is stopped (quit), the client stays frozen, it doesn't
time
out. Or am I doing something wrong here?


I just started looking at the code:

NETIO_CONNECT( [], [], [], ;
  [], [], [] )

nTimeOut defaults to -1 if you don't set it, and I guess that means no timeout.

Note, I haven't run any code or confirmed my guess by digging deeper.

Regards
Alex

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Error BASE/1099 Argument error: STR

2010-04-28 Thread Alex Strickland

Viktor Szakáts wrote:


Anyhow not everything is fine with xhb xml support,
as I'm getting memory corruption with the posted
sample when trying it with mingw. It runs fine
with msvc64.


I have noticed quite a few fixes over recent years/months to the XML source in 
xHarbour, it's possible that Harbour has missed something important.


Regards
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: Netio Questions

2010-04-28 Thread Alex Strickland

AbeB wrote:


If the server is stopped (quit),  the client stays frozen, it doesn't time
out. Or am I doing something wrong  here?


I am interested in this question too. This is important to me, so that I can try 
and automate a recovery.


Regards
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Vdei creation of harbour-project

2010-04-23 Thread Alex Strickland

Alex Strickland wrote:


I create video, from tools gource, the harbour project , years 1999-2000


Oh, I see, I thought it was a typo!

Thanks.

Ciao
Alex

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Vdei creation of harbour-project

2010-04-23 Thread Alex Strickland

rafa wrote:


I create video, from tools gource, the harbour project , years 1999-2000

http://www.youtube.com/watch?v=_FEuktpNQmo



Wow, that's cool. Where is Ryzard? You can see his name everywhere to begin 
with.

How did you make the video?

Regards
Alex

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] SF.net SVN: harbour-project:[14355] trunk/harbour

2010-04-23 Thread Alex Strickland

vszak...@users.sourceforge.net wrote:


 + Changed version number to:
  2.1.0beta1 (from 2.1.0dev)


I just did a rebuild with MSVC2008 and all appears well with my apps (although I 
wish I could find the time to rewrite with unit tests!).


Thanks
Alex

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Ping

2010-04-22 Thread Alex Strickland

Enrico Maria Giordano wrote:


Dear friends, I'd just want to know if Harbour supports PING.


You may find this useful:

HB_FUNC( PING )
{
hb_retl( IsDestinationReachable( hb_parcx( 1 ), NULL ) );
}

In your hbp file:

# IsDestinationReachable
-lsensapi

This API function is not officially supported by Microsoft last time I looked 
(which was quite a while ago).


Regards
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Just for Fun

2010-04-15 Thread Alex Strickland

Antonio Maniero wrote:

Please don't take seriously this checklist, just prize how about Harbour
fill that subjective criteria.

http://spot.livejournal.com/308370.html

*For me* Harbour is very well, getting points mostly on
building/bundling. I think I should congratulate all that have
contributing to little FAIL in this "stress test".


"* You've written your own build tool for this code [ +100 points of FAIL ]"

I think in our case hbmk2 is more like -100 points.

Regards
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: HBIDE Project build start folder problem

2010-04-12 Thread Alex Strickland

Pritpal Bedi wrote:


Unix: The started process will run in its own session and act like a daemon.
I do not know what exactly this means in unix.
Also I do not know how to cover it. Someone with more nixes knowldge
should tell us.


It is similar to running a service in windows. It is not attached to any input 
or output device.


Regards
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] SF.net SVN: harbour-project:[14323] trunk/harbour

2010-04-12 Thread Alex Strickland

vszak...@users.sourceforge.net wrote:


2010-04-12 11:08 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
   * utils/hbmk2/hbmk2.prg
 + Added feature to allow -inc mode when using harbour compiler
   as preprocessor:
  'hbmk2 -hbraw -inc -p[] -s[]<.prg[s]>'


You are too kind. Thank you.

Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] hbmk2 magically morphs into make?

2010-04-12 Thread Alex Strickland

To Viktor and Pritbal


Yes, something like Massimo says.

Two hbmk2 calls in -hbraw mode plus -u and -o Harbour options.


Sorry, I did not make myself clear. It is the compilation conditional based on 
the time of the source file changing which I wish to exploit (like any make tool).


Note that I only ask if some such feature already exists in hbmk2 since you 
(Viktor) obviously similar with -inc.


Regards
Alex


___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] hbmk2 magically morphs into make?

2010-04-09 Thread Alex Strickland

Hi Viktor

I use the preprocessor to produce two versions of a file, one which is my menu 
definition and one which is used to produce documentation. In my old make files 
I simply defined a rule to make the output.


Is there any similar possibility in hbmk2?

This is of the lowest possible urgency, and I well know your aversion to 
rewriting/reinventing make.


Thanks and regards
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: HBIDE Project build start folder problem

2010-04-08 Thread Alex Strickland

Barry Jackson wrote:


So, now the problem seems to be the missing full path to hbmk2


/home/baz/tmp/fpw5bh.sh && hbmk2 /home/baz/hash/ash.hbp -q -trace -info -lang=en

Shouldn't fpw5bh.sh have the hbmk2 line as its last line?

Regards
Alex


___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Error in SDDFB

2010-03-23 Thread Alex Strickland

Viktor Szakáts wrote:


So, if that's all "ORM" means, we already have
it, and that was one of the features that made
dBase so popular versus other "database" languages.


My understanding is that there is a "disconnect" between the programmers object 
based view of the data and the DBMS's relational view of the data. ORM's seek to 
"mend" this disconnect. Of course they do other things such as make CRUD easy 
and provide factory methods to create data classes.


I would not say dBase addressed this issue in any significant way, but I am not 
convinced that it needs to either.


Regards
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Decimal Arithmetic

2010-03-17 Thread Alex Strickland

Maurilio Longo wrote:


here attachment with only my code, it is supposed to be put inside a folder
with decNumber source code.

BTW, I've found your link points to the same library :) It just changes domain
name.


That is a very nice piece of code. Thank you.

To all

Is there any interest in adding decimal as a type to xHarbour?

Regards
Alex

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] Decimal Arithmetic

2010-03-16 Thread Alex Strickland

Hi All

I found this site:

http://speleotrove.com/decimal/

I have often wished to get around the problems of floating point arithmetic. 
This library seems to offer a route that is not too steep. Any takers for a new 
type? Unfortunately "D"ecimal and "M"oney are taken.


Regards
Alex




___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] DBI_PASSWORD

2010-03-05 Thread Alex Strickland

Enrico Maria Giordano wrote:


It is working well for me with a small test sample of clients. I am
able to also successfully decrypt the databases if I need.


Thank you, but I would want to know if there can be problems in real
application usage.


It's real application usage, for a small group of people.

Regards
Alex

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] DBI_PASSWORD

2010-03-05 Thread Alex Strickland

Enrico Maria Giordano wrote:


One more question: is it safe to use DBI_PASSWORD to crypt DBFs without
memo fields?


It is working well for me with a small test sample of clients. I am able to also 
successfully decrypt the databases if I need.


HTH
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] How to retrieve the CallStack

2010-03-01 Thread Alex Strickland

francesco perillo wrote:


I now ask if is it possible to get a prg-level CallStack array in
order to use it in the errorsys handler.


I use:

function Stack2Str(n)

local cStackStr := ""
local cProcFile

DEFAULT n TO 2

while !empty(procname(n))
cStackStr += "Called from " + procname(n) + "(" + 
alltrim(str(procline(n))) + ")" + iif(empty(cProcFile := procfile(n)), "", " in 
" + cProcFile) + chr(13) + chr(10)

n++
end

return cStackStr

HTH
Alex

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: SF.net SVN: harbour-project:[13982] trunk/harbour

2010-02-24 Thread Alex Strickland

Lorenzo Fiorini wrote:

On Thu, Feb 25, 2010 at 6:36 AM, Lorenzo Fiorini
  wrote:


done in the last 5 or so?


years :)



Why does the -kl option not work for you?

Regards
Alex

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] FPT corruption

2010-02-12 Thread Alex Strickland

Przemysław Czerpak wrote:


The maximum size of single memo block in FPT format is 4GB.
Any upper limit check we can introduce without reducing functionality
is comparing the size of memo block with the difference between total
memo file size and block offset. For relatively small memo files it
may help to early detect corruption but it will not help for big files
and for sure in all cases it will cause performance reduction because
we will have to add additional IO call to check current file size.
To reduce the overhead we can add such verification only for blocks
bigger then some arbitrary chosen by us limit i.e. 4MB.

If you think it's worth to implement then I can do that.


Perhaps the check could be optional? Although anything would introduce *some* 
level of performance hit.


Instead of a size check, perhaps a check digit on the size, or a hash would 
produce more reliable results - also optional?


Regards
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: R: [Harbour] HB_BYTE vs. HB_UCHAR

2010-02-11 Thread Alex Strickland

Maurizio la Cecilia wrote:

I agree with the uniqueness of the type, but i like HB_UCHAR.
The 'unsigned' qualifier is declared, despite of HB_BYTE (signed or
unsigned?).
I know that it's more familiar, but not so precise as the HB_UCHAR (leaving
no doubt about the sign).


For me, HB_BYTE implies raw data, and so I prefer it as it does not mention 
signedness at all.


Regards
Alex

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] FPT corruption

2010-02-11 Thread Alex Strickland

Mindaugas Kavaliauskas wrote:


USHORT uiField = hb_parni( 1 );
ULONG ulBlock, ulSize, ulType;
BOOL bDeleted;


Viktor will kill you if he sees these :)

Cheers
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] File names in dos/windows and Linux

2010-02-10 Thread Alex Strickland

Xavi wrote:


Try with last SVN wapi_GetShortPathName( cLongPath, @cShortPath )

http://msdn.microsoft.com/en-us/library/aa364989%28VS.85%29.aspx


Thanks Xavi, I actually only used it as a one off solution to convert a whole 
bunch of short names to long names, but your solution is much neater and a good 
addition to the wapi library.


Regards
Alex

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] File names in dos/windows and Linux

2010-02-10 Thread Alex Strickland

Bruno Luciani wrote:


Which is the function that you say ?


I have attached the code. It is a hack of the Harbour DIRECTORY() 
implementation. It may not be up to date with the code in SVN. I hope it helps.


Regards
Alex

/*
 * $Id: direct.c 11528 2009-06-26 00:33:38Z druzus $
 */

/*
 * Harbour Project source code:
 * DIRECTORY() function
 *
 * Copyright 1999 Leslee Griffith 
 * www - http://www.harbour-project.org
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this software; see the file COPYING.  If not, write to
 * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
 *
 * As a special exception, the Harbour Project gives permission for
 * additional uses of the text contained in its release of Harbour.
 *
 * The exception is that, if you link the Harbour libraries with other
 * files to produce an executable, this does not by itself cause the
 * resulting executable to be covered by the GNU General Public License.
 * Your use of that executable is in no way restricted on account of
 * linking the Harbour library code into it.
 *
 * This exception does not however invalidate any other reasons why
 * the executable file might be covered by the GNU General Public License.
 *
 * This exception applies only to the code released by the Harbour
 * Project under the name Harbour.  If you copy code from other
 * Harbour Project or Free Software Foundation releases into a copy of
 * Harbour, as the General Public License permits, the exception does
 * not apply to the code that you add in this way.  To avoid misleading
 * anyone as to the status of such modified files, you must delete
 * this exception notice from them.
 *
 * If you write modifications of your own for Harbour, it is your choice
 * whether to permit this exception to apply to your modifications.
 * If you do not wish that, delete this exception notice.
 *
 */

/*
 * Notes from the fringe... 
 *
 * Clipper is a bit schizoid with the treatment of file attributes, but we've
 * emulated that weirdness here for your viewing amusement.
 *
 * In Clippers' homeworld of DOS, there are 5 basic attributes: 'A'rchive,
 * 'H'idden, 'S'ystem, 'R'eadonly and 'D'irectory.  In addition, a file can
 * have no attributes, and only 1 file per physical partition can have the
 * 'V'olume label.
 *
 * For a given file request, it is implied that the attribute mask includes
 * all attributes except 'H'idden, 'S'ystem, 'D'irectory and 'V'olume.
 * The returned file list will always include (for instance) 'R'eadOnly files
 * unless they also happen to be 'H'idden and that attribute was not requested.
 *
 * "V" is a special case - you will get back the entry that describes the
 * volume label for the drive implied by the filemask.
 *
 * Differences from the 'standard' (where supported):
 * - Filenames will be returned in the same case as they are stored in the
 *   directory.  Clipper (and VO too) will convert the names to upper case
 * - Filenames will be the full filename as supported by the OS in use.
 * - There are a number of additional file attributes returned.
 *   They are:
 *   'I' - DEVICE  File is a device
 *   'T' - TEMPORARY   File is a Temporary file
 *   'P' - SPARSE  File is Sparse
 *   'L' - REPARSE File/Dir is a reparse point
 *   'C' - COMPRESSED  File/Dir is compressed
 *   'O' - OFFLINE File/Dir is not online
 *   'X' - NOTINDEXED  Exclude File/Dir from Indexing Service
 *   'E' - ENCRYPTED   File/Dir is Encrypted
 *   'M' - VOLCOMP Volume Supports Compression
 * - Clipper can sometimes drop the ReadOnly indication of directories.
 *   Harbour detects this correctly.
 *
 * TODO: - check that path support vis stat works on all platforms
 *   - UNC Support? ie: dir \\myserver\root
 *
 */

#include "hbapi.h"
#include "hbapifs.h"
/* File Find API functions */
extern HB_EXPORT PHB_FFIND sfn_hb_fsFindFirst( const char * 
pszFileName, ULONG ulAttrMask, BOOL * bUse );
extern HB_EXPORT BOOL  sfn_hb_fsFindNext( PHB_FFIND ffind, BOOL * 
bUse );
extern HB_EXPORT void  sfn_hb_fsFindClose( PHB_FFIND ffind );
#include "hbapiitm.h"

#include "directry.ch"

/* NOTE: 8.3 support should be added in a separate way, like
 as a function which converts full names to 8.3 names, since
 this issue is very much platform specific, and this is
 not the 

Re: [Harbour] File names in dos/windows and Linux

2010-02-10 Thread Alex Strickland

Bruno Luciani wrote:

Hi, there is in Harbour any function to get the DOS short filename (8.3) ?

I'm using an API function but I like to  use and standard Harbour function.


No, I didn't find anything. I have made a small change to the Harbour one, which 
you are welcome to look at, but I do see you are using something already.


There is no issue like this under Linux.

Regards
Alex

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: SF bug tracker#2945728: Wrong usage of console bufferin Windows

2010-02-05 Thread Alex Strickland

Itamar Lins wrote:


Please post small exaple of how to activate debug in Hwgui.


Here is my hbp file, note below Debugging comment:

# easipos.hbp

${HWGUI_INSTALL_PREFIX}\hwgui.hbc

-oeasipos
# -trace
-inc
-workdir=easipos
-w
-es2
# ***Debugging***
-b
-gtwin

/dECR32 /dECR /dEASIPOS

easipos.res

ecr.prg
ecrapp.prg
ecrtran.prg
...

In my code:

PROCEDURE StartUp()

ANNOUNCE HB_GTSYS

REQUEST HB_GT_GUI_DEFAULT
REQUEST HB_GT_WIN // ***Debugging***

RETURN


I needed to call ALTD() near the point of interest - I suppose that if you trap 
for the ALT-D key in HWGUI, then you could use it anywhere, but the Harbour code 
will not "see" it unless you do that.


You would need the setmode() call under discussion unless it was your system 
default to have consoles with visible lines equal to buffer lines (I am guessing 
that would work).


I think that was all.

Regards
Alex



___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] SF bug tracker#2945728: Wrong usage of console buffer in Windows

2010-02-05 Thread Alex Strickland

Przemysław Czerpak wrote:


Calling SETMODE() fixed such anomalies by setting both to the same
dimemntions.


SETMODE() sets the same dimensions for the window size and console
buffer size.


This has caused so many questions over the years I wonder if it might not just 
be better to run setmode by default? Or perhaps just take the visible window 
height, and use that with setmode. I can't really see someone wanting to use the 
scroll bars with a real app. I tried with the debugger, it's dreadful.


Speaking of the debugger, it was wonderfully easy to get it working with HWGUI 
and the only reason I don't use it is because I have gotten so used to not doing so.


Regards
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Hb_RegEx() - How to determine if an expression is a valid one

2010-02-04 Thread Alex Strickland

Pritpal Bedi wrote:


How it can be determined that an expression is a
valid regex which can be submitted to the engine,
without generating a RTE ?


Why is a RTE not suitable? BEGIN SEQUENCE is your friend.

Regards
Alex

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] DBF encryption

2010-02-02 Thread Alex Strickland

Przemysław Czerpak wrote:


All such modifications will effect SIX3 compatibility.
To touch it will have to repeat some tests with SIX3 and
document differences and it will be time consuming process
due to bugs in SIX3 library. I do not have time for it now,
sorry.


No problem, thanks for the response.

Regards
Alex

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] DBF encryption

2010-02-02 Thread Alex Strickland

Przemysław Czerpak wrote:


If you want to change password then you have to decrypt the table
and then encrypt it again with new password.


What do you think of issuing a RTE if you try and encrypt an encrypted database, 
it seems better than a silent fail?


Similarly, what do you think of a RTE when using APPEND FROM with databases that 
are not encrypted/decrypted in synch?


Regards
Alex



___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] DBF encryption

2010-01-29 Thread Alex Strickland

Przemysław Czerpak wrote:


If you want to change password then you have to decrypt the table
and then encrypt it again with new password.


Ahh! Thanks very much.

Regards
Alex

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Qt* - A Mission Statement

2010-01-27 Thread Alex Strickland

Pritpal Bedi wrote:


So, I think I stand a point to clarify what happened
around in the last 21 hours.


I'm sorry, it didn't clarify much for me :) I have great respect for anyone who 
can sacrifice their time the way you have done so. However, I do not understand 
why a technical discussion has to go in this direction.


For me, it is clear that the hierarchical nature of hbqt->xbp means that you 
should not rule out hbgtk->xbp (or hbwin->xbp etc). They are separate things for 
good reasons. Surely you can find an abstraction that allows you to proceed 
without destroying that possibility?


BMDBFCDX is still not integrated into the core because it is a poor use of the 
capabilities of an RDDs to inherit the base methods of another - DBFCDX.


In summary, I think Viktor is correct, and you are wrong about this technical 
detail, and wrong to make it such a big issue outside of technicalities.


Regards
Alex


___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] SF.net SVN: harbour-project:[13678] trunk/harbour

2010-01-24 Thread Alex Strickland

dru...@users.sourceforge.net wrote:


2010-01-23 01:30 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
   * harbour/src/vm/memvars.c
 ! fixed RELEASE ALL [LIKE | EXCEPT] command - thanks to
   Enrico for information


[ TOMERGE 2.0 ] ?

Regards
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Win 7 64-bit "hello world" simple compile error

2010-01-24 Thread Alex Strickland

Viktor Szakáts wrote:


Now it offers lots of new features, like incremental
mode, static and dynamic library generation modes, .hbp/.hbm/.hbc




control, binary compression, embedded Harbour compiler. And
a lot more on the deeper level.


Don't forget the "make" like automatic feature of detecting when header files 
are newer than the source file that includes them in -inc mode. I mentally thank 
you, Przemek and Maurilio for this contribution almost every day!


Regards
Alex



___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] 2 little requests to commit-ters...

2010-01-22 Thread Alex Strickland

francesco perillo wrote:


Please report them in a way that can be easily understood which commit
they belong to.


I hope this is suitable, I only included fixes to core features.

2010-01-21 16:59 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
  * src/rtl/memoedit.prg
! Fixed to not return edited memoedit buffer if :Saved ...

2010-01-21 01:09 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
  * harbour/src/rtl/itemseri.c
+ added support for hash array flags and default value serialization

2010-01-13 22:00 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
  * harbour/src/rtl/achoice.prg
! fixed RTE reported by Robert Skowronek - thanks for the code example

2010-01-13 20:14 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
  * harbour/src/vm/hashes.c
! fixed missing HB_STACK_TLS_PRELOAD - thanks to Xavi

2010-01-13 15:10 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
  * src/rtl/memoedit.prg
! Deleted hack which explicitly set lastkey to CTRL_END/W ...

2010-01-13 13:07 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
  * harbour/src/rdd/hbsix/sxcompat.prg
! fixed bug reported by Stupar: OrdSetFocus() used instead of OrdNumber()

2010-01-08 01:02 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
  * src/vm/dlmalloc.c
! Fixed two potentially uninitialized variables, signaled by MSVC.

I hope that these authors agree.

Regards
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] 2 little requests to commit-ters...

2010-01-22 Thread Alex Strickland

francesco perillo wrote:


I'm preparing to do merging in 2.0


That is good of you.

I noticed that there were a few bug fixes that did not appear to be marked with 
TOMERGE, did you notice them?


If not I will try and have a look through the ChangeLog and report them. As 
ever, I am behind the curve and I have not updated my repository for quite a while.


Regards
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] DBF encryption

2010-01-20 Thread Alex Strickland

Hi

I was trying to understand encryption of dbf's and I wrote this test.

I didn't expect the last two lines of output (see end), but perhaps it is 
invalid to expect an encrypted file to be encrypted again? If so, shouldn't:

dbcrypt->( dbinfo( DBI_ENCRYPT, "fredflintstone" ) )
cause an error or return false?

Regards
Alex


#include "dbinfo.ch"

procedure main()

local aStruct := { ;
{ "Name", "C", 20, 0 }, ;
{ "Age", "N", 3, 0 }, ;
{ "Boy", "L", 1, 0 }, ;
{ "Birth", "D", 8, 0 } ;
}

request dbfcdx
rddsetdefault("DBFCDX")
dbcreate("dbcrypt", aStruct)
use dbcrypt

dbcrypt->( dbappend() )
dbcrypt->name := "Fred"
dbcrypt->age := 20
dbcrypt->boy := .t.
dbcrypt->birth := date() - (20 * 365)
? "After create, ", dbcrypt->name, dbcrypt->age, dbcrypt->boy, 
dbcrypt->birth
?
? "DBI_ENCRYPT - barneyrubble", dbcrypt->( dbinfo( DBI_ENCRYPT, 
"barneyrubble" ) )

? "DBI_ISENCRYPTED", dbcrypt->( dbinfo( DBI_ISENCRYPTED ) )
?
? "After encrypt, ", dbcrypt->name, dbcrypt->age, dbcrypt->boy, 
dbcrypt->birth
dbcrypt->( dbclosearea() )
? "Close and reopen"
use dbcrypt
?
? "No password, ", dbcrypt->name, dbcrypt->age, dbcrypt->boy, dbcrypt->birth
?
dbcrypt->( dbinfo( DBI_PASSWORD, "fredflintstone" ) )
? "Wrong password, ", dbcrypt->name, dbcrypt->age, dbcrypt->boy, 
dbcrypt->birth
?
dbcrypt->( dbinfo( DBI_PASSWORD, "barneyrubble" ) )
? "Correct password, ", dbcrypt->name, dbcrypt->age, dbcrypt->boy, 
dbcrypt->birth

?
? "DBI_ENCRYPT - fredflintstone", dbcrypt->( dbinfo( DBI_ENCRYPT, 
"fredflintstone" ) )

? "DBI_ISENCRYPTED", dbcrypt->( dbinfo( DBI_ISENCRYPTED ) )
?
? "Encrypted again, ", dbcrypt->name, dbcrypt->age, dbcrypt->boy, 
dbcrypt->birth

dbcrypt->( dbclosearea() )
? "Close and reopen"
use dbcrypt
?
? "No password, ", dbcrypt->name, dbcrypt->age, dbcrypt->boy, dbcrypt->birth
?
dbcrypt->( dbinfo( DBI_PASSWORD, "fredflintstone" ) )
? "Correct password, ", dbcrypt->name, dbcrypt->age, dbcrypt->boy, 
dbcrypt->birth

?
dbcrypt->( dbinfo( DBI_PASSWORD, "barneyrubble" ) )
? "Wrong password, ", dbcrypt->name, dbcrypt->age, dbcrypt->boy, 
dbcrypt->birth
dbcrypt->( dbclosearea() )

return


Output:


C:\Users\Alex\ECR6.4\tests>dbcrypt

After create,  Fred  20 .T. 01/25/90

DBI_ENCRYPT - barneyrubble .T.
DBI_ISENCRYPTED .T.

After encrypt,  Fred  20 .T. 01/25/90
Close and reopen

No password,  c╙]ù☼■╬¿↓f&ë▓╩N_└å/☻   0 .F.   /  /

Wrong password,  ▬ç╠http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] $ operator with hashes and arrays

2010-01-08 Thread Alex Strickland

Mindaugas Kavaliauskas wrote:


AFAIR, in Clipper value $ array is invalid operation, so, we have the
same in Harbour. Hash is new type that do not exist in Clipper, so, we
were free to implement any behavior.


Thank you.

Regards
Alex

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] $ operator with hashes and arrays

2010-01-08 Thread Alex Strickland

Hi

procedure main()
   static shAllowed := {"STR"=>, "VAL"=>}
   static saAllowed := {"STR", "VAL"}
   ? "STR" $ shAllowed
   ? "STR" $ saAllowed
return

results in:

.T.
Error BASE/1109  Argument error: $
Called from MAIN(5)

Could someone explain to me why $ is defined on hashes but not arrays?

Regards
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Harbour next major release wishlist

2010-01-07 Thread Alex Strickland

Viktor Szakáts wrote:


You're welcome to post your idea, whatever that is.


Extension of virtual file functions from RDD file functions to basic file 
functions, either in the form of fopen("net:\fred.txt") or 
hb_fopen("net:\fred.txt").


Thank you all for your hard work to release the new Harbour and happy New Year!

Best regards
Alex

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Watcom C and starup code

2009-12-09 Thread Alex Strickland

Przemysław Czerpak wrote:


and I need to know if MSC supports:
   #pragma off (unreferenced)/* to disable unused variable warnings */
   #pragma on (unreferenced) /* to enable unused variable warnings */
or at least silently ignores them.

Can someone using MS[V]C check it?


With MSVC 2008:

#include "stdafx.h"

void warn()
{
int i;
}

void badpragma()
{
#pragma off (unreferenced)
int i;
#pragma on (unreferenced)
}

int main(int argc, char * argv[])
#pragma warning( push )
#pragma warning( disable : 4101 )
{
int i;
printf("Hello, pragma test");
return 0;
}
#pragma warning( pop )

results in:

c:\users\alex\documents\visual studio 
2008\projects\pragmatest\pragmatest\pragmatest.cpp(5) : warning C4101: 'i' : 
unreferenced local variable
c:\users\alex\documents\visual studio 
2008\projects\pragmatest\pragmatest\pragmatest.cpp(10) : warning C4068: unknown 
pragma
c:\users\alex\documents\visual studio 
2008\projects\pragmatest\pragmatest\pragmatest.cpp(12) : warning C4068: unknown 
pragma
c:\users\alex\documents\visual studio 
2008\projects\pragmatest\pragmatest\pragmatest.cpp(11) : warning C4101: 'i' : 
unreferenced local variable


Regards
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Problem in OLE implementation

2009-12-01 Thread Alex Strickland

Przemysław Czerpak wrote:

Alex can you try to add at the beginning of rddado/tests/access2.prg:
FIELD FIRST
and change the line 33 from:
locate for TEST2->First = "Lara"
to:
locate for First = "Lara"
and then repeat the test?


Yes, this works and writes .T. to the console.

Regards
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Problem in OLE implementation

2009-12-01 Thread Alex Strickland

J. Lefebvre wrote:


I will continue to investigate,


Perhaps this may help:

http://www.microsoft.com/downloads/details.aspx?familyid=5233b70d-d9b2-4cb5-aeb6-45664be858b6&displaylang=en#QuickInfoContainer

it is OleView.exe which is quite useful for seeing what is behind the scenes.

Regards
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Problem in OLE implementation

2009-12-01 Thread Alex Strickland

Viktor Szakáts wrote:


Can you try with the copy in 'examples/rddado' and tests
under 'tests'.


OK, got them. access1.prg fails with :

Error OLE/3012  Argument error: OPEN (DOS Error -2147352567)
Called from WIN_OLEAUTO:OPEN(0)

If I replace this line:

   USE test.mdb VIA "ADORDD" TABLE "Tabla1"

with:

   USE xbrtest.mdb VIA "ADORDD" TABLE "Customer"

it works. Perhaps test.mdb is broken?

access2.prg creates test2.mdb ok. On exiting it fails with:

Error OLE/3012  Argument error: FIND (DOS Error -2147352567)
Called from WIN_OLEAUTO:FIND(0)
Called from ADO_LOCATE(1009)
Called from __DBLOCATE(0)
Called from MAIN(34)

mysql1.prg :

Error OLE/3012  Argument error: OPEN (DOS Error -2147352567)
Called from WIN_OLEAUTO:OPEN(0)
Called from ADO_OPEN(312)
Called from DBUSEAREA(0)
Called from MAIN(12)

mysql.prg is the same except MAIN(14)

Regards
Alex

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Problem in OLE implementation

2009-12-01 Thread Alex Strickland

Przemysław Czerpak wrote:


BTW I'm still waiting for verification of reported RDDADO problems
with current HBWIN OLE code. Can some MS-Windows users check it?


It is not in current SVN, I copied adordd.prg, and adordd.ch and 
tests\access1.prg from an old backup:


 * $Id: adordd.prg 10183 2009-02-05 09:21:52Z vszakats $
 * $Id: adordd.ch 9997 2008-12-23 02:08:51Z druzus $
 * $Id: access1.prg 9217 2008-08-23 15:02:49Z vszakats $

I altered access1.prg slightly to match xbrtest.mdb which I had from the ado 
test recently:


/*
 * $Id: access1.prg 9217 2008-08-23 15:02:49Z vszakats $
 */

#include "adordd.ch"

REQUEST ADORDD

function Main()

   USE xbrtest.mdb VIA "ADORDD" TABLE "Customer"

   Browse()

   USE

return nil

It appears to work very well, the browse showing me all the customer details. I 
think it should be restored to SVN.


Thanks and regards
Alex Strickland
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] SF.net SVN: harbour-project:[13071] trunk/harbour

2009-12-01 Thread Alex Strickland

Massimo Belgrano wrote:


  can you share your test to better understand?


I am using a commercial DLL supplied to allow redemption and purchase of gift 
vouchers. Many of the functions return arrays of objects (* IUnknown). With 
Przemyslaw's changes (and not to forget the initial and ongoing contributions 
from Mindaugas with ActiveX support and rewriting olecore.c) this kind of OLE 
data is now supported.


To my knowledge Harbour now supports all the forms of OLE data that xHarbour 
supports, plus extras, in a safer way. ActiveX support is now more flexible and 
safer than xHarbour. The C code is compact and clear (well, as clear as OLE code 
ever is for me), allows the proper use of destructors and garbage collection. 
All in all it is a fantastic job.


Regards
Alex



___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] SF.net SVN: harbour-project:[13071] trunk/harbour

2009-11-30 Thread Alex Strickland

dru...@users.sourceforge.net wrote:


   * harbour/contrib/hbwin/olecore.c
 + added support for conversion safe arrays with any type variants
   to Harbour - please test


It works! I am simply amazed. This will save me absolute weeks of work on an 
alternative (and not very good) solution.


Thank you.

Regards
Alex

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] SF.net SVN: harbour-project:[13064] trunk/harbour

2009-11-30 Thread Alex Strickland

Alex Strickland wrote:

dru...@users.sourceforge.net wrote:


2009-11-30 04:45 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/hbwin/olecore.c
+ added support for passing OLE pointer item as VT_DISPATCH variants
+ added support for updating VT_DISPATCH and VT_UNKNOWN parameters
passed by reference
Please test.


Thank you. I must try and discover how to write something that will do
this, I will revert to you when I have done so.


I have been messing about in VS2008 and I can now build a COM dll ok. I can 
consume this simply in VB6 or VS2008. This is good for testing, but I do not 
know how to write some code that would have a return type of IUnknown or 
IDispatch for testing. Can you suggest anything? Sorry, I know this is not 
really your cup of tea.


Regards
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] SF.net SVN: harbour-project:[13064] trunk/harbour

2009-11-29 Thread Alex Strickland

dru...@users.sourceforge.net wrote:


2009-11-30 04:45 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
   * harbour/contrib/hbwin/olecore.c
 + added support for passing OLE pointer item as VT_DISPATCH variants
 + added support for updating VT_DISPATCH and VT_UNKNOWN parameters
   passed by reference
   Please test.


Thank you. I must try and discover how to write something that will do this, I 
will revert to you when I have done so.


Thanks again
Regards
Alex

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Problem in OLE implementation

2009-11-27 Thread Alex Strickland

Alex Strickland wrote:


Is it possible to add support for this?


It may be better to replace the lines at the end of hb_oleVariantToItem

  default:
 hb_itemClear( pItem );

with a run time error?

Regards
Alex

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Problem in OLE implementation

2009-11-27 Thread Alex Strickland

Enrico Maria Giordano wrote:


Works fine now, thank you all.


I tested it as well, and it works great.

Regards
Alex

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Problem in OLE implementation

2009-11-27 Thread Alex Strickland

Hi Mindaugas, Przemyslaw

I have an OLE dll that I am trying to use. I think it returns a safearray of 
IUnknown.


To understand a bit better I put the following 3 debug lines in olecore.c:


void hb_oleVariantToItem( PHB_ITEM pItem, VARIANT* pVariant )
{
char debug[ 100 ];
   if( pVariant->n1.n2.vt == ( VT_VARIANT | VT_BYREF ) )
  pVariant = pVariant->n1.n2.n3.pvarVal;

sprintf( debug, "hb_oleVariantToItem - pVariant->n1.n2.vt = %x, VT_UNKNOWN | 
VT_ARRAY = %x", pVariant->n1.n2.vt, VT_UNKNOWN | VT_ARRAY );

OutputDebugString( debug );
   switch( pVariant->n1.n2.vt )
...


and I get:


hb_oleVariantToItem - pVariant->n1.n2.vt = 200d, VT_UNKNOWN | VT_ARRAY = 200d


In the accompanying IDL file it is the return from:

interface _CardCOM : IDispatch {
[id(0x0001)]
HRESULT Validate(
[in] BSTR number,
[in] BSTR code,
[out, retval] SAFEARRAY(_CardComRetValidate*)* pRetVal);


Is it possible to add support for this?

Regards
Alex

// Generated .IDL file (by the OLE/COM Object Viewer)
// 
// typelib filename: RetainComObj.tlb

[
  uuid(B45867AA-2DFE-4383-A846-4F5E9380B55D),
  version(1.16)
]
library RetainComObj
{
// TLib : // TLib : mscorlib.dll : 
{BED7F4EA-1A96-11D2-8F08-00A0C9A6186D}
importlib("mscorlib.tlb");
// TLib : OLE Automation : {00020430---C000-0046}
importlib("stdole2.tlb");

// Forward declare all types defined in this typelib
interface _CardCOM;
interface _CardComInit;
interface _CardComRetAddValue;
interface _CardComRetCancel;
interface _CardComRetHistory;
interface _CardComRetHistoryExpire;
interface _CardComRetHistoryTime;
interface _CardComRetRedeem;
interface _CardComRetRefund;
interface _CardComRetSale;
interface _CardComRetSalesTemplate;
interface _CardComRetStatus;
interface _CardComRetTransactionReport;
interface _CardComRetTransactionReportItem;
interface _CardComRetTransactionReportSum;
interface _CardComRetValidate;
interface _CardComXML;
interface _common;
interface _Utils;

[
  uuid(7F0D071E-D45C-44A2-9994-E410A5465EB4),
  version(1.0),
custom({0F21F359-AB84-41E8-9A78-36D110E6D2F9}, "RetainComObj.CardCOM")
]
coclass CardCOM {
interface _Object;
[default] interface _CardCOM;
};

[
  odl,
  uuid(ECC7E3CD-E3A3-4349-A122-4858507C83A1),
  version(1.0),
  dual,
  oleautomation,
custom({0F21F359-AB84-41E8-9A78-36D110E6D2F9}, 
"RetainComObj.CardCOM+_CardCOM")

]
interface _CardCOM : IDispatch {
[id(0x0001)]
HRESULT Validate(
[in] BSTR number, 
[in] BSTR code, 
[out, retval] SAFEARRAY(_CardComRetValidate*)* pRetVal);
[id(0x0002)]
HRESULT AddValue(
[in] BSTR number, 
[in] double amount, 
[in, optional, defaultvalue("")] BSTR code, 
[out, retval] _CardComRetAddValue** pRetVal);
[id(0x0003)]
HRESULT Redeem(
[in] BSTR number, 
[in] BSTR code, 
[in] double amount, 
[in, optional, defaultvalue("")] BSTR redeem_reference, 
[out, retval] SAFEARRAY(_CardComRetRedeem*)* pRetVal);
[id(0x0004)]
HRESULT Refund(
[in] BSTR number, 
[in] BSTR code, 
[in] double amount, 
[in, optional, defaultvalue("")] BSTR redeem_reference, 
[out, retval] SAFEARRAY(_CardComRetRefund*)* pRetVal);
[id(0x0005)]
HRESULT History(
[in] BSTR number, 
[in] BSTR code, 
[out, retval] SAFEARRAY(_CardComRetHistory*)* pRetVal);
[id(0x0006)]
HRESULT CheckStatus(
[in] BSTR number, 
[in, optional, defaultvalue("")] BSTR code, 
[out, retval] SAFEARRAY(_CardComRetStatus*)* pRetVal);
[id(0x0007)]
HRESULT SalesTemplates([out, retval] 
SAFEARRAY(_CardComRetSalesTemplate*)* pRetVal);
[id(0x0008)]
HRESULT Cancel(
[in] SAFEARRAY(_CardComRetValidate*) valueDocuments, 
[out, retval] SAFEARRAY(_CardComRetCancel*)* pRetVal);
[id(0x0009)]
HRESULT Sale(
[in] _CardComRetSalesTemplate* salesTemplate, 
[in] double amount, 
[in, optional, defaultvalue("")] BSTR SMS_msisdn, 
[in, optional, defaultvalue("")] BSTR EMAIL_address, 
[in, optional, defaultvalue("")] BSTR POSTAL_

Re: [Harbour] Re: OS/2: Harbour 13015

2009-11-25 Thread Alex Strickland

Przemysław Czerpak wrote:


I think it's too big modification to introduce it just before
new release and I will want to work on it without any dead lines.
I've committed everything what I planed for next stable release
and now I think it's time to give it to users and also allow 3-rd
party developers to adopt their products to modified Harbour API.


OK, thanks for the info, and thank you for some amazing work.

Regards
Alex

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: OS/2: Harbour 13015

2009-11-25 Thread Alex Strickland

Przemysław Czerpak wrote:


BTW I would like to start build tests on different platforms.
I hope that we will release final 2.0 before Christmas.


Do you have any plans to introduce HB_FCREATE() etc before final version?

Regards
Alex

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] SSL

2009-11-15 Thread Alex Strickland

Gerald Drouillard wrote:


Another approach is consider using the curl support. For us it works great.


Thanks, I probably will. Are you using the exe or the library?

wget.exe does not appear to support adding a pass key on the command line. I 
think curl.exe does, I would appreciate a heads up if you use it that way.


Thanks and regards
Alex

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] SSL

2009-11-15 Thread Alex Strickland

Viktor Szakáts wrote:


Unfortunately not. I had not touched the certificate topic yet.


No problem, thanks again.

Regards
Alex

___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] SSL

2009-11-13 Thread Alex Strickland

Hi Viktor

I have to write some code to pick up an XML file from an https address.

I did some test with wget to get the client certificate stuff working ok.

Then I downloaded OpenSSL and compiled Harbour.

I ran test.prg in hbssl\tests which seems fine.

Now, I start to understand just what a huge amount of work you must have put 
into this. I have tried studying the documentation but I am pretty lost.


test.prg explains more to me than an afternoon of reading. If it is not too much 
work could you explain in terms of test.prg how a client certificate would get 
hooked into the process? The certificate and private key are in the same pem file.


If that is rather a load, did you have a decent reference? The OpenSSL web site 
is not easy.


Thanks
Alex
___
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Fwd: [Viktor] Suggestions on How to Get Help

2009-11-09 Thread Alex Strickland

Viktor Szakáts wrote:



So to sum up technical problems, the only one which I believe is reasoned
is the speed of our sf.net  forum compared to others.

I think that slow performance alone isn't a reason to chose other forums,
unless there is someone who's willing to maintain a similar one with
similar
features but better performance. We have no such offer ATM.


I dislike forums - for starters you have to remember to go there, with e-mail it 
just arrives. If this is a done deal, so be it, but I like:


harbour-us...@harbour-project.org

Regards
Alex

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


Re: [Harbour] uhttpd v0.3

2009-11-08 Thread Alex Strickland

Mindaugas Kavaliauskas wrote:


Future ideas

- I'm very happy with templates, but I need some higher level
controls/widgets like browses, etc., to be able write database web
applications. Actually it is not a drawback of server, it is just a
need of some web framework. Current UWBrowse is just a "demo widget".
I need something more complex, may be AJAX, etc.
- TLS


Perhaps you may be interested in some of the ideas presented at 
http://www.getangular.com/ .


The product is written by Misko Hevery who works (worked?) for Google and has 
made me rethink a lot of my ideas about code and testability via his blog at 
http://misko.hevery.com/ .


Regards
Alex

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


[Harbour] hbmk2, -inc and .clp files

2009-11-04 Thread Alex Strickland

Hi Viktor

I thought I would compile an old clipper app to see how it would go with gtwvt.

Firstly, it is truly amazing to see literally 100's of 1000's of lines compile 
in a flash. At the end of the whole affair, I get only 27 linker errors, the 
majority of which are blinker calls - really, amazing!


Second, it seems the -inc option in hbmk2 does not work with with @.clp files? 
Is it supposed to? Or perhaps I have not configured something correctly?


Thanks
Alex


My hbp is as follows:

# iris.hbp

-oiris32
# -trace
-inc
-workdir=irisobj
-n
-w
# -es2

-gtwvt

-lhbct

-ldflag=/force:unresolved
-ldflag=/force:multiple

@iris01.clp
@iris02.clp
@iris03.clp
@iris04.clp
@iris05.clp
@iris06.clp
@iris07.clp
@iris08.clp
@iris09.clp
@iris10.clp
@iris11.clp
@iris12.clp
@iris13.clp
@iris14.clp
@iris15.clp
@iris16.clp
@iris17.clp
@iris18.clp
@iris19.clp
@iris20.clp
@iris21.clp
@iris22.clp
@iris23.clp
@iris24.clp
@iris25.clp
@iris26.clp
@iris27.clp
@iris28.clp
@iris29.clp
@iris30.clp
@iris31.clp
___
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] Typo in hbstr.c

2009-11-03 Thread Alex Strickland

Hi

In hbstr.c there is a typo in the trace line:

char * hb_strncat( char * pDest, const char * pSource, ULONG ulLen )
{
   char *pBuf = pDest;

   HB_TRACE(HB_TR_DEBUG, ("hb_strncpy(%p, %s, %lu)", pDest, pSource, ulLen));


Regards
Alex
___
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] about Netio

2009-11-02 Thread Alex Strickland

Viktor Szakáts wrote:


Now I am compiling with the command line (adding hbmemio):
D:\harbour\contrib\hbnetio\tests>\hrbmingw\bin\hbmk2 netiotst -lhbmemio


hbmemio and hbnetio are two different things. -lhbmemio not needed.


hbmemio has *nothing* to do with .mem files. It is for use with an RDD and the 
dbf files etc will be stored in memory. hbnetio is used to work with an RDD 
across a network.


HTH
Alex

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


Re: [Harbour] SF.net SVN: harbour-project:[12785] trunk/harbour

2009-10-29 Thread Alex Strickland

dru...@users.sourceforge.net wrote:


  + harbour/doc/xhb-diff.txt


This is fantastic information, not least as a comparison, but more importantly 
for me as centralised documentation of the many important enhancements over 
Clipper. I have not had time to read it fully yet but I did not see the new 
virtual file handles discussed, perhaps because there is no difference in 
implementation now between Harbour and xHarbour?


Also, the file id seems not to be fully present:

/*
 * $Id$
 */

Regards
Alex
___
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] SF.net SVN: harbour-project:[12784] trunk/harbour

2009-10-29 Thread Alex Strickland

Massimo Belgrano wrote:


How is possible found a common and good solution?


Symbolic links? :)

Regards
Alex

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


Re: [Harbour] SF.net SVN: harbour-project:[12784] trunk/harbour

2009-10-29 Thread Alex Strickland

Maurilio Longo wrote:


I'm against CHANGES.txt :)


CHGLOG.txt ?

Regards
Alex

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


Re: [Harbour] SF.net SVN: harbour-project:[12784] trunk/harbour

2009-10-29 Thread Alex Strickland

Guy Roussin wrote:


missing .txt only disturb windows users because notepad add .txt
to each files ;-)


Microsoft claims a billion Windows users, maybe we shouldn't disturb them.

I promise, I practically started programming on an AT&T Unix box (that was after 
the Sperry Univac - geez).


Regards
Alex

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


Re: [Harbour] Error making harbour - ChangeLog 12778

2009-10-28 Thread Alex Strickland

Przemysław Czerpak wrote:


Please try again with current SVN code. Should be fixed at:
   2009-10-28 09:13 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)


It is fixed, and testax.prg works flawlessly, so does my hwgui test code.

Thank you once again.

Regards
Alex

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


[Harbour] Error making harbour - ChangeLog 12778

2009-10-28 Thread Alex Strickland

With Harbour (Changelog: * $Id: ChangeLog 12778 2009-10-27 18:49:44Z druzus $)

I did a SVN update this morning, "make clean", "make", and "make install". Only 
harbour.exe and hbpp.exe were copied to the bin directory (I discovered this 
trying to test testax.prg). I am using MSVC 2008.


I then ran "make" again and I am getting the following make error:

link.exe -nologo -dll -subsystem:console -libpath:../../../../../lib/win/msvc 
-out:"..\..\..\..\..\bin\win\msvc\harbour-20.dll" 
-implib:"../../../../../lib/win/msvc/harbour-20.lib" @__dyn__.tmp kernel32.lib 
user32.lib ws2_32.lib advapi32.lib gdi32.lib
   Creating library ../../../../../lib/win/msvc/harbour-20.lib and object 
../../../../../lib/win/msvc/harbour-20.exp
hvmall_dyn.obj : error LNK2019: unresolved external symbol _hb_gtIsGtRef 
referenced in function _hb_gcCollectAll
..\..\..\..\..\bin\win\msvc\harbour-20.dll : fatal error LNK1120: 1 unresolved 
externals


Regards
Alex
___
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] SF.net SVN: harbour-project:[12775] trunk/harbour

2009-10-27 Thread Alex Strickland

dru...@users.sourceforge.net wrote:


  * harbour/contrib/hbwin/hbwinole.h
  * harbour/contrib/hbwin/olecore.c
+ added hb_oleItemGetCallBack() and hb_oleItemSetCallBack()
  functions and support for user defined items bound with
  OLE GC pointer item

  * harbour/contrib/hbwin/axcore.c
* bound callback function with OLE item so it will be automatically
  released with OLE object

  * harbour/contrib/hbwin/tests/testax.prg
 ! destroy window
 * enabled destructor

So far MS-Windows users haven't defined expected behavior for OLE code
so I took my own arbitrary decision and bound callback with OLE GC item.
When last copy of this item is cleared then callback is unregistered
and freed. It means that it can happen before AX window is closed.
If you prefer different behavior then please clearly define what
you need and I can try to change existing code.
Now testax.prg should cleanly execute without any GPF traps and
resource leaks.


I guess you mean me :). I have only got online now, so I had not seen your other 
post. What you have done looks perfectly logical. I guess there may be other 
ways of instantiating ActiveX objects without using ATL, and perhaps the window 
handle would not be available. So it's not the job of this code to destroy 
windows etc.


Thank you very much and I will test soon.

Regards
Alex

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


Re: [Harbour] SF.net SVN: harbour-project:[12764] trunk/harbour

2009-10-26 Thread Alex Strickland

dru...@users.sourceforge.net wrote:


Log Message:
---
2009-10-23 18:07 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
  * harbour/contrib/hbwin/axcore.c
! fixed wrongly initialized reference counter in AX control.
  Now when AX Window is closed and all .prg references to OLE
  are cleared pSink is released.


With this code, I do not see the destructor being activated:

#include "hbgtinfo.ch"
#include "hbclass.ch"

REQUEST HB_GT_WVT_DEFAULT

#define WS_CHILD1073741824
#define WS_VISIBLE  268435456
#define WS_CLIPCHILDREN 33554432

PROCEDURE Main()
   LOCAL oMSCAL
   WAIT "Make sure we are 'Active Window'"
   oMSCAL := HActiveX():Init( WAPI_GetActiveWindow(), "www.google.com", 0, 0, 
300, 300 )

   WAIT "Press any key to exit"
   RETURN

CLASS HActiveX
   DATA oOLE
   METHOD Init
   METHOD Event
   ERROR HANDLER OnError
   DESTRUCTOR Dtor
ENDCLASS

METHOD Init( hWnd, cProgId, nTop, nLeft, nWidth, nHeight, cID ) CLASS HActiveX
   LOCAL nStyle := WS_CHILD + WS_VISIBLE + WS_CLIPCHILDREN
   win_AxInit()
   hWnd := WAPI_CreateWindowEX( 0, "AtlAxWin", cProgId, nStyle, nLeft, nTop, 
nWidth, nHeight, hWnd, 0 )
   //::oOLE := WIN_AxGetControl( hWnd, { | event, ... | Event( event, ... ) }, 
cID )
   ::oOLE := WIN_AxGetControl( hWnd, { | event, ... | ::Event( event, ... ) }, 
cID )

   RETURN self

PROCEDURE Event( ... ) CLASS HActiveX
   LOCAL cEvents := ""
   LOCAL aEvents := { ... }
   aEval( aEvents, { | xEvent | cEvents += HB_ValToStr( xEvent ) + ", " } )
   wapi_OutputDebugString( cEvents )
   RETURN

METHOD OnError() CLASS HActiveX
   RETURN HB_ExecFromArray( ::oOLE, __GetMessage(), HB_AParams() )

METHOD Dtor() CLASS HActiveX
   wapi_OutputDebugString( "Dtor" )
   ::oOLE := NIL
   wapi_OutputDebugString( "After Dtor" )
   RETURN NIL

STATIC PROCEDURE Event( ... )
   LOCAL cEvents := ""
   LOCAL aEvents := { ... }
   aEval( aEvents, { | xEvent | cEvents += HB_ValToStr( xEvent ) + ", " } )
   wapi_OutputDebugString( cEvents )
   RETURN

My understanding of the new garbage collection, was that it should work?

If MSCAL.Calender is substituted it GPF's.

Using the procedure instead of the method procedure works fine, the destructor 
is called, and no GPF, and the object need not be explicitly set to NIL.


Regards
Alex
___
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] SF.net SVN: harbour-project:[12764] trunk/harbour

2009-10-26 Thread Alex Strickland

dru...@users.sourceforge.net wrote:


2009-10-23 18:07 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
  * harbour/contrib/hbwin/axcore.c
! fixed wrongly initialized reference counter in AX control.
  Now when AX Window is closed and all .prg references to OLE
  are cleared pSink is released.


Thank you very much.

I still have questions regarding the behavior of destructors, although I can 
make my HWGUI application behave properly by manually calling the destructor. 
See my other mail.


Regards
Alex

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


[Harbour] Destructors of static scope variables

2009-10-26 Thread Alex Strickland

Hi all

Is it expected behavior that this program does not output "Destructor"?

#include "hbclass.ch"

static oMSCAL

function main()
MSCALInit()
//oMSCAL := nil
return nil

procedure MSCalInit()
oMSCAL := HActiveX():New()
return

CLASS HActiveX
METHOD New
DESTRUCTOR Dtor
ENDCLASS

METHOD New() CLASS HActiveX
return self

PROCEDURE Dtor() CLASS HActiveX
? "Destructor"
RETURN

If I set oMSCAL to nil it does work of course.

Regards
Alex
___
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] SF.net SVN: harbour-project:[12760] trunk/harbour

2009-10-23 Thread Alex Strickland

dru...@users.sourceforge.net wrote:


2009-10-23 12:44 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
  * harbour/src/rtl/hbgtcore.c
+ added default implementation for HB_GTI_CLIPBOARDPAST - thanks to


Is there any reason this is not HB_GTI_CLIPBOARDPASTE?

Regards
Alex

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


Re: [Harbour] ActiveX and GPF

2009-10-22 Thread Alex Strickland

Przemysław Czerpak wrote:


For sure it's called. I've checked it with your example.


You are correct, it is called.

In my HWGUI example with similar functionality, the destructor is not called. Is 
this because the code blocks in the menu produce the same problematic references?


function main()
local oHTTP
local oMainWindow

INIT WINDOW oMainWindow MAIN TITLE "Hello ActiveX"  ;
AT 200, 0 SIZE 420, 300
MENU OF oMainWindow
MENU TITLE "&File"
MENUITEM "HTTP" ACTION { || oHTTP := HActiveX():New( WIN_N2P( 
oMainWindow:handle ), "www.google.com", 0, 0, 300, 300 ) }

SEPARATOR
MENUITEM "E&xit" ACTION { || EndWindow() }
ENDMENU
ENDMENU
ACTIVATE WINDOW oMainWindow
return nil

Regards
Alex
___
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] ActiveX and GPF

2009-10-22 Thread Alex Strickland

Przemysław Czerpak wrote:


If you use in your code as even handler sth what does not keep reference
to oMSCal and it will resolve all your problems, i.e:

   ::oOLE := WIN_AxGetControl( hWnd, ;
   { | event, ... | MyEvent( event, ... ) }, cID )
   [...]


Hmm, the destructor is still not called. It is ok when I explicitly do it.

To investigate further I thought I would take your other advice and recompile 
Harbour with HB_USER_CFLAGS=-DHB_FM_STATISTICS. However, now hbmk2 is GPF'ing 
and hbrun as well (hbrun seems to be used in the install process). I shall 
recompile Harbour without the flag and ... I'm not sure what next.


I don't know, Viktor, if you have tried this option recently. I am using MSVC 
2008.

Regards
Alex

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


Re: [Harbour] SF.net SVN: harbour-project:[12741] trunk/harbour

2009-10-21 Thread Alex Strickland

vszak...@users.sourceforge.net wrote:

2009-10-21 17:09 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
  + contrib/hbwin/tests/testax.prg
+ Added self-contained AX example created by Alex Strickland.
  (plus some formatting and warning fix)


When I test with a URL - www.google.com, I do not get any GPF, under any 
circumstances. When I test with the MS Calendar, I do, unless the ActiveX is not 
given focus, and I can press enter to get past the "wait" and the destructor is 
called. I would say that this example is not ready for prime time until the 
destructor issue can be cleared up.



  * contrib/hbwin/axfunc.prg
+ Added  parameter to WIN_AxGetControl().
  Please review it.


I have tested this after deleting my local copy of axfunc.prg and it works.

Regards
Alex

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


Re: [Harbour] ActiveX and GPF

2009-10-21 Thread Alex Strickland

Viktor Szakáts wrote:

Hi Alex,

BTW, is there any AX control which works out of the box on XP?

On my system even current example doesn't work. I'd guess it
needs office, which not every ppl have.

So, is there anything built-in?


Oh dear, I was using it because I assumed it *was* out of the box, I think it 
probably comes with VB6.


I guess it would be better to replace it with an http example, I'll send 
something based on your changes. I am rebuilding Harbour as I am getting some 
strange pp errors.


Note that it is not a great demo, due to the fact that if you close the window 
by pressing the close box, the destructor code (setting ::oOLE to nil) is not 
run and it will GPF. Also, once the ActiveX control has focus there is no way to 
give it back to the GT, so this is the only way out.


I am not sure why the destructor stuff is not working for the HActiveX class.

Regards
Alex
___
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] ActiveX and GPF

2009-10-21 Thread Alex Strickland

Hi all

I have also got the code to handle alternative "dispinterface" events interfaces 
working. I had to edit the SVN version of axfunc.prg to add support for cID:


FUNCTION WIN_AxGetControl( hWnd, bHandler, cID )
   LOCAL oAx := WIN_OleAuto()

   oAx:__hObj := __AxGetControl( hWnd )
   IF bHandler != NIL
  oAx:__hSink := __AxRegisterHandler( oAx:__hObj, bHandler, cID )
   ENDIF

   RETURN oAx

Thanks for everyone's patience in this long, long series of threads. Now I can 
update my apps to Harbour version 2!


Regards
Alex
___
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] ActiveX and GPF

2009-10-21 Thread Alex Strickland

Przemysław Czerpak wrote:


It should be easy to fix it if you can create such example but I do not
know if it will be easy to create such self contain example. If it's not
Harbour problem then it's impossible to create it :)
It will be good if you can make this example as simple as possible reducing
any additional code, i.e. use GTWVT and windows function wrappers for hbwin
library.


You are right, this code works without GPF:

#include "hbgtinfo.ch"
#include "hbclass.ch"

REQUEST HB_GT_WVT_DEFAULT

#define WS_CHILD1073741824
#define WS_VISIBLE  268435456
#define WS_CLIPCHILDREN 33554432

procedure main()
local oMSCAL

wait "Make sure we are 'Active Window'"
oMSCAL := HActiveX():Init( WAPI_GetActiveWindow(), "MSCAL.Calendar", 0, 0, 
300, 300 )

wait "Press any key to exit"
//oMSCAL := nil
//hb_gcAll()
oMSCAL:Close()
return

CLASS HActiveX
DATA oOLE
METHOD Init
METHOD Event
ERROR HANDLER OnError
//DESTRUCTOR Close
METHOD Close
ENDCLASS

METHOD Init( hWnd, cProgId, nTop, nLeft, nWidth, nHeight, cID ) CLASS HActiveX
local nStyle := WS_CHILD + WS_VISIBLE + WS_CLIPCHILDREN
WIN_AxInit()
hWnd := WAPI_CreateWindowEX( 0, "AtlAxWin", cProgId, nStyle, nLeft, nTop, 
nWidth, nHeight, hWnd, 0 )
::oOLE := WIN_AxGetControl( hWnd, { | event, ... | ::Event( event, ... ) }, 
cID )

return self

PROCEDURE Event( ... ) CLASS HActiveX
local cEvents := ""
local aEvents := { ... }
aEval(aEvents, { | xEvent | cEvents += HB_ValToStr( xEvent ) + ", " } )
wapi_OutputDebugString( cEvents )
return

METHOD OnError() CLASS HActiveX
return HB_ExecFromArray( ::oOLE, __GetMessage(), HB_AParams() )

METHOD Close() CLASS HActiveX
wapi_OutputDebugString( "Close" )
::oOLE := nil
wapi_OutputDebugString( "After Close" )
RETURN


I must explicitly call oMSCal:Close() to set ::oOLE to NIL, or else it will GPF. 
Is that expected behaviour?


I cannot make the DESTRUCTOR work, it is simply not called, can you see why? I 
tried it in the three commented lines above.


Regards
Alex
___
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] ActiveX and GPF

2009-10-21 Thread Alex Strickland

Viktor Szakáts wrote:


No, and exposing it wouldn't be a very good idea,


Yes, I understand why.


however, we have WAPI_CREATEWINDOWEX() in hbwin.
I've added is specifically to allow self-contained
AX tests.


I don't know how to use it without a message loop, there is no "hook" to hang 
anything on (or perhaps I am too dumb to see one). I am using 
WAPI_CREATEWINDOWEX() to create the ActiveX window. Well I would, if I had a 
handle to pass to it :)


Regards
Alex

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


Re: [Harbour] ActiveX and GPF

2009-10-21 Thread Alex Strickland

Przemysław Czerpak wrote:


It should be easy to fix it if you can create such example but I do not
know if it will be easy to create such self contain example. If it's not
Harbour problem then it's impossible to create it :)
It will be good if you can make this example as simple as possible reducing
any additional code, i.e. use GTWVT and windows function wrappers for hbwin
library.


Is there a way to get the handle of the gtwvt window?

Regards
Alex

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


Re: [Harbour] Data Dictionary Support

2009-10-21 Thread Alex Strickland

Przemysław Czerpak wrote:


You can make it yourself using PP:

   #ifndef FIELD_NAMESPACE_OFF
  /* declare WORKAREA1 fields */
  #xtranslate WORKAREA1->=> ;;
  #error WORKAREA1 does not have field: #
  #xtranslate WORKAREA1->name => WORKAREA1->( _FIELD->name )
  #xtranslate WORKAREA1->date => WORKAREA1->( _FIELD->date )
   #endif

   proc main()
  ? workarea1->name
  ? workarea1->nane
  ? workarea1->date
   return


That is pretty cool. Thank you. What is the difference between _FIELD and FIELD?

Regards
Alex

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


[Harbour] Data Dictionary Support

2009-10-20 Thread Alex Strickland

Hi

I was thinking of the following:

1. A compiler option to declare a data dictionary declaration so that statements 
of the form:

workarea->fieldname
could be validated.

In the case where a DBF exists it could be used as a kind of "include" file, and 
there would need to be an alias mapping:

WORKAREA "acc101.dbf" ALIAS accounts
and:
accounts->name
would be validated, and:
accounts->nane
would cause a compile time error. As would:
ackounts->name

In the case where no dbf exists (perhaps a SQL database or the new "mem:" 
files), or it is not practical to read a dbf then some syntax like:

WORKAREA accounts
FIELD accounts->name 
FIELD accounts->address ...  

If we ever introduce strong typing, then something like this will be needed 
anyway.

2. I have come to think of all global state as "evil", and would like to be able 
to declare work areas with local scope, and to be able to pass them as 
parameters, and to treat global work areas as undefined unless declared. The 
same "WORKAREA" keyword and FIELD extension might allow this, depending on 
whether it is placed within a procedure/function, or globally.


Anyone like this idea? I always program with full warnings and /es2 but Harbour 
does not help me with my field names at all.


Regards
Alex



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


Re: [Harbour] ActiveX and GPF

2009-10-20 Thread Alex Strickland

Przemysław Czerpak wrote:

Thank you for your information, I will follow it up.


In general it would greatly help if you can create self contain example
using only Harbour SVN code which we can compile and verify the problem.


Agreed.


If this is Harbour problem then it should be possible to create such
examples and in such case we should be able to fix it quite easy.


When you say it should be easy to create examples, do you mean using WVG? Or 
could you explain, and I will?



BTW have you tried you tried to recompile Harbour core code with
   set HB_USER_CFLAGS=-DHB_FM_STATISTICS
?
It should help to catch code which does not free some resources or
free them more then once.


OK, I shall.

Regards
Alex
___
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


[Harbour] ActiveX and GPF

2009-10-19 Thread Alex Strickland

Hi Mindaugas/Przemyslaw

I have been working with ActiveX again. If I comment out the call to Release() 
in hb_ole_destructor() in olecore.c the GPF does not occur.


That is not very helpful so I wondered if Release() depends in some way on 
whether OleUninitialize() has been called. If I restore the call to Release() 
and I comment out OleUninitialize() the GPF also goes away.


I guess the order of calls on shutdown is not deterministic and calls to Release 
after OleUnitialize() appear to cause a GPF. This is some debug output where 
OleUnitialize() is not actually called (commented):


[5240] OleInitialize
[5240] OleUninitialize
[5240] hb_ole_destructor
[5240] after hb_ole_destructor
[5240] hb_ole_destructor
[5240] after hb_ole_destructor

If I restore the call to OleUnitialize():

[4792] OleInitialize
[4792] OleUninitialize
[4792] hb_ole_destructor
GPFs here

I hope this analysis is correct. I could not find information on whether it is 
supposed to be allowable to call Release() after OleUnitialize().


Regards
Alex


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


Re: [Harbour] COM Arrays of COM Objects

2009-10-15 Thread Alex Strickland

Alex Strickland wrote:

My code is failing on an a COM call which is supposed to return an array 
of COM objects. Is that even supposed to work?


I get NIL, not an error.


If anyone is willing to work on this issue and ActiveX support for HWGUI on a 
commercial basis, please contact me by e-mail. Any improvements will of course 
be committed to SVN.


Regards
Alex

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


[Harbour] COM Arrays of COM Objects

2009-10-14 Thread Alex Strickland

Hi all

My code is failing on an a COM call which is supposed to return an array of COM 
objects. Is that even supposed to work?


I get NIL, not an error.

Thanks and regards
Alex
___
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Re: Harbour Forum and Wiki.

2009-10-14 Thread Alex Strickland

Viktor Szakáts wrote:


Finally: Does anyone have anything else pending?


Is there any consensus on the desirability of extending Przemek's replaceable 
file driver to standard file functions? For example:


fopen("net:\fred.txt")

Regards
Alex
___
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] SF.net SVN: harbour-project:[12593] trunk/harbour

2009-10-02 Thread Alex Strickland

Przemyslaw Czerpak wrote:


This is what I can see after rather short code look up mostly on
client side.
In summary to resolve these problems we will have to rewrite most
of current LetoDB code dropping xHarbour and old Harbour support.
I haven't analyzed this code very deeply but seems that we can keep
only very small part of existing LetoDB code.
For me it is much easier to create new project with such functionality
from scratch then trying to update current LetoDB code. For sure it
will take less time and I will make much less mistakes so I do not
find big motivation to work on it. I know myself and if I start to
update it then I'll end with completely rewritten code but using the
same project name and original authors' copyrights.


That is a shame.


I do not need such remote server for my own use - all my applications
are executed fully on the server side so I do not want to reduce it
to ADS like level.
In the past I started to work on NETRDD and I documented the
server and client part and defined basic communication protocol
but so far I haven't time to finish it. Seeing what happens with
my code in xHarbour I also do not find big motivation to finish
it and public as free OpenSource project but I also do not have
any precise plans about commercial releasing. Just simply I haven't
taken the decision yet. Maybe I'll finish it and release as close
source binary library which can be freely used with Harbour but
only with applications which do not use any commercial libraries.
Or maybe I'll invest much more time in it and try to write full
RDBMS with transactions, SQL support and query optimizer and
release it as commercial project. I do not know yet but I think
I should inform you about it because maybe in the future I will
not be on neutral position here so you should take your really
own decision about LetoDB future in Harbour contrib code and my
opinion and above text is only small help which you can ignore.


I personally would be willing to contribute monetarily, which of course, is an 
easy thing to say, until you see the price. I would like to hear the opinions of 
others in this regard. In the past, I have toyed with the idea of asking whether 
you would be open to such an idea, but refrained because I thought it might be rude.


On the assumption that you did follow a commercial release, I would ask that at 
whatever price, or license arrangement, that the source be made available. It is 
a great comfort knowing that should the worst come to the worst, there is some 
way to investigate and fix problems.


I see once again that your work has been incorporated in xHarbour without proper 
attribution (although I have not actually looked at the changelog - only the 
e-mails), so I sympathise with your reservations.


Regards
Alex
___
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


  1   2   3   4   >