dmca Posted June 24, 2011 Posted June 24, 2011 Hi, I've been trying to use dllcall on a simple dll that is designed to convert an inputted string into a PDF417 2D barcode. I have all the info I should be on the dll but I can't seem to get it to work for me. According to what I've read in the DLL's reference manual, I just have to use a function called PDF417Encode. This function looks like this void PDF417Encode( LPCTSTR Message, WORD Mode, WORD ErrorCorrectionLevel, WORD Rows, WORD Columns, BOOL TruncateSymbol, BOOL HandleTilde); $test=DllCall("PDF417Font.dll", "wstr","test","dword*","2","dword","2","dword","3","dword","3", "int", "0", "int", "0") ; I know its just something small I must be doing incorrectly with the call. The values I've selected are recommended by the manual as default. I haven't been able to get a returned value at all My end result is to have a script that I pass a string and its simply outputted as the formatted Barcode. Any help would be appreciated, thx.
water Posted June 24, 2011 Posted June 24, 2011 I used h2au3 from the german AutoIt forum to convert the DLL call to AutoIt. Here is the result:Func PDF417Encode ($Message, $Mode, $ErrorCorrectionLevel, $Rows, $Columns, $TruncateSymbol, $HandleTilde) Local $aRes = DllCall ("PDF417Font.dll", "none", "PDF417Encode", _ "WSTR", $Message, _ "WORD", $Mode, _ "WORD", $ErrorCorrectionLevel, _ "WORD", $Rows, _ "WORD", $Columns, _ "BOOL", $TruncateSymbol, _ "BOOL", $HandleTilde) Return $aRes[0] EndFuncAs I'm not very firm with DLL calls I can't guarantee that this will work My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
dmca Posted June 24, 2011 Author Posted June 24, 2011 Thanks for the reply. That's great. That seems to be the format I was using anyway. All It seems to return is '0'. It seems to be processing correctly but there must be something wrong in the way I am returning the value. I used h2au3 from the german AutoIt forum to convert the DLL call to AutoIt. Here is the result: Func PDF417Encode ($Message, $Mode, $ErrorCorrectionLevel, $Rows, $Columns, $TruncateSymbol, $HandleTilde) Local $aRes = DllCall ("PDF417Font.dll", "none", "PDF417Encode", _ "WSTR", $Message, _ "WORD", $Mode, _ "WORD", $ErrorCorrectionLevel, _ "WORD", $Rows, _ "WORD", $Columns, _ "BOOL", $TruncateSymbol, _ "BOOL", $HandleTilde) Return $aRes[0] EndFunc As I'm not very firm with DLL calls I can't guarantee that this will work
bogQ Posted June 24, 2011 Posted June 24, 2011 well you have "none" return tupe, change it according to documantation for that dll if needed add :cdecl next to return valye eg. DllCall("SQLite.dll", "int:cdecl" TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.
water Posted June 24, 2011 Posted June 24, 2011 According to the manual "0" means: Everything worked fine. As BogQ noted you have to define the return value which seems to be a pointer to a pointer. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now