XinLu Posted February 18, 2008 Share Posted February 18, 2008 Here is the dll file that I am going to use:http://www.idautomation.com/fonts/tools/activexdll/Here is what I used in my code:$dll = DllOpen("IDAutomationFontEncoder.dll") $result = DllCall($dll, "str", "Code128b", "str", "TestString") MsgBox(0, Default, $result)I got "0" as my output.Am I using DllCall correctly?? How could I fix my problem?Hint: I am tring to make a barcode generator. This dll file provides some kind of "barcode fonts". I am not pretty sure if a "barcode font" is string type or something else.Thx alot!!! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 18, 2008 Moderators Share Posted February 18, 2008 Dll's return an array with DllCall: $result[0] Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
XinLu Posted February 18, 2008 Author Share Posted February 18, 2008 Dll's return an array with DllCall: $result[0] I tried, and here is what I got: Subscript used with non-Array variable. I think my DLLCall didn't work properly, so my $result was not initialized to hold the returns from dll function Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 18, 2008 Moderators Share Posted February 18, 2008 I tried, and here is what I got:Subscript used with non-Array variable.I think my DLLCall didn't work properly, so my $result was not initialized to hold the returns from dll functionOk, first question before I read the documentation... did you do this:Step1: Register the DLL by running the Install.exe file. To register the ActiveX DLL manually perform the following:Step2: Make sure the VB 6.0 runtime files are installed on the destination machine; then, copy the DLL to the %Windows%\System directory and register it. To do this, go to the command prompt, change to the %Windows%\System directory and type the following command: REGSVR32 "IDAutomationFontEncoder.dll".Step3: After registering the DLL, the DLL can be referenced from within the application. Refer to the application's documentation for instructions on how to do this. In Visual Basic 6.0 choose Project - References and select the IDAutomationDLL. Then reference the class and function as in the following example:? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
XinLu Posted February 18, 2008 Author Share Posted February 18, 2008 Ok, first question before I read the documentation... did you do this:?I assumed $dll = DllOpen("IDAutomationFontEncoder.dll") will pass the dll handler to DLLCall, so it is not necessary to do it.However, I did actually register the dll file, which is step 1 & 2, but not step 3. I didn't use VB, so I guess it is not needed in my case. Link to comment Share on other sites More sharing options...
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