• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 536
  • Last Modified:

"48 File Not Found" for API function

I have a Visual Basic app that runs fine on my Win2000 machine.

However, when I run it on our Win98 machine it bombs.

The problem is a call to a function in the "oleacc.dll".

The error I'm getting is "48 File not found 'oleacc'".

The declare statement is:

Declare Function ObjectFromLresult Lib "oleacc" (ByVal lResult As Long, riid As UUID, ByVal wParam As Long, ppvObject As Any) As Long

  I verified that the file exists on my Win98 machine at "c:\Windows\System\oleacc.dll".

  I changed the declare statement to:

Declare Function ObjectFromLresult Lib "c:\Windows\System\oleacc.dll" (ByVal lResult As Long, riid As UUID, ByVal wParam As Long, ppvObject As Any) As Long

  And I still get the same message (file not found).

  Additional strangeness:

 When I tried to re-register the dll, I get the following message:

 Run: regsvr32 oleacc.dll

 "LoadLibrary ("oleacc.dll") failed. GetLastError returns 0x0000045a"

 I tried UN-registering this dll using "regsvr32 /u" and got the same message.

I'm aware of the KnowledgeBase article:


  But I don't know if this has anything to do with it.

  Any thoughts out there?
  • 5
  • 3
1 Solution
Anthony PerkinsCommented:
Have you checked out the following article?
WD2002: Run-Time Error 48 "File Not Found" When You Start
Word or Use Add-in (Q286897)

It should not matter to give the whole path or only the filename in the Declare statement. The PATH of the system is searched anyway and first of all the windows and the windows system directory.

If you have VC++ installed you can build your application with debugging symbols (Create Symbolic Debug Info under Compile-properties) and break in when you get the error message. At least you can find what call is causing the error. If that is LoadLibrary with the parameter oleacc.dll, then indeed something is wrong and Windows cannot find the dll. But I doubt that. Most of the times something else causes this error. For example, a missing entry point.
I have Win2k on my system, and the function ObjectFromLresult happens to be in it. If you have Dependency Walker or QuickView on your Win98 system, I'd use it to check the availability of ObjectFromLresult in the exported functions list of the dll.

If this doesn't give any clues, check the versions of this accessibility dll and if different, exchange them and see if the problem still persists.

I'm a little worried that the DllRegisterServer is not available, nor DllUnregisterServer. This means that it is not a genuine, self-registering MS system-dll. I know that not all MS dlls can register themselves, but I also know that this one happens to be able to do register itself.

Btw, are you aware that "This function is designed for internal use by Active Accessibility and is documented for informational purposes only. Neither clients nor servers should call this function."

And last but not least: this all is pretty odd, because the ObjectFromLresult function has been around since the first incarnation of Active Accessibility in Windows 95. You're talking '98. My guess is that there's something seriously wrong with your oleacc.dll.

Btw, are you aware of that you may have to determine before your application runs if AA is installed? See Q244822  for details.

Your worries about Q191476 are ungrounded: both versions, old and new, should have that ObjectFromLresult function.
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

EasyAimAuthor Commented:
  I double-double checked that the dll is in the c:\windows\... directory.   Just to be sure I hardcoded the entire path in the declare.


Thanks for your reply.

I retrieved the oleacc.dll from a Microsoft site a few weeks ago.  This same dll works fine on my 2000 machine.

I could not find any article "Q244822".  Could you verify your source of that KnowledgeBase article?

Yes, I have seen the notification "This function is designed for internal use by Active Accessibility ...." however, it is the only known method of retrieving the DOM of a WebBrowser control from a window handle.
[I was delayed because EE was inaccessible since Sunday, untill a few minutes ago]

I never tried that (retrieving the DOM through a hWnd) but I guess you are right. And now I just come across Q249232 (HOWTO: Get IHTMLDocument2 from a HWND) and that's probably close to about the same subject. This article does not appear in the current version of MSDN Library, but in the archive I was able to locate it:

The same is true for Q244822, you find it here:

Apparently, locally I have an old version of MSDN Library installed.

Back on the subject. If I were you, I should try the installment package provided by MS, instead of just copying the files. In q249232 it is explained how and where to download the MSAA package, but Microsoft is messing with its links and you are redirected to the wrong page. Searching on "download msaa" has the same result: you get back named links that direct to a redirect page that in turn brings you to a place where you don't want to be. The only thing I found is the SDK, which may contain the right files as well, but not necessarily. Thereby, it is a new version, and it is beta. Here's the download link:

I've been looking for how the msaa package is built up, but I can't seem to find the right articles (yet).

An easier thing to make sure you really have the right files (W2K files on a W98 system is probably not a good idea, these system are quite different and so are there dlls) is installing the accessibility from the original w98 cd. That shouldn't be to hard, unless you don't have that anymore.

I heard that the emailing system was down, so just to let you know there was an update (hope it works again): ping :)
EasyAimAuthor Commented:
As it turns out, my solution for Win95 and Win98 machines was to remove the newest oleacc.dll version and replace it with an ancient version that I found in some obscure website.

For some reason, when I enabled the Assessiblity Access thing at Start/AddPrograms/System..stuff my application would still not work (but maybe I didn't delete the offending newer oleacc.dll first??).

It sounds like the oleacc.dll is still screwed up in the head and I'm trying to figure out how to work around not using it at all.

Otherwise my setup packages are going to have to be tailored to specific operating systems in an effort to load the correct oleacc.dll.

Anyway, I appreciate your responses.
Thanks for the grade!

> (but maybe I didn't delete the offending newer oleacc.dll first??).
If this was the case, then it also was the reason. Most MS Installers do not overwrite files that are newer then the file they are currently installing. Meaning, that the file will indeed not be replaced when it was still that offending version of Win2k.

>It sounds like the oleacc.dll is still screwed up in the head
Is your problem still around? Or do you mean that you get different error messages now?

Hope you find it out in the end. If you still need help, even though you accepted a comment of me as an answer, I'm still around here.

EasyAimAuthor Commented:
" >It sounds like the oleacc.dll is still screwed up in the head...  Is your problem still around? Or do you mean that you get different error messages now?"

  What I meant was that it is a poorly designed DLL if I have to go back and grab an old version to get something to work.
  What's sad is that to create a working setup package, I'll have to give a different package depending upon their operating system.

  I hate to instruct my users to install the Assessiblity system package when all I need is one little-bitty DLL to work correctly.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now