FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Curdrive() & CurDir() Problems
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Curdrive() & CurDir() Problems
Posted: Tue May 25, 2010 09:41 AM

Hi,

I know this isnt a FW issue, but has anyone experieced any problems using Curdrive() & CurDir() on Windows 2008 64bit server?

i assign a current drive variable using the following:

cFolder := Alltrim(CurDrive()) + ":\" + Alltrim(CurDir())

when running the app in the S:\IWS6 folder, the cFolder variable gets populated with :

@:\server\apps\iws6

so it looks like curdrive() is returning @ instead of S and Curdir() is returning \server\apps\iws6 instead of iws6

Anyone else experienced this?

Thanks in advance

Pete

Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: Curdrive() & CurDir() Problems
Posted: Wed May 26, 2010 08:20 AM
Peter,

here this sample is working fine with server 2008, x64

Code (fw): Select all Collapse
function Main()

  local cFolder := Alltrim(CurDrive()) + ":\" + Alltrim(CurDir())
  MsgInfo( cFolder )

return nil
kind regards

Stefan
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: Curdrive() & CurDir() Problems
Posted: Wed May 26, 2010 08:24 AM

Weird, i'm getting this on two different installations.

Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: Curdrive() & CurDir() Problems
Posted: Wed May 26, 2010 09:18 AM

hmm, what kind of disk drive is s: ? local, network, virtual (with subst) ?

kind regards

Stefan
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: Curdrive() & CurDir() Problems
Posted: Wed May 26, 2010 09:24 AM

Network - weird thing is this was working ok on one installation last week, but it has never worked on other installation. AFAIK nothing has changed.

Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: Curdrive() & CurDir() Problems
Posted: Thu May 27, 2010 07:59 AM

curious, my last tests with a network drive worked fine, same with "subst" drives.

Did you try my sample, did it work ? Sometimes it seems there is a difference calling functions from a big application or from a small sample. I can send you the compiled file, if you want.

kind regards

Stefan
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: Curdrive() & CurDir() Problems
Posted: Thu May 27, 2010 08:05 AM

I was thinking along the lines of compiling with xHarbour commercial - what are you using? If you are not using xHarbour commercial, send me a sample - i will create a small app that just displays curdrive() & curdir() too

Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: Curdrive() & CurDir() Problems
Posted: Thu May 27, 2010 09:33 AM
I´m using xHarbour from xHarbour.org, not the commercial version. Here you can download my sample

http://www.fiveclasses.de/Getdir.zip
kind regards

Stefan
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: Curdrive() & CurDir() Problems
Posted: Thu May 27, 2010 09:42 AM

Thanks stefan,

I have sent it to my customer and i'll let you know the results

Best regards,

Pete

Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: Curdrive() & CurDir() Problems
Posted: Thu May 27, 2010 09:58 AM

Your app works perfectly - recompiled your app using xHarbour commercial and it still worked!!

So the problem must be in my app somehow, i'm going to have to do some more tests with my app

Thanks for your help Stefan

Pete

Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: Curdrive() & CurDir() Problems
Posted: Fri May 28, 2010 06:59 AM

my pleasure! :)

hope you´ll get it working

kind regards

Stefan
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: Curdrive() & CurDir() Problems
Posted: Mon Jun 07, 2010 01:13 PM

Stefan,

I'm not getting much help with this on the xHarbour forum - they have suggested that i remove FW and try, which i have and still get the problem.

I was wondering if i could send you my source code, could you compile the app using xHarbour from xHarbour.org and i could see if it is xHarbour commercial that is causing the problem?

email me at peterh at plsoft.co.uk and i will send you my code

best regards,

Pete

Posts: 1283
Joined: Fri Feb 10, 2006 02:34 PM
Re: Curdrive() & CurDir() Problems
Posted: Mon Jun 07, 2010 02:59 PM

Hi,

use HB_CurDrive() instead curdrive()

Salutacions, saludos, regards

"...programar es fácil, hacer programas es difícil..."

UT Page -> https://carles9000.github.io/
Forum UT -> https://discord.gg/bq8a9yGMWh
HIX -> https://github.com/carles9000/hix
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: Curdrive() & CurDir() Problems
Posted: Mon Jun 07, 2010 03:17 PM

I get unresolved external hb_curdrive()

i'm using commercial xHarbour dated May 2009

Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Curdrive() & CurDir() Problems
Posted: Mon Jun 07, 2010 04:54 PM
Peter...

put at the end your main prg

Code (fw): Select all Collapse
#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>
#include <hbapifs.h>

HB_FUNC( CURDRIVE )
{
   char szCurDrive[ 1 ];
   const char * szDrive;

   szCurDrive[ 0 ] = ( ( char ) hb_fsCurDrv() ) + 'A';
   hb_retclen( szCurDrive, 1 );
}

#pragma ENDDUMP