VB 6.0 Out of Memory Error - vb6

One of my VB 6.0 application throws an error "Out of memory" when loading the form in a particular system, but works fine in other machines. But other vb 6.0 application works fine in the same Machine.
Problematic Machine Details:
Windows XP, HP load runner installed
Other Machines:
Windows 2003
I tried so many ways to find the root cause but i couldn't. Please help me out to find the root cause..
Thanks,
Gunasekaran Sambandhan

Finally i found the solution for this issue. One specific dll (MSSTDFMT.DLL) of this project is missing in this particular machine. I have placed and registered the dll. Now it is working fine.
Thanks,
Gunasekaran Sambandhan

Want to add our fix since it took us days to figure out what was going on.
We were trying to get an old VB6 program to run on Windows 7, we'd gotten it to work on other PCs but this one was giving us problems. Apparently we were missing a dependency, and often this misleading error can be due to missing dependencies.
The particular dependency we were missing was FM20.DLL which we got by installing Microsoft ActiveX Control Pad (http://download.cnet.com/Microsoft-ActiveX-Control-Pad/3000-2070_4-127950.html)

Sometimes if the registration of one or more modules gets messed up, the message "[7] Out of Memory" may occur. Unregistering and then registering the DLL(s) will fix the problem in that case. (Just encountered this on a machine that was "scrubbed" by a network push - IT could not tell me what they scrubbed exactly.)

Related

system.net.sockets and windows 10 error?

I'm having a very strange problem with an application in windows 10. It consists of several .exe in the same computer communicating between them with sockets using system.net.sockets library.
The problem I have is that after installing Windows 10 in a new computer, install all windows updates and then installing that application, connection to sockets doesn't work correctly and the application fails. The strangest thing is that if you leave the computer alone for 1-2 days the applications starts working just fine. The same has happened after installing version 1803 update, it stops working and then works one or two days later.
Any idea of what can it be? Has anyone seen something similar?
It really seems to be related to the 1803 update you mentioned.
Symptoms:
Running an application from a network share will fail when creating a socket;
Copying the very same application to a local drive/path will work just fine, without any further modification.
We are also struggling with this while connecting to an Oracle database (both ODBC and ODP.NET) and it seems the issue has recently been acknowledged:
https://support.oracle.com/knowledge/Oracle%20Database%20Products/2399465_1.html
It also seems this is a recurrent Windows bug:
Win Socket Creation fails with Error code 10022 if non super user
https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/3076a9cd-57a0-418d-8de1-07adc3b486bb/socket-fails-with-error-10022-when-application-is-run-from-certain-network-shares-on-vista-and?forum=wsk
Sorry, no effective solution at the time (other than copying the app binaries to a local folder). I'll update this answer once we get a better solution.
OK, looking a little further I found here in SO that this might be related to a SMBv1 network share, which describes the environment we had here (the network share was disabled because of another bug we faced - thanks MSFT).
Re-enabling SMBv2 / SMBv3 on the server solved the issue.
Related post:
After Windows 10 update 1803 my program can't open a socket when running from network share

Does a Lazarus program need special permissions to run on Windows?

I built a Lazarus program and it's now in exe form.
I am able to run it on two of my computers running XP and Vista.
However, there are other computers as well running XP, Vista and Win7 but I cannot get it to run at all on them.
There are no errors, nothing... Has anyone else had this issue?
The program is connecting to a postgres DB on my LAN server.
Any idea on fixing this is really valued.
NEW INFO:
Maybe I'm wrong but here's a thought... On the development machine, I initially got an error like **libpq.dll* not found when I first tried to connect to postgres. Then after setting the path, it was fine. I'm thinking now if it cannot find that library and that's why it's not able to run.
If this is the case, should my line Application.OnException:=#CatchErr; catch the error? If not how else should I check if this dll or anything else is missing?
First, a sincere and big THANK YOU to Marco and MArtyn for the great tips and guidelines hat got me thinking of this strange issue.
Here's what happened...
I installed a fresh copy of Windows 7 and XP. As usual it did not work.
Then I suspected the old problem of libpq and then I copied libpq.dll from my working OS and put it in the application folder. By the way this machine has no Lazarus or Postgres. The moment I did this, I got my first error message saying that msvcr100.dll was missing.
And then I copied that as well. So the cycle of copy pasting went on for each and every error until I had finally brought these files to my 'non-working'.
libpq.dll - 9.2.1.12263 - PosgreSQL Access Library
msvcr100.dll - 10.0.40219.1 - Microsoft C Runtime Library
ssleay32.dll - 1.0.1.2 - OpenSSL Shared Library
libeay32.dll - 1.0.1.2 OpenSSL Shared Library
libintl.dll - 0.18.1.0 - LGPLed libintl for Windows NT/2000/XP/Vista/7
Once these files came in, the problem was gone!
Now the program works great :)
Thanks for all your inputs!
I now have to see what the above files have to say about their licenses as I have to distribute the app to other users. But I'm glad at least we figured out the problem.
No, base Lazarus programs don't require special permissions. Of course it could be that a specific functionality in the program requires special permissions (like access to ports below 1024, access to certain paths etc).
Also be aware that EXE's downloaded from what the system considers insecure sources (internet, certain kinds of shares) might be blocked by default. If that is the case, if you take the properties of the .EXE in windows explorer, there will be an "unblock" button.
Anything network related of course requires proper configuration of the firewall. The popups that query you might not always come, in case of doubt configure the firewall manually.

VB6 application causes install to show up

