devilyn Posted October 8, 2010 Share Posted October 8, 2010 hello all, i need help calling a dll using the information bellow "DLL API Doc: AEC_PCTC_GET_NUMBER_OF_DEVICES QuickInfo Overview Group The AEC_PCTC_GET_NUMBER_OF_DEVICES function returns the number of devices that the DLL detected upon being loaded by the operating system. This count is based upon the device registry and should be the same as the number of "WinRTdevX" devices (where X = 0-15) that the 'DLLMAIN' function automatically detected. In other words, the number of AEC time code boards installed in the computer should equal the count that this function returns. int AEC_PCTC_GET_NUMBER_OF_DEVICES( VOID ); PARAMETERS: (NONE) RETURN VALUE: This function returns an int which has a value from 0-16d. If only one time code board is installed, should be 01h." this is what i got so far but it doesn't seems to work. $dll = DllOpen(@ScriptDir&"\AEC_NTTC.dll") ConsoleWrite("Dll Handle:"&$dll&@CRLF) $result = DllCall($dll, "int", "AEC_PCTC_GET_NUMBER_OF_DEVICES") MsgBox(0,"",$result) DllClose($dll) thanks in advance Link to comment Share on other sites More sharing options...
Yashied Posted October 8, 2010 Share Posted October 8, 2010 DllCall() returns an array. $hDll = DllOpen(@ScriptDir & '\AEC_NTTC.dll') $aResult = DllCall($hDll, 'int', 'AEC_PCTC_GET_NUMBER_OF_DEVICES') If @error Then MsgBox(0, '', 'DllCall() error: ' & @error) Else MsgBox(0, '', 'Result: ' & $aResult[0]) EndIf DllClose($hDll) My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
devilyn Posted October 22, 2010 Author Share Posted October 22, 2010 Hey i wanted to thank you for helping me with the dll call. it was really helpful. now i have another call i'm struggling with cant figure out how to use lpdword & lpword. Heres the info: AEC_PCTC_READ_4BYTES QuickInfo Overview Group The AEC_PCTC_READ_4BYTES function reads four data bytes at the offset address specified (for the board whose address is also passed as a parameter), and places the data into the double word variable whose address is passed as a parameter. BOOL AEC_PCTC_READ_4BYTES( LPDWORD lpReadL, LPWORD lpAddrOff, LPWORD lpBrdAddr ); PARAMETERS: lpReadL This parameter points to the double word variable which will receive the four bytes read from the board. lpAddrOff This parameter points to a 16-bit word which contains an OFFSET address (relative to the base address of the board) for the byte to be read from the board. Note that the offset address must be limited to 00h for IOR & MMR boards, and must be limited to 000h-3FCh for all other PC-LTC, PC-VITC, and PC-VLTC boards. lpBrdAddr Identifies the base address where the board is installed (or may be installed). For example, set lpBrdAddr = &Address, where WORD Address = 0xCC00 (memory mapped), or Address = 0x2A0 (I/O mapped). Set Address to match the board's address jumper. RETURN VALUE: The function returns a TRUE (1, OK) or FALSE (0, error). REMARKS: Reads the four bytes starting at the desired offset address (with respect to the board's base address). For IOR and MMR boards, the only allowable offset value is 00h (any other value will return an error). thanks in advance Link to comment Share on other sites More sharing options...
Yashied Posted October 22, 2010 Share Posted October 22, 2010 $aResult = DllCall('AEC_NTTC.dll', 'bool', 'AEC_PCTC_READ_4BYTES', 'dword*', $iReadL, 'word*', $iAddrOff, 'word*', $iBrdAddr) If (@error) Or (Not $aResult[0]) Then MsgBox(0, '', 'Error!') Else MsgBox(0, '', 'OK') EndIf My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... 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