Seite 2 von 3

Verfasst: 29.05.2008 20:34
von Kiffi
@kwai chang caine:

can it be, that an Area can read out once only (e.g. like
GetDatabaseString() in PureBasic)?

i found the following code, that seems to work for the poster:

http://www.tek-tips.com/viewthread.cfm? ... 547&page=5
kwai chang caine hat geschrieben:I give you and KIFFY two big french kiss :mrgreen:
Yuck! Bild




;-)

Greetings ... Kiffi

Verfasst: 30.05.2008 12:34
von kwai chang caine
Kiffi hat geschrieben: Yuck! Bild
:lol: Not on the mouth, not on the mouth :lol:
can it be, that an Area can read out once only (e.g. like
GetDatabaseString() in PureBasic)?
I don't think, because with my simple code (That I have given you) it's works fine if i run it the first.
If i run the big bad code, the EXTRA session locked, and like the simple code generate an error :|
They are certainly an error in my big code :roll:

I am force to close the extra emulator and run another session for that the simple code works again.

I'm not in my job (Vacancy), i'can't test the code because i have not the IBM session.
I try all that monday and tell you more.

Thanks for your most precious help
I wish you a good week-end

Just a little kiss on the cheek then :lol:

Verfasst: 30.05.2008 16:54
von kwai chang caine
Hello this is already me :D
I'm always in my home, but it's too hard to wait monday :oops:
And i had an idea :D

I was reminded the first great code that ABBKLAUS i give to me :roll:
An i was reminded too that he use TWO variable in his code.

http://www.purebasic.fr/english/viewtop ... 933#198933

WHY ????? he use Resultat and Result ????

It is not my problem ???
Or there is no importance to use the same variable "Result" ?

Verfasst: 30.05.2008 17:25
von ts-soft
Result is a StringPointer and Resultat is a long!

Code: Alles auswählen

dhFreeString(Resultat) 
is superfluous :wink:

stringpointer must be released before they are used again (dhFreeString)!

Verfasst: 30.05.2008 17:56
von kwai chang caine
Thanks TS-SOFT for your explaination 8)
It's good to, do not feel alone, with a problem :allright:

Apparently and if i have understand, the instruction freestring is use only for free string (Obviously, i'm really a mule :oops: )

Well with other like "%d" "%o" it's no important to write the freestring instruction, that's right ??? :D

I have do your method, for the include.
i have removed the "PureDispHelper" and "PureOCXHelper" lib installation of the userlib, and removed the UserLibraries in the SubSystems.

I have run PB 4.20 Beta2 and he said "dh...... is not a fonction .....".
Obviously that's normal.

I have copy the file "PureDisphelper\PureDisphelper\PureBasic\Examples\DispHelper_Include\DispHelper_Include.pb" in the folder of my application.

I have rename this file "DispHelper_Include.pb"in "DispHelper_Include.pbi"

I have add this sentence in begin of my code

Code: Alles auswählen

IncludeFile "DispHelper_Include.pbi"
He asked me the "disphelper.lib"
Then i copy the "PureDisphelper\PureDisphelper\PureBasic\Examples\DispHelper_Include\disphelper.lib" into my folder.

And i have an error on the first dhFreeString line :

Code: Alles auswählen

dhFreeString(Result) 
At the line 53 of this code :

Code: Alles auswählen

IncludeFile "DispHelper_Include.pbi"

Structure SessionTGC 
 Nom.s[5] 
 Adresse.l[5] 
EndStructure 

Global Dim TabSessions.SessionTGC(5) 

Procedure CreateSession() 
    
 Define Count.l 
 Define SessionEnCours.l 
 Define Name.l 
 SessionTGC = dhCreateObject("Extra.Sessions") 
 dhGetValue("%d", @Count, SessionTGC, ".count") 
  
 For Sess = 1 To Count 
  
  dhGetValue("%T", @Name, SessionTGC, ".item(%d)", Sess) 
  dhGetValue("%o", @SessionEnCours, SessionTGC, ".item(%d)", Sess) 
  TabSessions(Sess)\Nom = PeekS(Name) 
  TabSessions(Sess)\Adresse = SessionEnCours 
  dhFreeString(Name) 
  dhFreeString(SessionEnCours) 
  
 Next 
    
EndProcedure 

Procedure AdresseSession(NomSessionChoisie.s) 

 For i = 1 To 5 
  
  If UCase(Trim(TabSessions(i)\Nom)) = UCase(Trim(NomSessionChoisie)) 
   ProcedureReturn TabSessions(i)\Adresse 
  EndIf 
  
 Next 
  
 ProcedureReturn 0 
  
EndProcedure 

Define Result.l 
Define Session.l 
NomSessionChoisie.s = "ERA191"

CreateSession() 
Session = AdresseSession(NomSessionChoisie.s) 
dhGetValue("%T", @Result, Session,".Screen.Area(%d, %d, %d, %d, %m, %d)", 18, 2, 18, 20, 1) 
dhFreeString(Result) 
Debug PeekS(Result)
Session = AdresseSession(NomSessionChoisie) 
 dhGetValue("%d", @Result, Session,".Screen.OIA.Xstatus")
 dhFreeString(Result) 
 
; The Variable Result is good 
Session2 = AdresseSession(NomSessionChoisie.s) 
dhGetValue("%T", @Result, Session,".Screen.Area(%d, %d, %d, %d, %m, %d)", 18, 2, 18, 20, 1) 
dhFreeString(Result) 
; Error at this line 
Debug PeekS(Result)
The life is too hard with me :cry:

Verfasst: 30.05.2008 18:17
von kwai chang caine
In the procedure :

Code: Alles auswählen

Procedure.l dhCreateObject2(ProgId.s, hWnd.l = 0)
  Protected object.IDispatch, Container.IUnknown
  If hWnd = 0
    dhCreateObject_(ProgId, #NUL, @object)
    ProcedureReturn object
  Else
    If AtlAXIsInit = #False
      AtlAxWinInit()
      AtlAXIsInit = #True
    EndIf
    AtlAxCreateControl(ProgId, hWnd, 0, @Container)
    If Container <> 0
      AtlAxGetControl(hWnd, @object)
      ProcedureReturn object
    EndIf
  EndIf
EndProcedure
The object is not created
With or without the handle parameter :cry:

Verfasst: 30.05.2008 18:30
von ts-soft
The include is just to use as the Lib, call dhCreateObject without 2!. The
UserLib must not be uninstalled! The Maros override this. I can't help,
because I haven't this object.

greetings
Thomas

Verfasst: 30.05.2008 19:08
von Kiffi
@kwai chang caine:

don't forget to call

Code: Alles auswählen

dhInitializeImp()
at the beginning of your code and

Code: Alles auswählen

dhUninitialize()
at the end of your code.

Greetings ... Kiffi

Verfasst: 30.05.2008 19:13
von kwai chang caine
Thank my good KIFFY 8)

I do that .....

Verfasst: 30.05.2008 19:17
von kwai chang caine
Yees !!! it was better ...with your two lines

I have always an error but at the second Debug PeekS(Result)