Article View: borland.public.cppbuilder.nativeapi
Article #8392Problem accessing function in DLL
From: Anders Johansen
Date: Thu, 28 Oct 2004 13:41
Date: Thu, 28 Oct 2004 13:41
27 lines
1518 bytes
1518 bytes
Hi!
I am trying to access a function in oleacc.dll using
LoadLibrary and GetProcAddress, but for some reason it
doesn't work.
Can someone point out the error?
The function I am going for (GetRoleText) should be a part
of the oleacc.dll on my machine (WinXP).
HINSTANCE MSAAhInst=NULL;
typedef UINT (APIENTRY *TGRT)(DWORD, LPTSTR, UINT);
TGRT pGetRoleText=NULL;
bool LoadMSAA() {
if (!MSAAhInst) {
MSAAhInst = ::LoadLibrary("OLEACC.DLL" );
CoInitialize( NULL );
if (MSAAhInst) {
pGetRoleText=(TGRT)GetProcAddress(MSAAhInst, "GetRoleText");
}
}
return (pGetRoleText!=NULL);
}
Technical Details
Message-ID:
<4180f707$3@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,4fc3141b3a957dd3,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Anders Johansen" <home@dduck.dk> Sender: "Anders Johansen" <home@dduck.dk> Reply-To: "Anders Johansen" <home@dduck.dk> Subject: Problem accessing function in DLL Newsgroups: borland.public.cppbuilder.nativeapi X-User-Info: 192.38.108.189 NNTP-Posting-Host: 207.105.83.66 Message-ID: <4180f707$3@newsgroups.borland.com> Date: 28 Oct 2004 06:41:27 -0700 X-Trace: newsgroups.borland.com 1098970887 207.105.83.66 (28 Oct 2004 06:41:27 -0700) Lines: 28 Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail