Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 20 JUN 2003 10:47:01AM Chuck Eder wrote:

When trying to run declare_fcns I get an error "REP123" see below. Any ideas? Book doesn't say DLL's have to be written to a specific place.

run declare_fcns "dll_advapi32"

$REGOPENKEYEX written to file SYSOBJ.

$REGQUERYVALUEEX written to file SYSOBJ.

$REGCLOSEKEY written to file SYSOBJ.

3

REP123: Cannot find associated component $REGOPENKEYEX*EXAMPLES of entity EXAMPLES*STPROCEXE**REGOPENKEYEX.

The record in file sysprocs is:


ADVAPI32

LONG PASCAL RegOpenKeyEx(LPLONG,LPCHAR,LPLONG,LPLONG,LPLONG)

LONG PASCAL RegQueryValueEx(LPLONG,LPCHAR,LPLONG,LPLONG,LPCHAR,LPLONG)

LONG PASCAL RegCloseKey(LPLONG)


Any thoughts would be appreciated.

Chuck


At 20 JUN 2003 11:00AM Richard Hunt wrote:

Chuck,

It has been a long time since I have done any "declare_fcns"… Although… I am thinking that you probably are logged into your "examples" application, and probably should be logged into your "sysprog" application. Try that and see if it works.


At 20 JUN 2003 11:13AM Chuck Eder wrote:

Good call Mr. Hunt and Thank you. The book doesn't say you must be in Sysprog that I saw.

New problem though when calling the DLL Functions, any ideas?

The error I get is "Eng0805" Line 60 "ERROR_SUCCESS=RegOpenKeyEx(lngKey,… " function RegOpenKeyEx does not exist in dynamic link library ADVAPI32.

I know the spelling is correct. Does advapi32 need to be copied from winnt\system32 to another location maybe?

Any help appreciated.

Chuck


FUNCTION GET_LOGON_USER(Ansr)

Declare Function RegOpenKeyEx

Declare Function RegQueryValueEx

Declare Function RegCloseKey

lngType=0
varRetString='
lngI=0
intChar=0
cboStartKey='
txtRegistrationPath='
txtRegistrationParameter='
cboStartKey=HKEY_LOCAL_MACHINE"
txtRegistrationPath=network\logon"
txtRegistrationParameter=Username"
Gosub sdaGetRegEntry
If varRetString=" Then varRetString=LocalUser"
lngI=Len(varRetString) - 1
LastLoginId=varRetString1,lngI

Return LastLoginId

*———————————————————————

sdaGetRegEntry:

* cje 8/30/1 Used to retrieve the last username logon value for access outlookLog field

* Demonstration of win32 API's to query

* the system registry

lngResult=0
lngKey=0
lngHandle=0
lngcbData=0
strRet='
varRetString='
Begin Case
  Case cboStartKey=HKEY_CLASSES_ROOT"
   lngKey=CHAR(80000000)
  Case cboStartKey=HKEY_CURRENT_CONFIG"
   lngKey=CHAR(80000005)
  Case cboStartKey=HKEY_CURRENT_USER"
   lngKey=CHAR(80000001)
  Case cboStartKey=HKEY_DYN_DATA"
   lngKey=CHAR(80000006)
  Case cboStartKey=HKEY_LOCAL_MACHINE"
   lngKey=CHAR(80000002)
  Case cboStartKey=HKEY_PERFORMANCE_DATA"
   lngKey=CHAR(80000004)
  Case cboStartKey=HKEY_USERS"
   lngKey=CHAR(80000003)
  Case 1
   return
End Case
ERROR_SUCCESS=RegOpenKeyEx(lngKey, txtRegistrationPath, CHAR(0), KEY_READ, lngHandle)
if not(ERROR_SUCCESS) THEN DEBUG
lngResult=RegQueryValueEx(lngHandle, txtRegistrationParameter, CHAR(0), lngType, strRet, lngcbData)
convert ' ' to '' in lngcbData
strRet=lngcbData
lngResult=RegQueryValueEx(lngHandle, txtRegistrationParameter, CHAR(0), lngType, strRet, lngcbData)
ERROR_SUCCESS=RegCloseKey(lngHandle)
IF NOT(ERROR_SUCCESS) Then lngType=CHAR(-1)
varRetStringy=strRet

return


At 20 JUN 2003 12:08PM Pat McNerthney wrote:

Chuck,

In Win32, apis that take in text string parameters generally have two versions of the api, an ANSI and a UNICODE version. The ANSI version is created by appending an "A" to the api name and the UNICODE version is created by appending a "W" to the api name.

This means that the RegOpenKeyEx entry point as that name does not exist in ADVAPI32.DLL, but instead there are two entry points, RegOpenKeyExA and RegOpenKeyExW. This also applies to the RegQueryValueEx api, since it also has a text string parameter.

Pat


At 20 JUN 2003 03:00PM Chuck Eder wrote:

That was very good and timely information. I truly appreciate your input all of which makes this forum a smashing success!

Chuck Eder

San Francisco, CA

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/ae096f216df7e1ea85256d4b00513591.txt
  • Last modified: 2023/12/28 07:40
  • by 127.0.0.1