CmdrVimes Posted April 27, 2012 Share Posted April 27, 2012 (edited) I have a small issue with ControlClick throwing up a LNK2019 error in Visual C++ 2010 Express. I'm a bit new to C++ (started learning 3 days ago to be precise) but I've done some C, Java, and of course AutoIT. I've already written this in AutoIT and it worked fine, I am just porting it to C++. void tabSelect() { int selected = 0; wchar_t tabText[5]; while (selected == 0) { AU3_ControlClick(L"", L"", L"[CLASS:SysTabControl32]", L"",1,175,30); AU3_WinGetText(L"",L"RS232",tabText,5); if (tabText == L"RS232") selected = 1; else AU3_ControlClick(L"", L"", L"[CLASS:SysTabControl32]", L"",1,175,10); } } To summarise: I'm selecting a tab labeled "RS232". The tab is designed (by the company who made it, badly) so that all of the tabs are merged into one large object so I have to click co-ordinates. Once clicked, I then have to check for the specific text "RS232" to be present on the whole screen. Anyway, this throws up an error: 1>------ Build started: Project: CTA5, Configuration: Debug Win32 ------ 1>main.obj : error LNK2019: unresolved external symbol _AU3_ControlClick@28 referenced in function "void __cdecl tabSelect(void)" (?tabSelect@@YAXXZ) 1>ocz.ocz.ukexportHardwareA001H05ExperimentsCPPCTA5DebugCTA5.exe : fatal error LNK1120: 1 unresolved externals ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== I've come across the LNK2019 before (I hadn't included the AutoITX3.lib file), but this time around I'm stumped as to what the issue is. Edit: I know I posted this in general help, but someone said it would be better in here so I've reposted. Sorry that it's a repost. Edit 2: After some trial and error (i.e. running some other AU3_ code) I've determined it is a problem with ControlClick only... which, as far as I can tell, probably means there is an error in the dll or lib file. Edited April 27, 2012 by CmdrVimes Link to comment Share on other sites More sharing options...
CmdrVimes Posted April 30, 2012 Author Share Posted April 30, 2012 Bit of a bump. Not been able to solve this over the weekend. Any suggestions from anyone? Link to comment Share on other sites More sharing options...
CmdrVimes Posted April 30, 2012 Author Share Posted April 30, 2012 I have tried using older versions of the autoitx3.lib and .h files to no avail. Link to comment Share on other sites More sharing options...
shanet Posted April 30, 2012 Share Posted April 30, 2012 Looks like a linker error. I hate those... I have not done any development with AutoItX, or dlls at all for that matter - are you loading the DLL (LoadLibrary()) ? [font="Comic Sans MS"]My code does not have bugs! It just develops random features.[/font]My Projects[list][*]Live Streaming (Not my project, but my edited version)[right]AutoIt Wrappers![/right][/list]Pure randomness[list][*]Small Minds.......................................................................................................[size="1"]Simple progress bar that changes direction at either sides.[/size][*]ChristmasIt AutoIt Christmas Theme..........................................................[size="1"]I WAS BOOOORED![/size][*]DriveToy..............................................................................................................[size="1"]Simple joke script. Trick your friends into thinking their computer drive is haywire![/size][/list]In Development[list][*]Your Background Task Organiser[*]AInstall Second Generation[/list]BEFORE POSTING ON THE FORUMS, TRY THIS: %programfiles%/AutoIt3/autoit3.chm Link to comment Share on other sites More sharing options...
CmdrVimes Posted April 30, 2012 Author Share Posted April 30, 2012 (edited) Looks like a linker error. I hate those... I have not done any development with AutoItX, or dlls at all for that matter - are you loading the DLL (LoadLibrary()) ?I'm not loading the library directly, but I must assume that it is being loaded at some point: other functions like AU3_Run work, it's just AU3_ControlClick that does not.Edit: it's being loaded by the Header File. Edited April 30, 2012 by CmdrVimes Link to comment Share on other sites More sharing options...
Laymanball Posted May 22, 2012 Share Posted May 22, 2012 Use AutoItX3.dll in C++ 1. Open Windows Forms Application 2. New Reference and browse AutoItX3.dll 3.Import AutoItX3Lib; 4.Write code to Button1 Example: String^ au3 = AutoItX3; au3->ControlClick(L"", L"", L"[CLASS:SysTabControl32]", L"",1,175,30); My Sample Script Download: VistaDesktopIconsChangerForXp.au3 (Com,Doc and Bin only) http://www.4shared.com/rar/NMHYL5Igba/VistaDesktopIconsChangerForXp_.html VistaDesktopIconsChangerForXp.exe (Resources) http://www.4shared.com/rar/nzs7Mb1gba/VistaDesktopIconsChangerForXp_.html 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