Operating System Error
Posted: Sat Mar 17, 2012 6:12 am
Why do I get this error when I start my application on the computer other then the 1 I've compiled it on?
Donnay Software Web Forums
http://donnay-software.com/DONNAY/
first guess is you're missing the dll for that dbe.Djiber wrote:Why do I get this error when I start my application on the computer other then the 1 I've compiled it on?
Code: Select all
Xbase++ version : Xbase++ (R) Version 1.90.355
Operating system : Windows XP 05.01 Build 02600 Service Pack 3
------------------------------------------------------------------------------
oError:args :
-> VALTYPE: C VALUE: xpprt1.dll
-> VALTYPE: N VALUE: 8
-> VALTYPE: C VALUE: _sysSetCPU
-> VALTYPE: N VALUE: 2
oError:canDefault : Y
oError:canRetry : N
oError:canSubstitute: N
oError:cargo : NIL
oError:description : Internal data structures corrupted
oError:filename :
oError:genCode : 41
oError:operation : dllPrepareCall
oError:osCode : 0
oError:severity : 2
oError:subCode : 5
oError:subSystem : BASE
oError:thread : 1
oError:tries : 0
Code: Select all
#include "dll.ch"
#include "Directry.ch"
procedure main()
LOCAL aDLLfiles := Directory("*.DLL")
LOCAL nCount := Len(aDLLfiles)
LOCAL n, nPosi
LOCAL lFlag := .F.
LOCAL I,J,DllName,hDll,aVersion,fVersion
LOCAL aDLLlist := { {"ADAC20B.DLL",2},;
{"ADAC20C.DLL",2},;
{"ASCOM10.DLL",2},;
{"ASCOM10C.DLL",2},;
{"ASLOGRESOURCE.dll",2},;
{"ASRDBC10.DLL",2},;
{"BAP.DLL",2},;
{"CDXDBE.DLL",2},;
{"DBFDBE.DLL",2},;
{"DELDBE.DLL",2},;
{"EVENTSPY.DLL",2},;
{"FOXDBE.DLL",2},;
{"MEMWATCH.DLL",2},;
{"NTXDBE.DLL",2},;
{"SDFDBE.DLL",2},;
{"SEE32.DLL",2},;
{"SOM.DLL",2},;
{"XPPDBGC.DLL",2},;
{"XPPNAT.DLL",2},;
{"XPPRT1.DLL",2},;
{"XPPRT2.DLL",2},;
{"XPPUI1.DLL",2},;
{"XPPUI2.DLL",2},;
{"XPPUI3.DLL",2} }
SET ALTER TO DLLVER.TXT
SET ALTER ON
FOR n := 1 TO nCount
nPosi := ASCAN( aDLLlist, {|x| x[1] = UPPER( aDLLfiles[ n, F_NAME ] ) } )
IF nPosi > 0
aDLLlist[n][2] = 1
else
AADD(aDllList,{ aDLLfiles[ n, F_NAME ],1} )
endif
NEXT
aDllList := ASORT(aDllList,,, {|aX,aY| aX[2] < aY[2] })
for I := 1 to len(aDllList)
DllName := aDllList[I][1]
IF ! DllInfo( DllName, DLL_INFO_LOADED )
hDll := DllLoad( DllName, NIL, .T. )
lFlag := .T.
ENDIF
// if DllInfo(DllName, DLL_INFO_LOADED)
hDll := DllInfo(DllName, DLL_INFO_HANDLE)
fVersion := LoadResource(1, hDll, RES_VERSIONFIXED)
aVersion := LoadResource(1, hDll, RES_VERSION)
? IF(aDllList[I][2]=1,"*** LOCAL *** ","*** PATH *** ")+DllName
? ""
IF LEN(fVersion) > 0
? "Product Version: "+ltrim(str(fVersion[RES_PRODVER_MS ]))+ltrim(str(fVersion[RES_PRODVER_LS ]))
? " File Version: "+ltrim(str(fVersion[RES_FILEVER_MS ]))+ltrim(str(fVersion[RES_FILEVER_LS ]))
? " File Time: "+ltrim(str(fVersion[RES_FILETIME_MS]))+ltrim(str(fVersion[RES_FILETIME_LS]))
ELSE
? "Product Version: "+"no Information"
? " File Version: "+"no Information"
? " File Time: "+"no Information"
ENDIF
IF LEN(aVersion) > 0
for J := 1 to len(aVersion)
? aVersion[J][RES_VERSION_KEY]+": "+aVersion[J][RES_VERSION_VALUE]
next
ELSE
ENDIF
? ""
// endif
IF lFlag
lFlag := .F.
DllUnload( hDll )
ENDIF
next
SET ALTER OFF
SET ALTER TO
return
Code: Select all
FUNCTION DC_SetCPU( nCPU, cFile )
LOCAL nHnd := 0 // file handle
LOCAL nLast := 1 // last CPU used
LOCAL aSet := {} // processor array
LOCAL nSet // default new bitmask
LOCAL i // counter
DEFAULT cFile := GetEnv('WINDIR') + '\Temp\SetCpu.Smp'
DEFAULT nCPU := 15
// 7 = 3 CPUs
// 3 = 2 CPUs
// 1 = 1 CPU
nSet := nCPU
FOR i := 1 to 32 // count processors
IF nCPU[i] // processor present
aadd(aSet, i) // add processor id to list
ENDIF
NEXT
IF len(aSet) > 1 // more then one processor
IF Fexists(cFile)
nHnd := Fopen(cFile, FO_READWRITE)
IF nHnd > 0 // file is open
nLast := Val(Freadstr(nHnd, 2))+ 1 // get last processor
IF nLast > len(aSet) // check against available processors
nLast := 1 // recycle number
ENDIF
Fseek(nHnd, 0, FS_SET) // place pointer at bof
Fwrite(nHnd, StrZero(nLast, 2)) // write to file
Fclose(nHnd) // close file
ENDIF
ELSE // first time round
nHnd := Fcreate(cFile, FC_NORMAL)
IF nHnd > 0 // file is created and open
Fwrite(nHnd, StrZero(nLast, 2)) // write to file
Fclose(nHnd) // close file
ENDIF
ENDIF
FOR i := 1 to 32 // create new bitmask
nSet[i] := (i = aSet[nLast]) // switch on appropriate bit
NEXT
DllCall("xpprt1.dll", DLL_CDECL, "_sysSetCPU", nSet)
ENDIF
RETURN nil
as i know Xbase++ just run on ONE CPU, so your "bit-mask" ist wrong and it crashDjiber wrote:Code: Select all
FUNCTION DC_SetCPU( nCPU, cFile ) DEFAULT nCPU := 15 // 7 = 3 CPUs // 3 = 2 CPUs // 1 = 1 CPU ... FOR i := 1 to 32 // create new bitmask nSet[i] := (i = aSet[nLast]) // switch on appropriate bit NEXT DllCall("xpprt1.dll", DLL_CDECL, "_sysSetCPU", nSet) ENDIF RETURN nil
Code: Select all
1 = ONLY 1st CPU
2 = ONLY 2nd CPU
4 = ONLY 3th CPU
16 = ONLY th CPU