FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour path of an image
Posts: 401
Joined: Tue Jan 05, 2010 02:33 PM
Re: path of an image
Posted: Thu Sep 08, 2011 09:48 AM

yes Bayron,

But I not Know the folder

sample : .\bitmaps\risto\cafe\cafe.jpg

the user can insert bitmap from .\bitmaps\risto\cafe\ or .\bitmaps\risto\ or .\bitmaps\

I don't Know where

FWH .. BC582.. xharbour
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: path of an image
Posted: Thu Sep 08, 2011 12:44 PM
I think Bayron is on the right track .. I use the same logic to find the location of the exe that the workstation opened ..

Code (fw): Select all Collapse
//-- get timestamp on .exe //

cFILE := GetModuleFileName( GetInstance() )
aDIR  := DIRECTORY( cFILE )
dEXE  := aDIR[1] [3]

// where .exe started from is default directory //

mSTART := RAT( "\", cFILE )
cDEFA  := SUBSTR(cFILE,1,mSTART-1)

aDIR := NIL

SET DEFA to ( cDEFA )


The important part of this code is setting Set Defa to .. location of your exe. This allows you to globally set the location of your app to not only open your tables but to have a starting point for calling your icons and bitmaps ..

It does not matter if you are connecting via a logical drive or by a network path or unc such as :

c:\apps\yourapp.exe
g:\apps\yourapp.exe
\\server\apps\yourapp.exe

By identifying the location of your executable .. you can globally set your Default and anywhere in your app you can get that default by

cDEFA := SET(7) .. returns one of the above paths .. then using that variable get your bitmaps like

cDEFA := SET(7)

DEFINE BITMAP oBMAP FILENAME (cDEFA+"\bitmaps\risto\cafe\cafe.bmp") of oWnd

Hope that helps.

Rick Lipkin
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: path of an image
Posted: Fri Sep 09, 2011 03:50 PM
Hi,

My scheme is:

.exe program+ .ini path configuration in same directory, and separated data directory


Example:

Account.Exe and Account.Ini in something directory.

Run.Ini contents:
Code (fw): Select all Collapse
PathProgram=\ProgramDir\Account


So .exe is launched in something directory and path data is independent from .exe.

Just, my 2 cents
regards

Continue the discussion