Sign in to follow this  
Followers 0
Shane0000

Question on Error -1073741819

13 posts in this topic

Im getting this error in a weird way.

Depending on what text I send in a variable autoit errors out or proceeds correctly.

The text variable, if it equals a numeric number (1 2 3) passes correctly:

$oAcadActDoc.SummaryInfo.GetCustomByKey('1',$tTemp4)
ConsoleWrite("$tTemp4:" & $tTemp4 &@CRLF)

The text variable, if it equals a Alphabetic number ('One' 'Two') errors out:

$oAcadActDoc.SummaryInfo.GetCustomByKey('One',$tTemp4) ;supple the 'Name' get the 'Value'
ConsoleWrite("$tTemp4:" & $tTemp4 &@CRLF)

Also before AutoIt errors, it churns for about 25secs on the call w/ "One" as a var

Here is the data I am pulling:

Posted Image

Thanks for any insights.

Share this post


Link to post
Share on other sites



The error code translates to hex 0xC0000005. This means "access violation" according to MSDN.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

You are doing something wrong.

Run this:

ConsoleWrite(ObjName(ObjCreate("AutoCAD.Application"), 4) & @CRLF)

...That will get you location of the file with object's interfaces definitions.

Then load e.g. with that file and post the result.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Yeah, I got the Acad Obj so Ill look into that, thank you.

;
; Works with AutoCad 2012
;
; IAcadSummaryInfo: IAcadSummaryInfo Interface
; Property values:
; Author = ""
; Comments = ""
; HyperlinkBase = ""
; Keywords = ""
; LastSavedBy = "Main"
; RevisionNumber = ""
; Subject = ""
; Title = ""
; Methods supported:
; AddCustomInfo (2)
; GetCustomByIndex (3)
; GetCustomByKey (2)
; NumCustomInfo ()
; RemoveCustomByIndex (1)
; RemoveCustomByKey (1)
; SetCustomByIndex (3)
; SetCustomByKey (2)
$oMyError = ObjEvent("AutoIt.Error","MyErrFunc"); Install a custom error handler
Dim $oAcad
$oAcad = ObjGet("","AutoCAD.Application")
If Not IsObj($oAcad) Then
$oAcad = ObjCreate("AutoCAD.Application")
If NOT IsObj($oAcad) Then
msgbox(0,"0010","error capturing autocad")
EndIf
EndIf
$oAcadActDoc = $oAcad.activedocument
;==========================================
; Properties
;==========================================
ConsoleWrite("$oAcadActDoc.SummaryInfo.Author" & @TAB & @TAB & $oAcadActDoc.SummaryInfo.Author& @CRLF)
ConsoleWrite("$oAcadActDoc.SummaryInfo.Comments" & @TAB & $oAcadActDoc.SummaryInfo.Comments& @CRLF)
ConsoleWrite("$oAcadActDoc.SummaryInfo.HyperlinkBase" & @TAB & $oAcadActDoc.SummaryInfo.HyperlinkBase& @CRLF)
ConsoleWrite("$oAcadActDoc.SummaryInfo.Keywords" & @TAB & $oAcadActDoc.SummaryInfo.Keywords& @CRLF)
ConsoleWrite("$oAcadActDoc.SummaryInfo.LastSavedBy" & @TAB & $oAcadActDoc.SummaryInfo.LastSavedBy& @CRLF)
ConsoleWrite("$oAcadActDoc.SummaryInfo.RevisionNumber" & @TAB & $oAcadActDoc.SummaryInfo.RevisionNumber& @CRLF)
ConsoleWrite("$oAcadActDoc.SummaryInfo.Subject" & @TAB & $oAcadActDoc.SummaryInfo.Subject& @CRLF)
ConsoleWrite("$oAcadActDoc.SummaryInfo.Title" & @TAB & @TAB & $oAcadActDoc.SummaryInfo.Title& @CRLF)
;==========================================
; Methods
;==========================================
; AddCustomInfo (2) Works
; GetCustomByIndex (3) Works - Garbled Data
; GetCustomByKey (2) Works - Garbled Data
; NumCustomInfo () Works
; RemoveCustomByIndex (1) Works
; RemoveCustomByKey (1) Works
; SetCustomByIndex (3) Works
; SetCustomByKey (2) Works
;==========================================
;
; NumCustomInfo () [No Arguments]
;
ConsoleWrite("NumCustomInfo " & @TAB & $oAcadActDoc.SummaryInfo.NumCustomInfo& @CRLF)
;
; RemoveCustomByIndex (1)
; (1) Integer ; Index location
;
Dim $i = 0
while $oAcadActDoc.SummaryInfo.NumCustomInfo > 0
$oAcadActDoc.SummaryInfo.RemoveCustomByIndex (0)
$i += 1
ConsoleWrite("RemoveCustomByIndex " & $i & @CRLF)
wend
;
; AddCustomInfo (1,2)
; (1) String ; Key Name
; (2) String ; Value Name
;
Dim $sKey1 = '1', $sValue1 = 'Value One'
Dim $sKey2 = 'One', $sValue2 = 'Value 2'
$oAcadActDoc.SummaryInfo.AddCustomInfo ($sKey1,$sValue1)
$oAcadActDoc.SummaryInfo.AddCustomInfo ($sKey2,$sValue2)
ConsoleWrite("AddCustomInfo" & @CRLF)
;
; SetCustomByIndex (1,2,3)
; (1) Integer ; Index location
; (2) String ; Key Name
; (3) String ; Value Name
;
For $i = 0 to $oAcadActDoc.SummaryInfo.NumCustomInfo -1
$oAcadActDoc.SummaryInfo.SetCustomByIndex ($i,$i,$i)
ConsoleWrite("SetCustomByIndex " & $i & @CRLF)
Next
;
; SetCustomByKey (1,2)
; (1) String ; Key Name
; (2) String ; Value Name
;
$oAcadActDoc.SummaryInfo.SetCustomByKey ('0','new data')
ConsoleWrite("SetCustomByKey" & @CRLF)
;
; RemoveCustomByKey (1)
; (1) String ; Key Name
;
$oAcadActDoc.SummaryInfo.RemoveCustomByKey('0')
ConsoleWrite("RemoveCustomByKey" & @CRLF)
;
; GetCustomByIndex (1,2,3)
; (1) Integer ; Index location
; (2) String ; Key Name Container for return from AutoCad Returns Garbled Data
; (3) String ; Value Name Container for return from AutoCad Returns Garbled Data
;
dim $sKeyContainer_1
dim $sValueContainer_1
For $i = 0 to $oAcadActDoc.SummaryInfo.NumCustomInfo -1
$oAcadActDoc.SummaryInfo.GetCustomByIndex($i,$sKeyContainer_1,$sValueContainer_1)
ConsoleWrite("GetCustomByIndex " & $i & @TAB & "Key:" & $sKeyContainer_1 &@CRLF& " Value:" & $sValueContainer_1 & @CRLF)
Next
;
; GetCustomByKey (1,2)
; (1) String ; Key Name
; (2) String ; Value Name Container for return from AutoCad Returns Garbled Data
;
dim $sValueContainer_2
$oAcadActDoc.SummaryInfo.GetCustomByKey('1',$sValueContainer_2)
ConsoleWrite("GetCustomByKey" & @TAB & @TAB & "Value:" & @TAB & $sValueContainer_2 &@CRLF)
;ConsoleWrite(VarGetType($sValueContainer_2) & @CRLF)
;¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
;¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ Com Error Handler ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
;¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
Func MyErrFunc()
Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _
"err.description is: " & @TAB & $oMyError.description & @CRLF & _
"err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _
"err.number is: " & @TAB & hex($oMyError.number,8) & @CRLF & _
"err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _
"err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _
"err.source is: " & @TAB & $oMyError.source & @CRLF & _
"err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _
"err.helpcontext is: " & @TAB & $oMyError.helpcontext _
)