I got a weird problem with my VB app that has got me very confused. I am updating an existing program. I had to add some processing queue capabilities. On my system, unit testing worked great but when I compile it and run it on a different computer (a network server machine) it first tries to open an office install. If I cancel this, the program seems to run fine. The problem is that this program will be run in the background and I can't be hitting cancel each time it runs.
So my question is this: what is going on here? I'm usually a java developer we eclipse so I'm used to being able to include all the needed libs into the jar files automatically. It doesn't seem like the case with VB6. it seems like it expects all the same libs to be on all the systems. Is there any way to tell what might be triggering this?
The only thing I can think of that is causing it is that I'm using the "OpenProcess" function in the kernal32 lib. that the only major change I have made.
any help would be very appricated. thanks!
EDIT:
It seems that multiple versions of word were installed on the system and it was screwing things up somehow. We uninstalled one and it fixed it.
I ran into this a while ago and it was related to my installer for the VB6 app overwriting some system files for Office that it shouldn't have. Any time one of the System dlls was accessed Windows would determine that something was wrong and the Office installer would start up.
The short-term fix was to let the Office Installer repair the broken chain of dlls.
The long-term fix was to never overwrite built-in Windows System dlls.
You could also check out the Microsoft Fix it Center.

Vb6 component on Windows 2003 R2 won't register

I'm trying to deploy some Vb6 components on a Windows Server 2003 Standard x64 R2. I normally run these in a com+ application and I went through the normal routine of creating the COM+ application and adding all the components. Everything seemed to work fine until I actually tried to use any of the components. I would some kind of "ActiveX component can't create object" or "Application-defined or object-defined error" or something similar to that.
To remove as many variables a possible I created a very simple VB form to consume the simpliest of the components and tried that. Nope. So I created a simple install to install the component, and whooo hoooo it worked. So I tried one of the more envolved components with high hopes ... but no after the install I still can't call the component successfully. Using Dependency Walker I discovered that for some reason the msvbvm60.dll is not properly registerd.
I've downloaded VBRUN60.exe and VBRUN60SP6.exe and tried installing them. Even going so far as to do a run as with the administrator account and removing the check box for "Run this program with restricted access". I've tried to manually register the msvbvm60.dll in the SysWow64 directory.
Nothing seems to work. It just won't register. Does anybody have any suggestions? At this point I'll try just about anything.
Thanks
If you are registering the components manually you need to pay extra attention. As you are on a 64-bit OS there are two versions of regsvr32.exe. When registering VB6 components you must make sure to use the 32-bit version of regsvr32, which is located under the following location:
%WINDIR%\SysWOW64\regsvr32.exe
If you just type regsvr32 on the command prompt, normally the 64-bit version is chosen (because %WINDIR%\system32 is contained in the %PATH% environment variable), so please make sure to use the full path as above.
If you are using a 32-bit MSI to install your components, this version will be selected automatically and the registration should work just fine.
In case you haven't already done, you should give a try to Process Monitor - one of the best tools I have used on dll registering problems.
The following links will provide some usufull clues:
An excelent tutorial on using Process Monitor for problem solving;
ActiveX component can't create an object
RESOLVED! ActiveX Component Can't Create Object: Cube build failure against SQL Server 2005 Analysis Services
Hope it helps :D
I've had trouble with unregistered components for Visual Basic 6 - although not tried to use the same one as you are mentioning. Manually registering never resolved things, no matter which reg server was used
The problem (eventually) turns out to be Internet Explorer 10. Uninstalling that (due to the way Windows 7 handles IE as Windows updates, this meant unistalling newer versions first to expose the older ones) worked. Afterwards, reinstalling the latest IE brings no problem.

Unable to load VB6 OCX in Windows 7 Error 372

I'm working on an application developed for Windows XP SP3, using VB6. I'm currently in the process of getting it to work on Windows 7, but am encountering a problem with one of our custom OCX files.
When attempting to load a form that contains an instance of the control contained in the problem OCX, the following error is produced:
Failed to load control 'x' from y.ocx. Your version of y.ocx may be outdated. Make sure you are using the version of the control that was provided with your application.
I've checked the version numbers and they're all correct and referencing the proper version. The OCX registers fine, and all the expected registry entries are present.
Inspection with DependencyWalker shows no missing dependencies.
The software works fine under XP, and this is (seemingly) the only issue when running on Windows 7.
Interestingly, if I run through the VB6 IDE using a VB6 group (with the offending OCX part of the group, and the application the startup project), I don't have the issue. Running the application on it's own through the IDE still presents the error.
Any ideas on what could be missing which would cause the application to throw this error?
Error occurs on both Windows 7 Professional and Home Professional, both 32 bit.
This is almost certainly an interface compatibility problem. COM interfaces are versioned entirely separately from your Major/Minor/Revision numbers, which are little more than comments except as used by Installer.
Somewhere along the line you broke binary compatibility, and you are trying to deploy a library with a newer interface than your application was compiled against.
These version numbers are found in keys such as:
HKEY_CLASSES_ROOT\CLSID\{class Id GUID}\VERSION
Your program needs to have its old reference to the OCX removed, a new one set, and then it must be recompiled. This also means deleting any instances of the control and adding them back one by one.
I doubt this is a Windows 7 issue.
I would suspect this is a UAC problem. Try turning UAC off to see if that solves the immediate issue. If it does then you have to regsiter everything using 'run as administrator' and/or create a manifest for you application.
Sounds like on of the controls included in your OCX is having issues loading, not a general registration error. Look at the constructors for x control, and see if they are doing anything that disagrees with UAC or such. One way you can debug this is put some kind of a break before the control is initialized, and debug the application from Visual Studio (remember to create the PDB's in VB6), and then carry on from the break to see why the control isn't initializing.

Resources