PureDispHelper UserLib - Update with Includefile for Unicode

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

you can test this:

Code: Select all

dhGetValue("%T", @Result, ".Screen.Area(%d, %d, %d, %d, %m, %b)", 8, 8, 8, 22, 1)
i have sometimes the same error while a value is boolean and not long
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

i believe i have found the problem.

it misses the "Session"

Code: Select all

dhGetValue("%T", @Result, Session,".Screen.Area(%d, %d, %d, %d, %m, %b)", 8, 8, 8, 22, 1)
ImageThe happiness is a road...
Not a destination
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

That's ok !!!!!!

The screen area run correctly now.

I love you :D
ImageThe happiness is a road...
Not a destination
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

A last question please, and i disappear.
I promises you :D

The last function which I need :

Code: Select all

Do  
 Loop Until Session.Screen.OIA.Xstatus = 0
ImageThe happiness is a road...
Not a destination
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

Code: Select all

Define.l Result = 1
While Result
  dhGetValue("%d", @Result, Session,".Screen.OIA.Xstatus")
Wend
or a boolen %b
but i missing: what is to do?
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
mk-soft
Always Here
Always Here
Posts: 6201
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Post by mk-soft »

Is the type unknown used type variant ("%v") for result and checked after GetValue then type of variant.

Code: Select all

dhGetValue("%v", @Result.variant, ...)
debug Result\vt
GT :wink:
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

Hello i'm back :D

Excuse me for the long answer, i have another and hard job (no good) to do in 3 day :cry:

Thank you for your friendly help 8)

Code: Select all

Define.l Result = 1 
While Result 
  dhGetValue("%d", @Result, Session,".Screen.OIA.Xstatus") 
Wend
is the good code, but i want to copy it in a procedure and he don't work :cry:

Code: Select all

Procedure TestOIA()
 
 Define Resultat.l
 Resultat = 1 
       
 Repeat 
  dhGetValue("%d", @Resultat, Session,".Screen.OIA.Xstatus") 
 Until  Resultat = 0 

 Delay(500)

EndProcedure
Image

What is wrong ????
ImageThe happiness is a road...
Not a destination
User avatar
Kiffi
Addict
Addict
Posts: 1484
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Post by Kiffi »

Kwaï chang caïne wrote:A last question please, and i disappear.
I promises you :D
Kwaï chang caïne wrote:Hello i'm back :D
:lol:
Kwaï chang caïne wrote:What is wrong ????
do you define the variable 'Session' global?

Alternatively you can pass the Session-Variable as a proc-parameter:

Code: Select all

Procedure TestOIA(Session.l) ...
Greetings ... Kiffi
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

Hello kiffy

I'm glad to talk you, one more time :D

you are right, I am a little liar :lol:
I really believed that it the last, but i was mistaken.

I held my promise (Just for 3 day :lol: ).
it is that the love :lol:

Thanks for your answer for help me 8)

Yes i don't understand because the variable "Session" is global :shock:

Code: Select all

Procedure TestOIA()
 
 Define Resultat.l
 Resultat = 1 
       
 Repeat 
  dhGetValue("%d", @Resultat, Session,".Screen.OIA.Xstatus") 
 Until  Resultat = 0 

 Delay(500)

EndProcedure

RunProgram ("C:\Program Files\atra.exe") 
Delay(5000)

Global System.l
Global Session.l
Global Result.l 
dhToggleExceptions(#True) 

System = dhCreateObject("atra.System") 

If System 
  
  dhGetValue("%o", @Session, System, ".ActiveSession") 
  
  If Session 
    dhCallMethod(Session, ".Screen.SendKeys(%T)", @"Coucou") 
    TestOIA()
    dhGetValue("%T", @Result, Session,".Screen.Area(%d, %d, %d, %d, %m, %d)", 15, 37, 15, 71, 1)
    TestOIA()
    dhFreeString(Result)
    dhFreeString(Resultat)
    dhReleaseObject(Session) 
    
  Else 
    MessageRequester("", "Couldn't create Session-Object") 
  EndIf 
  
  dhReleaseObject(System) 
  
Else 
  MessageRequester("", "Couldn't create System-Object") 
EndIf
ImageThe happiness is a road...
Not a destination
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

YOOOOOOOOUUUUUPPPPIIIIIII !!!!!!!

That's correct now
Session in global don't work :cry:
The variable session must be passed in parameter

Code: Select all

Procedure TestOIA(Session.l)
kiffi, You have always right 8)
I thank you once again, you are the best.

Thanks two at Ts-Soft for his extraordinary lib.
I had awaited that for two years

i'm not a beautiful girl, but i give you a french kiss for your nice help.
I wish you a good day.

With the pleasure of speaking again you (especially for me :lol: )
ImageThe happiness is a road...
Not a destination
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

:lol:
Global allows the variables to be used as global, ie: they can be accessed inside a Procedure. In this case the command Global for the according variables must be called before the declaration of the procedure. Each variable can have a default value directly assigned to it.
then this could work too :

Code: Select all

Global System.l 
Global Session.l 
Global Result.l 

Procedure TestOIA() 
  
 Define Resultat.l 
 Resultat = 1 
        
 Repeat 
  dhGetValue("%d", @Resultat, Session,".Screen.OIA.Xstatus") 
 Until  Resultat = 0 

 Delay(500) 

EndProcedure 

RunProgram ("C:\Program Files\atra.exe") 
Delay(5000) 

dhToggleExceptions(#True) 

System = dhCreateObject("atra.System") 

If System 
  
  dhGetValue("%o", @Session, System, ".ActiveSession") 
  
  If Session 
    dhCallMethod(Session, ".Screen.SendKeys(%T)", @"Coucou") 
    TestOIA() 
    dhGetValue("%T", @Result, Session,".Screen.Area(%d, %d, %d, %d, %m, %d)", 15, 37, 15, 71, 1) 
    TestOIA() 
    dhFreeString(Result) 
    dhFreeString(Resultat) 
    dhReleaseObject(Session) 
    
  Else 
    MessageRequester("", "Couldn't create Session-Object") 
  EndIf 
  
  dhReleaseObject(System) 
  
Else 
  MessageRequester("", "Couldn't create System-Object") 
EndIf 
Regards Klaus
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

Kwaï chang caïne wrote:The happiness is a road, not a destination
Too true!


You appear to be using @session (address of) in the one case and just session (value of contents) in others.

Edit: Not saying this is the reason, just wondering.
Dare2 cut down to size
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

Thanks at you two 8)
ImageThe happiness is a road...
Not a destination
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

Dare wrote:You appear to be using @session (address of) in the one case and just session (value of contents) in others.

Edit: Not saying this is the reason, just wondering.
For all results (strings, long, object ...) always a pointer (byref) required
Strings and objects have to be freed by you
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post by Xombie »

I'm working on a small project for work and have a question. Is it possible to get information on a current Excel session?

For example, I have Excel already opened and two workbooks loaded. I would like to get the Excel.Application object for those workbooks.

I'm hoping that's using dhGetObject() but I can't seem to get that working.

Can it be done?

Thanks!
Post Reply