Jump to content

Beege

MVPs
  • Posts

    958
  • Joined

  • Last visited

  • Days Won

    14

Beege last won the day on June 20 2022

Beege had the most liked content!

2 Followers

About Beege

  • Birthday 06/03/1982

Profile Information

  • Location
    Indiana

Recent Profile Visitors

2,481 profile views

Beege's Achievements

Universalist

Universalist (7/7)

128

Reputation

  1. Thanks for the info @lbsl I did start writing those when I was playing around with the smtp stuff (for attachment options) but never got around to doing a real test with them. Here's what I had if you wanted to do any testing. Func Curl_Mime_Init($Handle) ;curl_mime *curl_mime_init(CURL *easy_handle); Return DllCall($g_hlibcurl, (@AutoItX64 ? "ptr" : "ptr:cdecl"), "curl_mime_init", "ptr", $Handle)[0] EndFunc ;==>Curl_Mime_Init Func Curl_Mime_Addpart($MimeHandle) ;curl_mimepart *curl_mime_addpart(curl_mime *mime); Return DllCall($g_hlibcurl, (@AutoItX64 ? "ptr" : "ptr:cdecl"), "curl_mime_addpart", "ptr", $MimeHandle)[0] EndFunc ;==>curl_mime_addpart Func Curl_Mime_Subparts($MimePart, $MimeHandle) ;CURLcode curl_mime_subparts(curl_mimepart *part, curl_mime *subparts); Return DllCall($g_hlibcurl, (@AutoItX64 ? "int" : "int:cdecl"), "curl_mime_subparts", "ptr", $MimePart, 'ptr', $MimeHandle)[0] EndFunc ;==>curl_mime_subparts Func Curl_Mime_Name($MimePart, $sName) ;CURLcode curl_mime_name(curl_mimepart *part, const char *name); Return DllCall($g_hlibcurl, (@AutoItX64 ? "int" : "int:cdecl"), "curl_mime_name", "ptr", $MimePart, 'str', $sName)[0] EndFunc ;==>curl_mime_name Func Curl_Mime_Filedata($MimePart, $sFilename) ;CURLcode curl_mime_filedata(curl_mimepart *part, const char *filename); Return DllCall($g_hlibcurl, (@AutoItX64 ? "int" : "int:cdecl"), "curl_mime_filedata", "ptr", $MimePart, 'str', $sFilename)[0] EndFunc ;==>curl_mime_filedata Func Curl_Mime_Filename($MimePart, $sFilename) ;CURLcode curl_mime_filename(curl_mimepart *part, const char *filename); Return DllCall($g_hlibcurl, (@AutoItX64 ? "int" : "int:cdecl"), "curl_mime_filename", "ptr", $MimePart, 'str', $sFilename)[0] EndFunc ;==>curl_mime_filename Func Curl_Mime_Data($MimePart, $vData, $iSize = -1) ;CURLcode curl_mime_data(curl_mimepart *part, const char *data, size_t datasize); Local $Type = IsString($vData) ? 'str' : 'ptr' If IsDllStruct($vData) Then $Type = 'struct*' $iSize = DllStructGetSize($vData) EndIf Return DllCall($g_hlibcurl, (@AutoItX64 ? "int" : "int:cdecl"), "curl_mime_data", "ptr", $MimePart, $Type, $vData, 'uint_ptr', $iSize)[0] EndFunc ;==>curl_mime_data Func Curl_Mime_Type($MimePart, $sMimetype) ;CURLcode curl_mime_type(curl_mimepart *part, const char *mimetype); Return DllCall($g_hlibcurl, (@AutoItX64 ? "int" : "int:cdecl"), "curl_mime_type", "ptr", $MimePart, 'str', $sMimetype)[0] EndFunc ;==>curl_mime_type Func Curl_Mime_Encoder($MimePart, $sEnc) ;CURLcode curl_mime_encoder(curl_mimepart *part, const char *encoding); Return DllCall($g_hlibcurl, (@AutoItX64 ? "int" : "int:cdecl"), "curl_mime_encoder", "ptr", $MimePart, 'str', $sEnc)[0] EndFunc ;==>curl_mime_encoder Func Curl_Mime_Headers($MimePart, $pSLIST, $iTakeOwnership = 1) ;CURLcode curl_mime_headers(curl_mimepart *part, struct curl_slist *headers, int take_ownership); Return DllCall($g_hlibcurl, (@AutoItX64 ? "int" : "int:cdecl"), "curl_mime_headers", "ptr", $MimePart, 'ptr', $pSLIST, 'int', $iTakeOwnership)[0] EndFunc ;==>curl_mime_headers
  2. I was able to get the imap append example working to save sent items. This was a real pain in the ass due to that example being wrong in multiple ways so I got to rant a little bit. For starters it states twice that we are sending an email when we are not, we are just appending one. /* <DESC> * IMAP example showing how to send emails * </DESC> /* This is a simple example showing how to send mail using libcurl's IMAP * capabilities. They clarify this in the RFC Note: The APPEND command is not used for message delivery, because it does not provide a mechanism to transfer [SMTP] envelope information. Then we get to the guts of the example. This is wrong curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com/100"); And will give you errors like this ;< A002 OK Logged in ;> A003 APPEND Sent/3 (\Seen) {125} ;< A003 NO [TRYCREATE] Mailbox doesn't exist: Sent/3 (0.001 + 0.000 secs). ;> A004 LOGOUT ;< * BYE Logging out I ended up down a rabbit hole with TRYCREATE. If you read the rfc for that, it seems like everything is kinda doing what its suppose to be only the email client isn't re-asking to create the email.. If the destination mailbox does not exist, a server MUST return an error, and MUST NOT automatically create the mailbox. Unless it is certain that the destination mailbox can not be created, the server MUST send the response code "[TRYCREATE]" as the prefix of the text of the tagged NO response. This gives a hint to the client that it can attempt a CREATE command and retry the APPEND if the CREATE is successful. Finally I found this link from 2016 reporting basically the same problem I'm seeing and got the syntax right. Same syntax I got in all the other examples. I should have just guessed. ; #FUNCTION# ==================================================================================================================== ; Name ..........: Example_Email_Append ; Description ...: Appends an email to a directory. (Use to save sent emails in sent folder) ; Parameters ....: $sIMAPServer - imap server address. ex: imap.comcast.net ; $sUser - username/email address ; $sPass - password ; $sTo - recepient address ; $sFrom - sender address ; $sSubject - email subject ; $sBody - email body ; $sDirName - Directory Name ex: Outbox, Sent Items, Sent ; Remarks .......: This does not send an email. Just creates a copy ; =============================================================================================================================== Func Example_Email_Append($sIMAPServer, $sUser, $sPass, $sTo, $sFrom, $sSubject, $sBody, $sDirName = 'Sent') ;Build email Local $sHeaders = "To: <" & $sTo & ">" & @CRLF $sHeaders &= "From: <" & $sFrom & ">" & @CRLF ;~ $sHeaders &= "CC: <" & $sCC & ">" & @CRLF ;~ $sHeaders &= "BCC: <" & $sBCC & ">" & @CRLF $sHeaders &= "Subject: " & $sSubject & @CRLF Local $sEmail = $sHeaders & @CRLF & $sBody Local $Curl = Curl_Easy_Init() If Not $Curl Then Return Curl_Easy_Setopt($Curl, $CURLOPT_VERBOSE, 1) ; Curl_Easy_Setopt($Curl, $CURLOPT_USERNAME, $sUser) ; Curl_Easy_Setopt($Curl, $CURLOPT_PASSWORD, $sPass) ; Curl_Easy_Setopt($Curl, $CURLOPT_CAINFO, @ScriptDir & '\curl-ca-bundle.crt') ; Curl_Easy_Setopt($Curl, $CURLOPT_WRITEFUNCTION, Curl_DataWriteCallback()) Curl_Easy_Setopt($Curl, $CURLOPT_WRITEDATA, $Curl) ;request next uid Curl_Easy_Setopt($Curl, $CURLOPT_CUSTOMREQUEST, 'STATUS "' & $sDirName & '" (UIDNEXT)') Curl_Easy_Setopt($Curl, $CURLOPT_URL, "imaps://" & $sIMAPServer) Local $Code = Curl_Easy_Perform($Curl) If $Code = $CURLE_OK Then Local $aNextUID = StringRegExp(BinaryToString(Curl_Data_Get($Curl)), 'UIDNEXT\h(\d+)', 3) If Not @error Then ConsoleWrite('next uid = ' & $aNextUID[0] & @CRLF) Curl_Easy_Reset($Curl) ; clear all previous options Curl_Easy_Setopt($Curl, $CURLOPT_VERBOSE, 1) ; Curl_Easy_Setopt($Curl, $CURLOPT_USERNAME, $sUser) ; Curl_Easy_Setopt($Curl, $CURLOPT_PASSWORD, $sPass) ; Curl_Easy_Setopt($Curl, $CURLOPT_CAINFO, @ScriptDir & '\curl-ca-bundle.crt') ; ;Set email data and callback Curl_Data_Put($Curl, $sEmail) Curl_Easy_Setopt($Curl, $CURLOPT_UPLOAD, 1) Curl_Easy_Setopt($Curl, $CURLOPT_READFUNCTION, Curl_DataReadCallback()) Curl_Easy_Setopt($Curl, $CURLOPT_READDATA, $Curl) Curl_Easy_Setopt($Curl, $CURLOPT_INFILESIZE, StringLen($sEmail)) ;set filesize ;Curl_Easy_Setopt($Curl, $CURLOPT_CONNECTTIMEOUT,20); very helpful when troubleshooting. default is 300 secs $sDirName = StringReplace($sDirName, ' ', '%20') ; replace spaces Curl_Easy_Setopt($Curl, $CURLOPT_URL, "imaps://" & $sIMAPServer & "/" & $sDirName & ";UID=" & $aNextUID[0]) ;append email Local $Code = Curl_Easy_Perform($Curl) If $Code = $CURLE_OK Then ConsoleWrite('append OK' & @CRLF) Else ConsoleWrite(Curl_Easy_StrError($Code) & @LF) ConsoleWrite('append failed' & @CRLF) EndIf Else ConsoleWrite('extract uidnext failed' & @CRLF) EndIf Else ConsoleWrite('request uidnext failed' & @CRLF) EndIf Curl_Data_Cleanup($Curl) Curl_Easy_Cleanup($Curl) ; EndFunc ;==>Example_Email_Append
  3. This works for the base64 encoded subjects, but I'm not finding much info for the quopri encoding that article talks about (outside of python). I dont think any of the emails im working with are encoded with quopri so not sure its that common. Func _encoded_word_syntax_test() $sTest = "=?UTF-8?B?VG9wIFdhdGNoYXRob24gcGlja3Mgd2UgdGhpbmsgeW91J2xsIA==?=" $aEWS = StringRegExp($sTest, '=\?(.*)\?(.)\?(.*)\?=', 3); seperates charset, encoding, encoded-text ;_ArrayDisplay($aEWS) If $aEWS[1] = "B" Then; base64 encoded $sDecode = BinaryToString(_Base64Decode($aEWS[2])) ConsoleWrite($sDecode & @CRLF) Else ;quopri encoded EndIf EndFunc Func _Base64Decode($sB64) Local $iLen = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64, "dword", 0, "dword", 1, "ptr", NULL, "dword*", 0, "ptr", 0, "ptr", 0)[5] Local $tDecoded = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64, "dword", 0, "dword", 1, "struct*", DllStructCreate("byte[" & $iLen & "]"), "dword*", $iLen, "ptr", 0, "ptr", 0)[4] Return DllStructGetData($tDecoded, 1) EndFunc ;==>_Base64Decode edit: Actually this is better for the multi-line subjects extracting only base64 encoded text. Also noticing there's something weird about the single quote character (') being used in a subject. It translates like its a special character or something $sTest = "Subject: =?utf-8?B?V2VsY29tZSB0byBYRklOSVRZIENvbm5lY3QgRW1haWwhIExldA==?=" & @CRLF & _ @TAB & "=?utf-8?B?4oCZcyBnZXQgc3RhcnRlZA==?=" $aEWS = StringRegExp($sTest, '(?m)^(?:Subject\:\h|\h)?=\?.*\?B\?(.*)\?=$', 3) ; grabs only the base64 portion from each line If Not @error Then _ArrayDisplay($aEWS) Local $sDecode For $sEnc In $aEWS $sDecode &= BinaryToString(_Base64Decode($sEnc)) Next ConsoleWrite($sDecode & @CRLF) EndIf Edit: Fix for the single quote weirdness is to use the charset specified (utf-8 for this one) in the binarytostring() call options $sDecode &= BinaryToString(_Base64Decode($sEnc), 4)
  4. I modified the example above to also get the date,from,to in addition to the subject only. For anyone who has some subject lines that look like this below, I found this article: https://dmorgan.info/posts/encoded-word-syntax/ Subject: =?UTF-8?B?VG9wIFdhdGNoYXRob24gcGlja3Mgd2UgdGhpbmsgeW91J2xsIA==?=
  5. Here's a small example showing how to loop through the emails. This will print the subject line of the first 100 emails from the inbox. Func Example_Email_Subjects($sServer, $sUser, $sPass) Local $Curl = Curl_Easy_Init() If Not $Curl Then Return Local $emsg = $Curl Curl_Easy_Setopt($Curl, $CURLOPT_USERNAME, $sUser) ; Curl_Easy_Setopt($Curl, $CURLOPT_PASSWORD, $sPass) ; Curl_Easy_Setopt($Curl, $CURLOPT_CAINFO, @ScriptDir & '\curl-ca-bundle.crt') ; Curl_Easy_Setopt($Curl, $CURLOPT_WRITEFUNCTION, Curl_DataWriteCallback()) Curl_Easy_Setopt($Curl, $CURLOPT_WRITEDATA, $emsg) ;Curl_Easy_Setopt($Curl, $CURLOPT_VERBOSE, 1) ; For $i = 1 To 100 ; get full email ;Curl_Easy_Setopt($Curl, $CURLOPT_URL, "imaps://" & $sServer & "/INBOX/;UID=" & $i) ; get subject only ;Curl_Easy_Setopt($Curl, $CURLOPT_URL, "imaps://" & $sServer & "/INBOX/;UID=" & $i & ";SECTION=HEADER.FIELDS%20(SUBJECT)") ; get date,from,to,subject only Curl_Easy_Setopt($Curl, $CURLOPT_URL, "imaps://" & $sServer & "/INBOX/;UID=" & $i & ";SECTION=HEADER.FIELDS%20(DATE%20FROM%20TO%20SUBJECT)") $Code = Curl_Easy_Perform($Curl) ; If $Code = $CURLE_OK Then ConsoleWrite($i & ': ' & BinaryToString(Curl_Data_Get($emsg)) & @CRLF) Curl_Data_Cleanup($emsg); clear data Else ConsoleWrite(Curl_Easy_StrError($Code) & @LF) ExitLoop EndIf Next Curl_Easy_Cleanup($Curl) EndFunc ;==>Example_Email_Subjects
  6. Nice! I just got a custom request working asking for total count of messages in the inbox which falls inline with what we need to do for the EXAMINE command they talk about. I found this link too with a bunch other custom requests that can be used. All the -X ones. https://gist.github.com/akpoff/53ac391037ae2f2d376214eac4a23634 Func Example_Email_Count($sServer, $sUser, $sPass) Local $Curl = Curl_Easy_Init() If Not $Curl Then Return Local $emsg = $Curl ;set options Curl_Easy_Setopt($Curl, $CURLOPT_USERNAME, $sUser) ; Curl_Easy_Setopt($Curl, $CURLOPT_PASSWORD, $sPass) ; Curl_Easy_Setopt($Curl, $CURLOPT_CAINFO, @ScriptDir & '\curl-ca-bundle.crt') ; Curl_Easy_Setopt($Curl, $CURLOPT_WRITEFUNCTION, Curl_DataWriteCallback()) Curl_Easy_Setopt($Curl, $CURLOPT_WRITEDATA, $emsg) ;Curl_Easy_Setopt($Curl, $CURLOPT_VERBOSE, 1) ; ;Request count of messeges in inbox Curl_Easy_Setopt($Curl, $CURLOPT_CUSTOMREQUEST, "STATUS INBOX (MESSAGES)") ; Curl_Easy_Setopt($Curl, $CURLOPT_URL, "imaps://" & $sServer) ; $Code = Curl_Easy_Perform($Curl) ; If $Code = $CURLE_OK Then ConsoleWrite('email count ' & @CRLF & BinaryToString(Curl_Data_Get($emsg)) & @CRLF & '----****------' & @CRLF) Else ConsoleWrite(Curl_Easy_StrError($Code) & @LF) EndIf Curl_Data_Cleanup($emsg) Curl_Easy_Cleanup($Curl) EndFunc ;==>Example_Email_Count Output: email count: * STATUS INBOX (MESSAGES 61)
  7. I was able to get a minimal example going for sending an email via smtp/smtps but it does not save to the sent box. Is that how this is actually implemented? Some kind of combination of using both smtp and imap/pop3? I never thought about what actually makes that happen with the sent messages. I'm mainly working of the examples here https://curl.se/libcurl/c/example.html if anyone else wants to tinker with whatever options exist for the protocols. ; #FUNCTION# ==================================================================================================================== ; Name ..........: Example_Email_Send ; Description ...: Send a Email ; Parameters ....: $sServer - server address. ex: smtp.comcast.net ; $sUser - username/email address ; $sPass - password ; $sTo - recepient address ; $sFrom - sender address ; $sSubject - email subject ; $sBody - email body ; $sProt - protocol. smtp/smtps ; =============================================================================================================================== Func Example_Email_Send($sServer, $sUser, $sPass, $sTo, $sFrom, $sSubject, $sBody, $sProt = 'smtp') ;Build email Local $sHeaders = "To: <" & $sTo & ">" & @CRLF $sHeaders &= "From: <" & $sFrom & ">" & @CRLF ;~ $sHeaders &= "CC: <" & $sCC & ">" & @CRLF ;~ $sHeaders &= "BCC: <" & $sBCC & ">" & @CRLF $sHeaders &= "Subject: " & $sSubject & @CRLF Local $sEmail = $sHeaders & @CRLF & $sBody Local $Curl = Curl_Easy_Init() If Not $Curl Then Return ;Set username and password Curl_Easy_Setopt($Curl, $CURLOPT_USERNAME, $sUser) ; Curl_Easy_Setopt($Curl, $CURLOPT_PASSWORD, $sPass) ; ;set server address and protocol If $sProt = "smtp" Then Curl_Easy_Setopt($Curl, $CURLOPT_URL, "smtp://" & $sServer & ":587") ; Curl_Easy_Setopt($Curl, $CURLOPT_USE_SSL, $CURLUSESSL_ALL) ; ElseIf $sProt = "smtps" Then Curl_Easy_Setopt($Curl, $CURLOPT_URL, "smtps://" & $sServer) ; Else Return ConsoleWrite("invalid protocol" & @CRLF) EndIf ;Set ca bundle for peer verification Curl_Easy_Setopt($Curl, $CURLOPT_CAINFO, @ScriptDir & '\curl-ca-bundle.crt') ; ;build and set recipient list Local $recipients = Curl_Slist_Append(0, $sTo) ; ;$recipients = Curl_Slist_Append($recipients, $sCC); ;$recipients = Curl_Slist_Append($recipients, $sBCC); Curl_Easy_Setopt($Curl, $CURLOPT_MAIL_RCPT, $recipients) ; ;set from address Curl_Easy_Setopt($Curl, $CURLOPT_MAIL_FROM, $sFrom) ; ;Set email data and callback Curl_Data_Put($Curl, $sEmail) Curl_Easy_Setopt($Curl, $CURLOPT_UPLOAD, 1) Curl_Easy_Setopt($Curl, $CURLOPT_READFUNCTION, Curl_DataReadCallback()) Curl_Easy_Setopt($Curl, $CURLOPT_READDATA, $Curl) ;show extra connection info Curl_Easy_Setopt($Curl, $CURLOPT_VERBOSE, 1) ; ;Send email Local $Code = Curl_Easy_Perform($Curl) If $Code = $CURLE_OK Then ConsoleWrite('Email Sent!' & @CRLF) Else ConsoleWrite(Curl_Easy_StrError($Code) & @LF) EndIf ;cleanup Curl_Slist_Free_All($recipients) ; Curl_Easy_Cleanup($Curl) ; EndFunc ;==>Example_Email_Send
  8. @mLipok here is a small example demonstrating retrieving an email using either pop3,pop3s,imap,imaps. Ill work on smtp,smtps next ; #FUNCTION# ==================================================================================================================== ; Name ..........: Example_Email_Fetch ; Description ...: Fetch message 1 from inbox ; Parameters ....: $sServer - server address. ex: imap.comcast.net ; $sUser - username/email address ; $sPass - password ; $sProt - protocol. imap,imaps,pop3,pop3s ; =============================================================================================================================== Func Example_Email_Fetch($sServer, $sUser, $sPass, $sProt = 'imaps') Local $Curl = Curl_Easy_Init() If Not $Curl Then Return Local $emsg = $Curl ;Set username and password Curl_Easy_Setopt($Curl, $CURLOPT_USERNAME, $sUser) ; Curl_Easy_Setopt($Curl, $CURLOPT_PASSWORD, $sPass) ; ;This will fetch message 1 (oldest message) from the user's inbox Switch $sProt Case 'imaps' Curl_Easy_Setopt($Curl, $CURLOPT_URL, "imaps://" & $sServer & "/INBOX/;UID=1") ; Case 'imap' Curl_Easy_Setopt($Curl, $CURLOPT_URL, "imap://" & $sServer & "/INBOX/;UID=1") ; Curl_Easy_Setopt($Curl, $CURLOPT_USE_SSL, $CURLUSESSL_ALL) ; Case 'pop3s' Curl_Easy_Setopt($Curl, $CURLOPT_URL, "pop3s://" & $sServer & "/1") ; Case 'pop3' Curl_Easy_Setopt($Curl, $CURLOPT_URL, "pop3://" & $sServer & "/1") ; Curl_Easy_Setopt($Curl, $CURLOPT_USE_SSL, $CURLUSESSL_ALL) ; Case Else Return ConsoleWrite('Invalid Protocol' & @CRLF) EndSwitch ;Set ca bundle for peer verification Curl_Easy_Setopt($Curl, $CURLOPT_CAINFO, @ScriptDir & '\curl-ca-bundle.crt') ; ;Set Callback to recive msg Curl_Easy_Setopt($Curl, $CURLOPT_WRITEFUNCTION, Curl_DataWriteCallback()) Curl_Easy_Setopt($Curl, $CURLOPT_WRITEDATA, $emsg) ;show extra connection info Curl_Easy_Setopt($Curl, $CURLOPT_VERBOSE, 1) ; ;Perform the fetch $Code = Curl_Easy_Perform($Curl) ; If $Code = $CURLE_OK Then ConsoleWrite('email msg:' & @CRLF & BinaryToString(Curl_Data_Get($emsg))) Else ConsoleWrite(Curl_Easy_StrError($Code) & @LF) EndIf ;cleanup Curl_Easy_Cleanup($Curl) Curl_Data_Cleanup($emsg) Return $Code ; EndFunc ;==>Example_Email_Fetch
  9. Here is a rewrite of Wards Curl UDF with the binary portion removed so that it can support external (updated) library's and add support for x64. I added quite a few new header constants and also have included the curl-ca-bundle certificate. I modified the first two "easy" examples to demonstrate using the ca-bundle to verify the SSL peer. I also added a new example showing how to download the certificate chain. The 7.82.0 version dlls are included but they can be replaced with updated versions as they come out in the future. You can find future releases here : https://curl.se/windows/ Let me know if you have any issues. Cheers! 🙂 Curlx64.7z
  10. Here is a small and simple little script for creating a tiny cpu indicator bar that sits right above the taskbar like in the pic below. I got the idea from an android phone app called micro cpu and liked the concept. _TinyCPU.au3
  11. Sounds good. Definitely compare the two because the compiled example and iDispatchasm.au3 are the same thing, just one has all the source assembly code and gets compiled on the fly every time you run it with fasmg and the other has all the assembly code replaced with precompile machine code. So the example one would not need the fasmg and include folder to run where the iDispatchasm.au3 does.
  12. The way you quoted "Dllcall" here has got me a bit confused. Are you talking about splitting the example into a separate file with "include Idispatchasm.au3" so they are 2 scripts? I found the issue going on with the betas and have reuploaded with the fix. The fix is updating the flags check to force a word value instead of default within the invoke method and should be done for 32bit as well even though its doesnt seem to be a problem. _(' .if word[wFlags] = DISPATCH_PROPERTYGET');.. line 207
  13. Thank you for that. This is indeed a pickle. I got the beta portion narrowed down to it not liking the any of the direct get code and setting the dllstruct name directly by name. Commenting that portion out gets the rest of it working and gives me something to look at but I'm stumped for what would be going on between windows versions. Local $aArray = [111, 222, 333] $oIDispatch = IDispatchASM() $oIDispatch.string = "string test" $oIDispatch.__string = "__string test2" $oIDispatch.float = 12.345145 $oIDispatch.array = $aArray $oIDispatch.binary = Binary(12345678) $oIDispatch.bool = True $oIDispatch.dllStruct = DllStructCreate("BYTE t") ;~ $oIDispatch.dllStruct.t = 99 ;~ ConsoleWrite('-Direct get test:' & @CRLF & _ ;~ '$oIDispatch.string = ' & $oIDispatch.string & @CRLF & _ ;~ '$oIDispatch.__string = ' & $oIDispatch.__string & @CRLF & _ ;~ '$oIDispatch.float = ' & $oIDispatch.float & @CRLF & _ ;~ '$oIDispatch.array[1] = ' & $oIDispatch.array[1] & @CRLF) ConsoleWrite('-method __keysau3 test:' & @CRLF) Local $aKeyAU3s = $oIDispatch.__keysau3() ConsoleWrite('$aKeyAU3s = ' & _ArrayToString($aKeyAU3s) & @CRLF) ConsoleWrite('-method __get test:' & @CRLF) For $k In $oIDispatch.__keysau3() $val = $oIDispatch.__get($k) ConsoleWrite('$oIDispatch.' & $k & ' = ' & (IsArray($val) ? _ArrayToString($val) : (IsDllStruct($val) ? DllStructGetData($val, 1) : $val)) & @CRLF) Next ConsoleWrite('-method __set test:' & @CRLF) Local $i = 0 For $k In $oIDispatch.__keysau3() $oIDispatch.__set($k) = $i ConsoleWrite('$oIDispatch.' & $k & ' = ' & $oIDispatch.__get($k) & @CRLF) $i += 1 Next >"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /beta /ErrorStdOut /in "F:\AutoIt Scripts\FLAT Assembler\fasmg dll\IDispatchASM\IdispatchASM_compiled_example.au3" /UserParams +>14:51:22 Starting AutoIt3Wrapper v.19.102.1901.0 SciTE v.4.1.2.0 Keyboard:00000409 OS:WIN_10/ CPU:X64 OS:X64 Environment(Language:0409) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\BJ\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\BJ\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.15.2) from:C:\Program Files (x86)\AutoIt3\Beta input:F:\AutoIt Scripts\FLAT Assembler\fasmg dll\IDispatchASM\IdispatchASM_compiled_example.au3 +>14:51:22 AU3Check ended.rc:0 >Running:(3.3.15.2):C:\Program Files (x86)\AutoIt3\Beta\autoit3_x64.exe "F:\AutoIt Scripts\FLAT Assembler\fasmg dll\IDispatchASM\IdispatchASM_compiled_example.au3" +>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop -method __keysau3 test: $aKeyAU3s = string|__string|float|array|binary|bool|dllStruct -method __get test: $oIDispatch.string = string test $oIDispatch.__string = __string test2 $oIDispatch.float = 12.345145 $oIDispatch.array = 111|222|333 $oIDispatch.binary = 0x4E61BC00 $oIDispatch.bool = True $oIDispatch.dllStruct = 0 -method __set test: $oIDispatch.string = 0 $oIDispatch.__string = 1 $oIDispatch.float = 2 $oIDispatch.array = 3 $oIDispatch.binary = 4 $oIDispatch.bool = 5 $oIDispatch.dllStruct = 6 +>14:51:22 AutoIt3.exe ended.rc:0 +>14:51:22 AutoIt3Wrapper Finished. >Exit code: 0 Time: 0.8726
  14. Did you get the same result for the compiled example? I justed tested on a second pc and everything seems ok. I'm definitely running 3.3.14.5. If the compiled example works then this may have something to do with the path of your 32bit version of autoit.exe, but the script should have given you a message saying it couldnt find the exe. Edit: I'm actually seeing the opposite. The only beta I can get x64 compiled example to work is 3.3.15.0. I get a crash when using beta version's 3.3.15.1, 3.3.15.2, and 3.3.15.3 >"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\bj\Downloads\IDispatchASM 5-24-2020\IdispatchASM.au3" /UserParams +>11:46:30 Starting AutoIt3Wrapper v.19.102.1901.0 SciTE v.4.1.2.0 Keyboard:00000409 OS:WIN_10/ CPU:X64 OS:X64 Environment(Language:0409) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\bj\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\bj\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.14.5) from:C:\Program Files (x86)\AutoIt3 input:C:\Users\bj\Downloads\IDispatchASM 5-24-2020\IdispatchASM.au3 +>11:46:30 AU3Check ended.rc:0 >Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\Users\bj\Downloads\IDispatchASM 5-24-2020\IdispatchASM.au3" +>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop -Direct get test: $oIDispatch.string = string test $oIDispatch.__string = __string test2 $oIDispatch.float = 12.345145 $oIDispatch.array[1] = 222 -method __keysau3 test: $aKeyAU3s = string|__string|float|array|binary|bool|dllStruct -method __get test: $oIDispatch.string = string test $oIDispatch.__string = __string test2 $oIDispatch.float = 12.345145 $oIDispatch.array = 111|222|333 $oIDispatch.binary = 0x4E61BC00 $oIDispatch.bool = True $oIDispatch.dllStruct = 99 -method __set test: $oIDispatch.string = 0 $oIDispatch.__string = 1 $oIDispatch.float = 2 $oIDispatch.array = 3 $oIDispatch.binary = 4 $oIDispatch.bool = 5 $oIDispatch.dllStruct = 6 +>11:46:32 AutoIt3.exe ended.rc:0 +>11:46:32 AutoIt3Wrapper Finished. >Exit code: 0 Time: 2.767
×
×
  • Create New...