grahamrhind
Technical User
I'm trying to create my first VFP 6 DLL. I'm created a project (grctools) with a class (grctools) and a method (jobcodes). The code in the method is:
Code:
LPARAMETERS m.fieldcontents, m.countrycode, m.case
use lu\jobcodes
_ftemp = m.fieldcontents
m.found=.f.
_TEMP = upper(ALLTRIM(m.fieldcontents))+' '
locate for title=_temp and coun_code=m.countrycode
if found()
do while title=_temp and coun_code=m.countrycode
_UPPER = ALLTRIM(ucorrect)
_MIXED = ALLTRIM(mcorrect)
IF m.case = 1
IF RAT(alltrim(_TEMP),upper(_FTEMP))=1
_FTEMP=STRTRAN(upper(_FTEMP),alltrim(_TEMP),_UPPER+' ')
m.found=.t.
ENDIF
ELSE
IF RAT(alltrim(_TEMP),upper(_FTEMP))=1
_FTEMP=STRTRAN(upper(_FTEMP),alltrim(_TEMP),_MIXED+' ')
m.found=.t.
ENDIF
ENDIF
if m.found=.t.
exit
else
cont
endif
enddo
RETURN _FTEMP
ENDIF
RETURN _FTEMP
[\code]
I have tested this code in a prg, where it works correctly.
The PRG I'm testing to call the DLL contains:
[code]
close all
clear all
PUBLIC _ftemp
_ftemp='.'
oTemp=CREATEOBJECT("grctools.grctools")
oTemp.jobcodes('CEO','USA',2)
? _ftemp
[\code]
This returns always whatever I define as _ftemp in this file. I know the dll is being read because in initial attempts it was giving error messages in my code, which I corrected. I can't work out why a PRG of the code gives the correct result and accessing the DLL doesn't. I haven't been able to find a way of using the debugger for the dll. Any tips?
Thanks!