VB6 - Run Time Error 48 - vb6

I got this error in some VB6 applications after I had uninstalled another VB6 application and I fixed it by reinstalling the applicaton so that the dll was reinstalled.
However I still do not know which dll was the problem. If I can find out its name I can put it in the install script for the other applications so thay are always OK.
Question - How can I find out the name of the dll that was removed and caused error message 48?
Thank you in advance!

Try watching the process as it loads using Process Monitor (http://technet.microsoft.com/en-us/sysinternals/bb896653). You will see it probing for each dll.

I assume you don't have access to the source code?
If that is the case, you can use the Regsvr32 tool to manually register and deregister dll's in order to find out which ones are required to run your application:
http://support.microsoft.com/kb/249873/en-us

Related

VB6 code not running on other machines with "Error in loading DLL" error

I modified my vb6 project to support unicode by using CyberActiveX UniListView100 (UniListView.ocx) controller. I updated my listview with uniListview and project is working well on my machine. But when I try to run it on another machine, it is giving 'Error in Loading DLL' error right after I click on the 'Step into' or 'Start' button.
Once I tried with VB Common Controls Replacement 1.4 Library and the similar scenario happened there as well, code is only running on the machine where it created. But all machines I tried to run this code are equally set-up.
What can be the cause of this error? I even have registered the UniListView.ocx file in the Windows/SysWOW64 folder.
I tried to identified what is happening here with Microsoft Process Monitor, but I was unable to find anything from its logs yet.
Please tell me what can be the cause for this..
Often, the DLL in question is a dependency of the DLL you're trying to load. Find and use the Depends utility to see who requires what. You run Depends, Depends runs your process. First run it on your machine, then on a failing machine. The differences are usually obvious.

Loading Visual Basic application

I recently moved one of the old Visual basic application from one computer to another computer (windows 10). When I tried to load the application on the new computer. I get the following errors:
ACTBar.ocx could not be loaded-- Continue loading projects.
I clicked Yes then I got another error saying:
Resize32.ocx could not be loaded-- Continue loading projects.
I said Yes again Then I got another error saying :
TDBG5.OCX and then Crystl32.OCX and then Comctl32.OCX could not be loaded
In order to start rsolving the first .OCX error, I copied this ACTBAR.OCX from my old computer and put it in windows/system32 manually. I tried to register the .OCX regsvr32 command, but got an error saying "The module "ACTBAR.OCX" failed to load. Make sure the binary is stored at the specified path or debug it to check for problems. I tried to unregister then and got the same error. How can I overcome these .ocx issues. This application was written by another developer.
Any help will be greatly appreciated.
I found the solution. In windows 10, I need to put these .ocx files in c:\windows\syswow64 directory and then register them and the error will go away.

The application was unable to start correctly (0xC0000056). Click Ok to close the application

I am developing a C++ app in Visual Studio and get this error when I go to debug - it never makes it to main(). Googling for this error code doesn't help - in fact, most return hits are trojan horse websites.
Dependency Walker doesn't show anything funny. All DLLs are found on the path, and all are 64 bit as expected.
It turns out, one of the Windows DLLs that I am attempting to load has been marked for deletion by an installer that I installed earlier today. I had ran an update to TortoiseGit, which required replacing in-use system DLLs and requested a reboot (which I declined).
The error code 0xC0000056 found a hit here: http://download.microsoft.com/download/9/5/E/95EF66AF-9026-4BB0-A41D-A4F81802D92C/[MS-ERREF].pdf
0xC0000056 STATUS_DELETE_PENDING
A non-close operation has been requested of a file object that has a
delete pending
After rebooting, I was able to debug my code.

Unable to Activate Windows Store App

I installed a retail version of Windows 8 Pro. I downloaded and installed Visual Studio Express 2012. I asked for and received a developers certificate. Then I tried to create a hello world app.
From there I get a "Unable to Activate Windows Store App" message box when I try to debug the app. Most commentary on the web says delete build directories. This didn't work for me
Does anyone have a solution for how to fix this and debug my app?
This happened to me once too, but the deleting build directories advice fixed it. Specifically, you just need to delete the bin\Debug and bld\Debug folders in your projects. Their contents will be regenerated by Visual Studio when you rebuild. I assume that this is only one project since it's a Hello World app; otherwise I would ask if you deleted build directories from all projects in your solution.
You can also try running "Clean Solution" from the BUILD menu in Visual Studio.
I'm sorry...it's horrible if this is happening on a clean install as you describe.
I ran into the same issue, and tried rebuilding, cleaning, deleting temp files, rebooting the computer, etc... and nothing helped.
Then finally I made a release build then went back to debug. And now it works.
I have no idea what happened, nor if that really helped, but it's worth a try.
For me a RESTART of pc solved this error message.
For me the problem was that I created the app on a TrueCrypt mounted virtual drive and when I moved the project files to a normal drive then everything worked just fine. Weird.
I was getting the exact same error. In my case the culprit was a NuGet package. It had added an app.config file to the project and it was confusing VS. I removed the app.config file and it solved my issue.
I got the solution at Iris Classon's site.
This can be solved by Uninstalling the app from the start screen then again building the app from Visual Studio.
I had a similar problem, and the cause was creating the project on a USB thumb drive. Creating a project on a normal hard drive volume works.
this can happen when the application signing key (.pfx file) is missing.
Try the following:
Open the Package.appxmanifest file in Visual Studio
Go to the register "Packaging"
Select [Choose Certificate…]
Select the test certificate using [Configure Certificate…] [From File…], or create a new one using [Configure Certificate…] [Test Certificate…]
When using a test certificate, ensure that it is in the .gitignore file. There should be an entry like !**\*_TemporaryKey.pfx to include the key in Git.
Note: The certificate for release build should only be available to the build server and not included in Git.
Rebuild the project
This has happened to me in the past and I have always found that deleting the build directories resolves it.
However this time this is not working for me.
I have tried
- Rebooting
- Deleting build directories
- Running Build | Clean Solution in VS
- Renewing Developer Account
The only thing that will work for me is changing my Package name under the Package.appxmanifest
However I am not overly happy with this as a solution. I will keep investigating.
The issue might be caused because NuGet will try to add an app.config with binding redirects to Windows Store apps if it thinks it is needed. However, Windows Store apps don’t need app.config, and will actually fail to start with a very confusing error message if it is present.
And the solution in this case would be to Remove the App.config
This error generally comes when you try to deploy in debug mode.
I would suggest, deploy the app first in release mode and then try in debug mode.
This worked for me.
Making a new certificate works for me. For this, go to Package.manifest->Packaging, and follow the Choose certificate.... Click on Configure certificate and select Create test certificate. Give it a name and press OK.
Increasing the revision number of the package worked for me
Tried so many of the above fixes. Nothing worked (deleting bin, obj dirs, editing the manifest, editing the registry, changing package name, etc, etc.) My Avast antivirus software was running and so I uninstalled it completely. That was it. App now runs fine.
This sort of problems are common with Windows 8 Visual Studio. Such errors encounters when your developer license of Visual Studio has expired so you may want to renew or get a new developer license here's how you get that. How to get a developer license in Windows 8
And similar problem may also encounter with E_Fail issues here's how to solve Unable to activate Windows Store app E_Fail Issue
For me, the fix was a combination of two of these answers -
Renew the developer license (How to get a developer license in Windows 8)
And deleting the build directories (though I deleted more then the screenshot depicted) Delete the Build directories
NuGet will try to add an app.config with binding redirects to Windows Store apps if it thinks it is needed. However, Windows Store apps don’t need app.config, and will actually fail to start with a very confusing error message if it is present.
Solution:
Remove the App.config
and build again
For those who get a similar error but who are searching for a solution while debugging an IOT background app on a local machine specifically - you can find it here.
Using the search term "unable to activate windows store app the activation request failed with error" brought me here.
Because of Two things i resolved this issue.
Basically, we just need to delete the bin\Debug and bld\Debug folders in our projects. Those contents will be regenerated by Visual Studio when you rebuild project.
Just Restart the Visual Studio. And Clean Build and Rebuild the solution and RUN it.
Hope this helps.,
Playing with this issue for 3 days, tried every suggestions, nothing works. Until now!!!
The solution was this for me:
renew developer licence
build and deploy solution in Release mode (after this step it still not worked, but VS installed some packages in rpi)
start VS remote debugger with default account (http://:8080/#Debug%20settings)
configure remote device with Universal authentication mode (VS2017 -> Project settings -> debug -> target device: remote machine, authentication mode: Universal (unencrypted protocol))
...and now I can sleep.
Hope it helps somebody.
This gift was courtesy of Microsoft's automatic updates for VS2015 which was one of the 2 culprits:
KB3022398
KB3165756
It also broke SourceTree and other apps that draw the GUI - making an outline of the app but not drawing the contents.
For me changing the Package Name in Package.appxmanifest fixed the problem
In my case, the C# UWP app had a native library which failed in the application startup code, and called exit(1). The symptoms were identical to those in the question, though. Visual Studio would throw a message:
Unable to activate Windows Store app '88888888-6666-5555-4444-111111111111_abcdefgh!App'. The Acme.exe process started, but the activation request failed with error 'Operation not supported. Unknown error: 0x80040905'.
In addition, there was a message in the UWP app Windows log under Microsoft\Windows\Apps\Microsoft-Windows-TWinUI/Operational: event ID 5961, message:
Activation for 88888888-6666-5555-4444-111111111111_abcdefgh!App failed. Error code: Unknown HResult Error code: 0x80040905. Activation phase: COM App activation
Internally, the C# part would try to construct a native class instance from the App constructor, the native class constructor would encounter an unrecoverable error and bail. From the UWP subsystem standpoint, and from the debugger standpoint, though, this looked as something distinct from the mere programmatic exit. I'll leave this answer here, 'cause I've spent some time chasing various UWP failure scenarios instead of running under a native debugger.
I've replaced the exit() call with throw ref new Exception(E_INVALIDARG). At least this way the error manifests in the managed debugger, and the message is descriptive.
I've been having this problem a lot with a UWP Windows 10 app on Visual Studio 2019...for me the reliable workaround is to bump the Build number in the Package.appxmanifest file (Packaging tab). It's a huge pain...really hope Microsoft will sort this out soon
Any existing error in the code can also cause this issue. Make sure your previous version of the code is working fine. Compare the difference and make sure all looks good.
I was getting this error and nothing else worked so I had to dissect my program. Turns out I referenced a StaticResource in my App.xaml that didn't exist.
Seems like a silly error but you'd also think Visual Studio would pick up on something like that and throw a different error so if nothing else works, double check your application resources.
As suggested by #Iman in a comment, in the UWP project settings, enable "Compile with .NET Native tool chain".
(After trying just about every answer in this question)

Getting VB6 ADO application to work in Windows 7

I have inheritted several old VB6 applications that currently cannot be rewritten in .NET. These old applications all use ADO, and compile fine on my XP machine. Since switching to a Windows 7 machine, the applications compile fine, but when they are deployed (on XP machines), I get errors. This is a known issue that this Microsoft article discusses:
http://support.microsoft.com/kb/2517589
The article give a very detailed explanation of a workaround, which involved copying a ".TLB" file and registering it using "regtlibv12". When I attempt to register it, I get this error message:
RegisterTypeLib of C:\Program Files\Common Files\System\ado\msado60_Backcompat.tlb failed : 80029c4a
I have also tried registering this using the old "regtlib.exe" in the Windows folder, but got this error:
LoadTypeLib of C:\Program Files\Common Files\System\ado\msado60_Backcompat.tlb failed : 80029c4a
Because of this, I cannot continue with the work around. I would greatly appreciate any guidance anyone could give me on how to properly register this file.
Thank you in advance!
Put the .TLB file in an appropriate place like
C:\Program Files\Common Files\System\ado
Then open a new Project in the VB6 IDE (elevated, i.e. as admin). Choose Project|References... then click the Browse button. Navigate to the new .TLB file and open it. Check the box to select the item and close the References dialog.
It should be registered now.
If desperate, try VB Type Library Registration Utility.
You probably downloaded the file as C:\temp\Msado60_Backcompat_i386.tlb and didn't rename it. The example is for registering C:\temp\Msado60_Backcompat.tlb (note, no _i386).
Run the command with the correct filename.
Just to update this answer list based upon more recent information, Microsoft released KB 2640696 which addresses this issue in a more straightforward manner. This patch makes it much easier to deploy on your build machines and solves the downlevel OS issue as well.
A more complete picture of the patch can be found on the following blog post.

Resources