Jump to content



Photo

C++ help: LNK2019 and ControlClick


  • Please log in to reply
5 replies to this topic

#1 CmdrVimes

CmdrVimes

    Seeker

  • Active Members
  • 9 posts

Posted 27 April 2012 - 03:33 PM

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 by CmdrVimes, 27 April 2012 - 03:43 PM.








#2 CmdrVimes

CmdrVimes

    Seeker

  • Active Members
  • 9 posts

Posted 30 April 2012 - 08:17 AM

Bit of a bump. Not been able to solve this over the weekend. Any suggestions from anyone?

#3 CmdrVimes

CmdrVimes

    Seeker

  • Active Members
  • 9 posts

Posted 30 April 2012 - 09:23 AM

I have tried using older versions of the autoitx3.lib and .h files to no avail.

#4 shanet

shanet

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 313 posts

Posted 30 April 2012 - 09:43 AM

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()) ?
My code does not have bugs! It just develops random features.My ProjectsPure randomness
  • Small Minds.......................................................................................................Simple progress bar that changes direction at either sides.
  • ChristmasIt AutoIt Christmas Theme..........................................................I WAS BOOOORED!
  • DriveToy..............................................................................................................Simple joke script. Trick your friends into thinking their computer drive is haywire!
In Development
  • Your Background Task Organiser
  • AInstall Second Generation
BEFORE POSTING ON THE FORUMS, TRY THIS:
%programfiles%/AutoIt3/autoit3.chm

#5 CmdrVimes

CmdrVimes

    Seeker

  • Active Members
  • 9 posts

Posted 30 April 2012 - 09:59 AM

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 by CmdrVimes, 30 April 2012 - 10:09 AM.


#6 Laymanball

Laymanball

    Wayfarer

  • Active Members
  • Pip
  • 65 posts

Posted 22 May 2012 - 04:25 PM

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);




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users