Curdrive() & CurDir() Problems

Curdrive() & CurDir() Problems

Postby PeterHarmes » Tue May 25, 2010 9: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
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: Curdrive() & CurDir() Problems

Postby StefanHaupt » Wed May 26, 2010 8:20 am

Peter,

here this sample is working fine with server 2008, x64

Code: Select all  Expand view

function Main()

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

return nil
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: Curdrive() & CurDir() Problems

Postby PeterHarmes » Wed May 26, 2010 8:24 am

Weird, i'm getting this on two different installations.
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: Curdrive() & CurDir() Problems

Postby StefanHaupt » Wed May 26, 2010 9:18 am

hmm, what kind of disk drive is s: ? local, network, virtual (with subst) ?
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: Curdrive() & CurDir() Problems

Postby PeterHarmes » Wed May 26, 2010 9: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.
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: Curdrive() & CurDir() Problems

Postby StefanHaupt » Thu May 27, 2010 7: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
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: Curdrive() & CurDir() Problems

Postby PeterHarmes » Thu May 27, 2010 8: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
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: Curdrive() & CurDir() Problems

Postby StefanHaupt » Thu May 27, 2010 9: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
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: Curdrive() & CurDir() Problems

Postby PeterHarmes » Thu May 27, 2010 9:42 am

Thanks stefan,

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

Best regards,

Pete
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: Curdrive() & CurDir() Problems

Postby PeterHarmes » Thu May 27, 2010 9: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
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: Curdrive() & CurDir() Problems

Postby StefanHaupt » Fri May 28, 2010 6:59 am

my pleasure! :)

hope you´ll get it working
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: Curdrive() & CurDir() Problems

Postby PeterHarmes » Mon Jun 07, 2010 1: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
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: Curdrive() & CurDir() Problems

Postby Carles » Mon Jun 07, 2010 2: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
Skype -> https://join.skype.com/cnzQg3Kr1dnk
User avatar
Carles
 
Posts: 1134
Joined: Fri Feb 10, 2006 2:34 pm
Location: Barcelona

Re: Curdrive() & CurDir() Problems

Postby PeterHarmes » Mon Jun 07, 2010 3:17 pm

I get unresolved external hb_curdrive()

i'm using commercial xHarbour dated May 2009
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: Curdrive() & CurDir() Problems

Postby Daniel Garcia-Gil » Mon Jun 07, 2010 4:54 pm

Peter...

put at the end your main prg

Code: Select all  Expand view
#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
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 37 guests