Local $err = $oMyError.number
If $err = 0 Then $err = -1

SetError($err)
Endfunc
Edited by Shane0000

Share this post


Link to post
Share on other sites

You are using latest stable version of AutoIt, right?


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Wow , tried to post the whole thing but Firefox crashed.

And im runnng the latest AutoIt 3.3.8.1

Both of these returns are giving me problems.

I saw that this could be used in dll manipulation, How does one know what dll to call ?

18.
STDCALL FUNC PUREVIRTUAL;
         HRESULT GetCustomByIndex(
         [in] int Index,
         [out] BSTR* pKey,
         [out] BSTR* pValue
         );
19.
STDCALL FUNC PUREVIRTUAL;
         HRESULT GetCustomByKey(
         [in] BSTR key,
         [out] BSTR* pValue
         );

COM code uses the BSTR to store a Unicode string, short for "Basic String". (So called because this method of storing strings was developed for OLE Automation, which was at the time motivated by the development of the Visual Basic language engine.)

Here is the whole output from the table function

AutoCad table.txt

Edited by Shane0000

Share this post


Link to post
Share on other sites

Looks like an old bug on our side. Can I have the file to look for my self?


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Here you go.

Thanks for the time / info.

Oh yeah, the returns look like:

Posted Image

Acad_SummaryInfo.au3

Edited by Shane0000

Share this post


Link to post
Share on other sites

I meant the dll.

Never mind, I know what's wrong. Will be fixed for next release. Thank you for your cooperation.

1 person likes this

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Im not really so fluent with the DLLs, how would I tell what DLL that belongs to because id like to try to learn to use some dll calls

Thank you much

Share this post


Link to post
Share on other sites

You'll learn don't worry, take your time and enjoy the process.

When you eventually do, you will say "OMG, how emberassing. That was really stupid question."


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

There are no dumb questions and a quest for knowledge should never leave one embarrassed. :)

Everything was over my head until I learned ...

Njoy :)

1 person likes this

Share this post


Link to post
Share on other sites

Thank you for your time and work on resolving this issue. I have revisited some of these scripts and find that most of the functions return as expected.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0