I keep getting a LNK2001 error (unresolved external
symbol "symbol") when calling AccessibleObjectFromWindow
() . I'm including the right libraries and it's
implemented correctly, what could be the problem?
Here's my code:
#include <windows.h>
//Active Accessibility Header Files
#include <winable.h>
#include <oleacc.h>
int FAR PASCAL WinMain(HINSTANCE hInstance, HINSTANCE
hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
HRESULT hr;
IAccessible * paccMainWindow = NULL;
HWND hWndMainWindow = FindWindow(NULL,"Untitled -
Notepad");
if(hWndMainWindow!=NULL)
{
SetForegroundWindow(hWndMainWindow);
hr=AccessibleObjectFromWindow
(hWndMainWindow,OBJID_WINDOW, IID_IAccessible,(void**)
&paccMainWindow); //error at this function call
}
return 0;
}
Please help,
-Brandon
David Lowndes - 12 Aug 2003 08:00 GMT
>I keep getting a LNK2001 error (unresolved external
>symbol "symbol") when calling AccessibleObjectFromWindow
>() . I'm including the right libraries
Brandon,
Have you added "Oleacc.lib" to your project's list of libraries it
links to?
Dave

Signature
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Brandon Alexander - 12 Aug 2003 17:54 GMT
>Brandon,
>
>Have you added "Oleacc.lib" to your project's list of libraries it
>links to?
>
>Dave
Dave, I'm still pretty new to VS.net, can you tell me how
to add the lib file? Does it not do it by adding
<oleacc.h>? Thank you!
Brandon Alexander - 12 Aug 2003 18:07 GMT
>Have you added "Oleacc.lib" to your project's list of libraries it
>links to?
>
>Dave
I figured out how to add the .lib file, it fixed the
problem. Why did I need to add it if I included
<oleacc.h>? When else do I need to add .lib files? Thank
you!