Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Exception Error 0xC0000005. Access violation
#1
Dear QM Friends,

I am getting the the below error message pointing to below shown code:
Kindly advise how to go about it.

Code:
;Click Customer button
int w5=win("Vehicle Administration - Display mode " "KCMLMasterForm_32")
Acc a6.Find(w5 "PUSHBUTTON" "Customer" "class=KCMLButton_32[]id=26938" 0x1005)
a6.Mouse(1)

Error:

Error (RT) in gDN Data: Exception 0xC0000005. Access violation. Cannot read memory at 0x5. In qm.exe at 0x4B8714 (0x400000+0xB8714). ?
Exception in destructors of local variables of gDN Data.
Best Regards,
Philip
#2
Need whole macro. Please please please copy it in QM with menu Edit -> Other formats -> Forum.
#3
Macro gDN Data
Code:
Copy      Help
;---- Recorded 28-Sep-13 11:54:00 AM ----

opt slowkeys 1; opt slowmouse 1; spe 100

rep 2
,int w1=act(win("Microsoft Excel - " "XLMAIN"))
,'D; 0.25  ;; Down
,;get selected cells in Excel
,ExcelSheet es.Init
,ARRAY(str) vin
,es.CellsToArray(vin "sel")
,str varVin = vin
,;lef 343 15 win("" "Shell_TrayWnd") 1; 1.82 ;;tool bar 'Running applications', push button 'Vehicle Administration - Al...'
,
,;Click Open
,int w2=act(win("Vehicle Administration " "KCMLMasterForm_32"))
,Acc a.Find(w2 "PUSHBUTTON" "Open" "class=ToolBar_Class[]id=66" 0x1005)
,a.Mouse(1)
,
,;Click Full Chassis
,int w3=wait(5 win("Vehicle Search Window" "KCMLMasterForm_32"))
,Acc a1.Find(w3 "RADIOBUTTON" "Full Chassis" "class=KCMLButton_32[]id=26692" 0x1005)
,a1.Mouse(1)
,
,;Enter Full Chassis from vin variable
,int w=win("Vehicle Search Window" "KCMLMasterForm_32")
,Acc a2.Find(w "TEXT" "" "class=Edit[]state=0x100000 0x20000040" 0x1004)
,key (varVin)
,
,;Click Search
,int w6=win("Vehicle Search Window" "KCMLMasterForm_32")
,Acc a3.Find(w6 "PUSHBUTTON" "Start Search" "class=KCMLButton_32[]id=26686" 0x1005)
,a3.Mouse(1)
,
,;Double click record per given vin variable
,int wMain=win("Vehicle Search Window" "KCMLMasterForm_32")
,w=id(100 wMain) ;;KCMLGridPad_32
,RECT r; SetRect &r 114 21 333 46
,WindowText wt.Init(w r)
,wt.Mouse(4 wt.Find(varVin 0x3))
,
,
,;Click Sales Brief
,wait 30 WT w2 "Vehicle Administration "
,int w7=win("Vehicle Administration - Display mode " "KCMLMasterForm_32")
,;scan "SalesBrief.bmp" child("" "KTabEars" w7) 0 1|2|16
,
,ARRAY(RECT) a4
,scan "SalesBrief.bmp" child("" "KTabEars" w7) 0 1|2|16 8 a4
,lef; 0.25
,
,
,;Obtain Customer Name
,;;int wMain1=win("Vehicle Administration - Display mode " "KCMLMasterForm_32")
,w=child("" "Edit" w7 0x0 "" 7) ;;editable text
,wt.Init(w)
,str customerName=wt.CaptureToString
,wt.End
,
,;Obtain Registration Number
,w=child("" "Edit" w7 0x0 "" 16) ;;editable text
,wt.Init(w)
,str regNumber=wt.CaptureToString
,wt.End
,
,;Obtain PO Box and City in array
,;;int wMain1=win("Vehicle Administration - Display mode " "KCMLMasterForm_32")
,w=child("" "Edit" w7 0x0 "" 8) ;;editable text
,WindowText varCRM.Init(w)
,varCRM.Capture
,varCRM.End
,str varPOBox=varCRM.a[0].txt
,str varCity=varCRM.a[1].txt
,str varSplitPO
,,;split
,,tok(varPOBox varSplitPO 2 "x" 2)
,;Remove Spaces
,varSplitPO.trim(" ")
,
,
,;Click Customer button
,int w5=win("Vehicle Administration - Display mode " "KCMLMasterForm_32")
,Acc a6.Find(w5 "PUSHBUTTON" "Customer" "class=KCMLButton_32[]id=26938" 0x1005)
,a6.Mouse(1)
,
,;Obtain mobile number
,int w4=wait(7 win("Philip Jacob's CRM" "KCMLMasterForm_32"))
,w=child("" "Edit" w4 0x0 "" 4) ;;editable text
,wt.Init(w)
,str varMobile=wt.CaptureToString
,wt.End
,
,;Exit Customer CRM
,Acc a5.Find(w4 "PUSHBUTTON" "Exit" "class=ToolBar_Class[]id=66" 0x1005)
,a5.Mouse(1)
,
,
,
,;;**********************Activate excel & key all obtained variable to excel************************
,act w1
,
,;Key customer Name
,'R; 1     ;; Right
,key (customerName)
,
,
,;Key registration number
,'TTTT; 1  ;; Tab Tab Tab Tab
,key (regNumber)
,'T; 1        ;; Tab
,
,key (varMobile)
,'T; 1
,
,key (varSplitPO)
,
,;Save Excel Data
,'Cs; 3       ;; Ctrl+S

opt slowkeys 0; opt slowmouse 0; spe -1
;----------------------------------------
Best Regards,
Philip
#4
Error here:
Code:
Copy      Help
str varSplitPO
;split
tok(varPOBox varSplitPO 2 "x" 2)
You create 1 str variable (varSplitPO), but specify that you need max 2 tokens with tok. Then tok overwrites some other memory.

Correct code:
Code:
Copy      Help
str varSplitPO variableForOtherToken
;split
tok(varPOBox &varSplitPO 2 "x" 2)
out varSplitPO
out variableForOtherToken
or
Code:
Copy      Help
ARRAY(str) varSplitPO
;split
tok(varPOBox varSplitPO 2 "x" 2)
out varSplitPO[0]
if(varSplitPO.len>=2) out varSplitPO[1]


Forum Jump:


Users browsing this thread: 1 Guest(s)