DLL ADVAPI ERR: REP123 (OpenInsight 32-bit Specific)
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=0varRetString='lngI=0intChar=0cboStartKey='txtRegistrationPath='txtRegistrationParameter='cboStartKey=HKEY_LOCAL_MACHINE"txtRegistrationPath=network\logon"txtRegistrationParameter=Username"Gosub sdaGetRegEntryIf varRetString=" Then varRetString=LocalUser"lngI=Len(varRetString) - 1LastLoginId=varRetString1,lngIReturn 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=0lngKey=0lngHandle=0lngcbData=0strRet='varRetString='Begin CaseCase 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 1returnEnd CaseERROR_SUCCESS=RegOpenKeyEx(lngKey, txtRegistrationPath, CHAR(0), KEY_READ, lngHandle)if not(ERROR_SUCCESS) THEN DEBUGlngResult=RegQueryValueEx(lngHandle, txtRegistrationParameter, CHAR(0), lngType, strRet, lngcbData)convert ' ' to '' in lngcbDatastrRet=lngcbDatalngResult=RegQueryValueEx(lngHandle, txtRegistrationParameter, CHAR(0), lngType, strRet, lngcbData)ERROR_SUCCESS=RegCloseKey(lngHandle)IF NOT(ERROR_SUCCESS) Then lngType=CHAR(-1)varRetStringy=strRetreturn
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