cancel
Showing results for 
Search instead for 
Did you mean: 

Errors AFTER the execution of a DI API app

Former Member
0 Kudos

Hi all, I have a peculiar problem with a small, non-addon, DI API app with VB.Net.

I get two flavors of errors in msgboxes:

a: WindowsFormsParkingWindow: prog.exe - Application Error / The instruction at "some hex" referenced memory at "another hex". The memory could not be read. Click OK to terminate the program

b: prog.exe - Common Language Runtime Debugging Services / Application generated an exception that could not be handled Process id = hex(nbr), Thread id = hex2(nbr2).

Click OK to terminate the program. Click Cancel to debug the application.

Initially, I developed it at 2005 PL 06 and tested it with a separate PC with 2005 Eval PL 02.

The problem started to show up with a third PC with 2005 PL 08.

So I upgraded my test PC to PL 06 and I was able to reproduce the error.

So I upgraded my dev and test PCs to PL 09 and I'm still having this problem.

The interesting part of the problem is that these msgboxes fire AFTER the last line of code in my app.

I have two theories:

1. My app is not correctly deployed. Currently, I am simply using the VS Package and Deployment.

2. There is some other problem with .Net and B1 COM objects.

Any help / pointers would be highly appreciated.

Thanks,

Juha

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Juha,

What does your code do moreless?

Have you tried to do the same task using the B1 GUI?

Regards,

Ibai Peñ

Former Member
0 Kudos

Hi Ibai,

Everything I have coded works perfectly: I add documents, items etc ...

The problem shows up after the last line of code.

Juha

Former Member
0 Kudos

I have the same issue with one of my apps and the 2005 DI. I worked around it by using the 2004 DI .dll with that application. This resolves the problem in the short-term and I have been checking each new DI when it comes out to see if the issue has been resolved. So far it has not been.

Former Member
0 Kudos

Wonderful!

Thanks Matt for this information.

BTW: I spent long time reviewing my code. Of course, I couldn't find&fix this bug. However, during the process I used Project Analyzer for VB and was able to detect&fix a couple of other minor issues. Handy, useful and affordable (free for max 10 source code files) tool for sw quality control.

Check it at http://www.aivosto.com/project/project.html

Juha

Former Member
0 Kudos

Hey Juha,

Just to let you know we experienced similar issues to this in SBO 2005. After reporting it to SAP support we were told there was a bug in the company.disconnect method. To workaround this in our current application we set the company object to null and now we do not get these unhandled exceptions. This is slated to be fixed in one of the next patch releases.

HTH

Former Member
0 Kudos

Curtis,

Do you mean that you set the company object to null before, instead or after company.disconnect?

In VB I tried without success something like this:


SBOCompany.Disconnect
SBOCompany = Nothing
GC.Collect()
GC.WaitForPendingFinalizers()
If Not SBOCompany Is Nothing Then System.Runtime.InteropServices.Marshal.ReleaseComObject(SBOCompany)

Juha

Message was edited by: Juha Lassila

Former Member
0 Kudos

Actually I do not use the disconnect method at all. That seems to be what throws the unhandled exceptions. You can try it easily by commenting out that line.

Answers (0)