Memory issue with VB 6 active x component and C DLL - iis

We have a legacy application that has been running successfully for many years. It is a VB 6 activex component that we use to call a dll written with C. The vb component is called by a vb (desktop) application and is also called using classic asp. This setup has worked for many years and runs on a windows 2003 development server (IIS 6) and a windows 2008 R2 live server (IIS 7.5).
We place the dll in the system32 directory on 2003 and in the syswow64 direction on 2008.
The active x dll gets registered as follows:
regsvr32 c:\windows\system32\wrapper.dll
Recently, we are running into what appears to be some type of memory issue. The problem does NOT show itself in the desktop app. The problem only appears when running from classic asp under IIS.
When the application fails, it does not throw any type of error. But, the values in an array within the C program never get populated. Thus, the results from the dll are incomplete.
Some recent changes to the C dll have started to cause problems. In C, we have discovered that a value of 1500 for this array, causes it to fail.
#define PPT_LIST_LENGTH 1400
float f_list[PPT_LIST_LENGTH];
double d_list[PPT_LIST_LENGTH];
With 1400 it runs under IIS, but, the past few days, we have noticed that it will start to fail after running on the live server for a couple days. If I reset IIS, the application begins to run normally again.
This last problem seems to confirm that it is some type of memory issue.
Are there any settings in IIS that might give the application more memory? A way to give the dll more memory from the vb component? Ideas?

Related

Is there a reason a dll from an installed program would only not work on one system?

I've written a relatively simple VBA tool for Excel that interfaces with a third party program to send/receive data to my company's data system. The third party program is enterprise software that installs the API dll by default. The program is accessible (through this dll) on every machine in my office that has tried, except one. Every attempt with this machine yields run-time error 429.
I have tried:
1) Uninstall and reinstall software (both third part program and Excel) - no change
2) regsvr32 /u and /i to fix the dll reference - /i fails with the missing entry point message
3) Adding the explicit reference to the dll via the VBA editor (it is listed) and switching from late to early binding - same 429 error
4) Switching machines. Supposedly this user had changed computers several months ago and things worked for a bit but have since stopped again.
5) Copy working program files from one pc to the nonworking pc - same error
I have verified that the error occurs in the code only when I attempt to create the object, so the problem has to be with how the system is handling the dll in question.
Is there anything else that could be driving this issue? Can user permissions issues manifest in this way? I'm pretty much out of things to try.

Error running app on Windows Phone 8.1 emulator - A dependent dll was not found

I have universal project targeting Windows Store 8.1 and Windows Phone 8.1 platform.
The windows one works fine but I having trouble running the WP one on an emulator. I get the error message saying:
Microsoft Visual Studio Unable to activate Windows Store app
'numbers-here!App'. The Kiss.WindowsPhone.exe process started, but the
activation request failed with error 'Msg in polish that the app did
not start'.
If this was Windows I would check System Event Log and see the logs just before the error what DLL the system was trying to load and that helped a lot when I was debugging similar problem with Windows Store project, here I have no clue on how to check what exactly was being loaded.
The worst part is that I created package (appx) and checked the dll's being packed with exe, it seems that it includes dependencies that the app explicility uses yet something is still missing and this might be some 'hidden' dependency of one of the other dlls.
Any ideas how to debug such issues with emulator?
For me it was due to having WIC code in my App and/or calling CoCreateInstance in a windows phone environment ( on PC it works flawlessly though )
I ran into the same problem on Windows 10. Turns out, that there is no Kernel32.dll on Windows 10 phone!
Instead you need to link against OneCore.lib which provides the entire Win32 API subset that is supported in UWP. This "umbrella library" will load the correct dlls at runtime.
See also:
https://msdn.microsoft.com/en-us/library/windows/desktop/mt683763(v=vs.85).aspx

Moving Classic ASP between two IIS 6 machines with VB6 DLL

I have just started to debug a Classic ASP website. The old development environment was running in a VM machine on Windows Server 2003.
I have created a new Windows Server 2003 R2 server and have transferred the website.
The site also uses 11 ActiveX DLL's written in VB 6.
I have moved them over and used regsvr32 on all of the DLL's to register them and all appears well.
When I try and view the web page however I get the Error:
MX error '800a01ad'
ActiveX component can't create object.
/includes/somefile.asp, line 16
If I create a basic asp page, the page is served from both the root of the website and the virtual directory /includes fine.
Thanks
Some other VB6 activeX dependencies were discovered. Registered them, now working sweet.

