Page 1 of 1

Operating System Error

Posted: Sat Mar 17, 2012 6:12 am
by Djiber
Why do I get this error when I start my application on the computer other then the 1 I've compiled it on?

Image

Re: Operating System Error

Posted: Sat Mar 17, 2012 9:12 am
by bwolfsohn
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?
first guess is you're missing the dll for that dbe.

Re: Operating System Error

Posted: Sat Mar 17, 2012 10:10 am
by Djiber
Do you maybe know which DLL is that, cause before this error I've got errors with the DLL's missing and I've put them all in the same folder as EXE, but now I got this and I don't know which DLL is missing.

Re: Operating System Error

Posted: Sat Mar 17, 2012 11:01 am
by RDalzell
CdxDbe.Dll, DbfDbe.Dll, DelDbe.Dll, FoxDeb.Dll, SdfDbe.Dll, NtxDbe.Dll, OdbcDbe.Dll and AdsDbe.Dll are the standard xBase++ runtime dlls depending upon which dbe(s) you select within your DbeSys.Prg or DbeSys().

Re: Operating System Error

Posted: Sun Mar 18, 2012 8:24 am
by Djiber
Thanks, that solved it, but now I get this:

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
oError:description : Internal data structures corrupted

What does that mean is it DLL corrupted or failed on some other way :P

Re: Operating System Error

Posted: Sun Mar 18, 2012 9:04 am
by Auge_Ohr
hi,

try Xppload.exe to see from where *.DLL is load from.
if it is in same Directory you can try this too

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
p.s. which Value did you use for "_sysSetCPU" ?
did Sample C:\ALASKA\XPPW32\Source\samples\solution\smp\smprun.prg work ?

Re: Operating System Error

Posted: Sun Mar 18, 2012 10:33 am
by Djiber
Yap all DLL's are in same dir as .exe cause like I've said I'm trying to start program on my friend's computer, he doesn't have ALASKA neither compilers or anything else.

Program runs without any problem on my computer where I've compiled it.

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
This^^ is function where I use "_sysSetCPU" and it's not used anywhere else.

I've found it on internet with explanation that it improves runing application on a diferent core PC's or something like that

[quote=Auge_Ohr]did Sample C:\ALASKA\XPPW32\Source\samples\solution\smp\smprun.prg work ?[/quote]

Nope that sample returns same error:

Image

Re: Operating System Error

Posted: Sun Mar 18, 2012 12:13 pm
by Auge_Ohr
Djiber 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
as i know Xbase++ just run on ONE CPU, so your "bit-mask" ist wrong and it crash

Code: Select all

  1 = ONLY 1st CPU
  2 = ONLY 2nd CPU
  4 = ONLY 3th CPU
 16 = ONLY th CPU
so it must be x^2

Re: Operating System Error

Posted: Sun Mar 18, 2012 1:29 pm
by Djiber
OK, so it would fix it if I set

DEFAULT nCPU :=16 or I've understand you wrong?

Why does ALASKA sample returns same Error?

Problem solved, I just needed some more DLL's

Thanks for the help