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

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

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


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,
Need whole macro. Please please please copy it in QM with menu Edit -> Other formats -> Forum.
Macro gDN Data
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)
,;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)
,;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)
,;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
,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
,str customerName=wt.CaptureToString
,;Obtain Registration Number
,w=child("" "Edit" w7 0x0 "" 16) ;;editable text
,str regNumber=wt.CaptureToString
,;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)
,str varPOBox=varCRM.a[0].txt
,str varCity=varCRM.a[1].txt
,str varSplitPO
,,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)
,;Obtain mobile number
,int w4=wait(7 win("Philip Jacob's CRM" "KCMLMasterForm_32"))
,w=child("" "Edit" w4 0x0 "" 4) ;;editable text
,str varMobile=wt.CaptureToString
,;Exit Customer CRM
,Acc a5.Find(w4 "PUSHBUTTON" "Exit" "class=ToolBar_Class[]id=66" 0x1005)
,;;**********************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,
Error here:
Copy      Help
str varSplitPO
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:
Copy      Help
str varSplitPO variableForOtherToken
tok(varPOBox &varSplitPO 2 "x" 2)
out varSplitPO
out variableForOtherToken
Copy      Help
ARRAY(str) varSplitPO
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)