Classic ASP and COM debugging

I have inherited a classic ASP project and a VB6 Component (ActiveX .dll) that goes with it.
I would like to be able to debug this component by running it locally on my machine.
I have a Windows 7 Home Premium (64 bit) laptop.
I have setup IIS 7.5 locally (production is running IIS5), however, when I browse to the site (locally) I get:
Active Server Pages error '00000000'
Create object failed
?
An error occured while create object 'OBJECTNAME'
Microsoft VBScript runtime error '800a01ae'
Class does't support Automation: 'ID of object in global.asa
I'm not a server guy, so I don't have a lot of experience setting up IIS. I want to setup this project locally so I can step through the COM object using the debugger.
What do I need to do to get this running?
Just as an FYI :
In the global.asa I have the following:
<object runat="server" scope="session" id="ABC" progid="prjABC.clsABC"></object>
Then in the ASP I have the following call:
if ABC.propertyName = True then
...
It fails at that line.
Sounds like the application pool your site is running in is configured for 64-bit mode (the default).
Switch it to 32-bit by right clicking on the pool and choosing Advanced Settings:
Set Enable 32-Bit Applications to True.
You might also want to configure the Managed Pipeline Mode and set that to Classic, not all Classic ASP apps are happy running in Integrated mode.
If all you need to do is debug the component it may be easier writing a COM Application that uses this COM component. Especially if you have the source to the component you can launch your test application from your vb6 component project as your debug application.
Since it's VB6 though you may have to set up a XP virtual machine to be able to run visual studio 6.0 (I've never been able to get 6.0 working on windows 7). Either that or upgrade the component to visual studio 2010.
If you want to run 32 bit components in a 64 bit environment, you can do it. The trouble with setting IIS to allow running 32 bit components as described above is that you end up having all of iis running 32 bit - which if it's a webserver means the main app you're running is 32 bit so reduces the speed advantage of a 64 bit machine.
To run a 32 bit component in a 64 bit IIS, you need to put it in Component Services. Start->Run->"comexp.msc" runs component services. Then just expand down the tree until you find COM+ Applications, and create a new empty application (with all the defaults set as are). Then expand that application and right click on components and then "new">component. The install new component and select the DLLs. This should allow a 64 bit component to just use the 32 bit ones.

Why does Crystal Reports throw a LoadSaveReportException in IIS7 but works in Cassini / desktop application?

I have a method that loads a Crystal Reports file, sets the appropriate login information, and then generates a PDF.
ReportDocument rep = new ReportDocument();
rep.Load(...);
// Set table LogOnInfo
rep.ExportToStream(ExportFormatType.PortableDocFormat);
// Save the PDF to disk or return it as web request
This exact code works in both
A stand-alone WPF desktop application
An ASP.NET MVC website running through Cassini launched from VS
but does not work when the same website is deployed to IIS7. It gives a rather unhelpful message and stacktrace.
An error has occurred while attempting to load the Crystal Reports runtime.
Either the Crystal Reports registry
key permissions are insufficient or
the Crystal Reports runtime is not
installed correctly.
Please install the appropriate Crystal
Reports redistributable
(CRRedist*.msi) that contains the
version of the Crystal Reports runtime
(x86, x64, or Itanium) that is
required. Please go to
http://www.businessobjects.com/support
for more information.
Exception Details: CrystalDecisions.CrystalReports.Engine.LoadSaveReportException: An error has occurred while attempting to load the Crystal Reports runtime.
Note that I am using CR 2008 SP2 and the files haven't been named CRRedist... since 10.5 so someone has been forgetting to update the messages somewhere :) Here is a list of all the CR runtimes.
So why would running the same code referencing the same assemblies work in the two situations listed above but not in a deployed website?
I found this suggestion to give the IIS user write access to the temp folder, and it does appear that the Crystal runtime does some work there but I still get the same error even after giving IIS_IUSR or IIS AppPool\DefaultAppPool full access to %TEMP%.
I have also tried changing the app pool to use my account as the identity and still receive the same error message so I'm not convinced it's a permissions issue.
It turns out that for any newer versions of Crystal Reports after 10.5 (the one that is bundled with VS2008) there are no 64-bit runtimes.
The "simple" solution is to make the app pool 32-bit and then everything works ok.
There are more explanations found here (along with the expected angry responses)
You have to install CR version 13, download the msm and build an installer with VSS. Finalley execute the installer (you build) on your server.
Good luck!

Resources