Skip to main content

[archive] Problems With AcuToNet.dll

  • May 19, 2007
  • 8 replies
  • 0 views

[Migrated content. Thread originally posted on 18 May 2007]

I wrote a dll in VB.NET (using Visual Studio 2005) to do print preview and printing functions. I am able to access the DLL when called from other .NET programs, and tried to get it to work from the AcuGT 7.2.0 runtime. I ran into a few issues with registering assemblies and whatnot, but now I am stuck with the following message "LoadEntity invoke failed". I haven't got a clue how to troubleshoot this, since I can't seem to step through any of this in debug mode. I have a call in to the tech support, but they told me that .NET2.0 isn't supported (hasn't it been out about 2 years now?), and also haven't responded to me yet.... So, I'm hoping someone here will know what I'm doing wrong. I also tried compiling the DLL under version 1.1 of the framework, and get the same error (for the purposes of testing, all the DLL does is open MSGBOX). When I start from the command line, if I don't have a .config file in the bin folder specifying the 1.1 version of the framework, I get an error on mscorwks.dll. I CAN, however, get to the same place in the program (and the same error), using version 2.0 of the framework, if I start my COBOL program using wrunnet.dll from a .NET2.0 program.

I apologize for the somewhat rambling post, but it's still early in the morning :D

Here is a snippet of the relevant definition of the DLL, created by NETDEFGEN:

           OBJECT @ASSEMBLY
           NAME "@VBPrint"
                  VERSION "1.0.2693.32016"
                  CULTURE "neutral"
                  STRONG "null"

      * FULLY-QUALIFIED-NAME CFDataSystems.CallFunctions, VBPrint, Version=1.0.2693.32016, Culture=neutral, PublicKeyToken=null

      * CFDataSystems.CallFunctions
           NAMESPACE "CFDataSystems"
           CLASS "CallFunctions"
           MODULE "vbprint.dll"


                CONSTRUCTOR,  0, @CONSTRUCTOR1

                CONSTRUCTOR,  0, @CONSTRUCTOR2

      * Void TestStartFunction()
                METHOD,  0, "@TestStartFunction"



Here is the COBOL call:


           CREATE "VBPrint"
                NAMESPACE is "CFDataSystems",
                CLASS-NAME is "CallFunctions",
                HANDLE is vbprint-handle.

           modify vbprint-handle "TestStartFunction"().

           DESTROY vbprint-handle.



Thanks in advance,
-Chris

8 replies

[Migrated content. Thread originally posted on 18 May 2007]

I wrote a dll in VB.NET (using Visual Studio 2005) to do print preview and printing functions. I am able to access the DLL when called from other .NET programs, and tried to get it to work from the AcuGT 7.2.0 runtime. I ran into a few issues with registering assemblies and whatnot, but now I am stuck with the following message "LoadEntity invoke failed". I haven't got a clue how to troubleshoot this, since I can't seem to step through any of this in debug mode. I have a call in to the tech support, but they told me that .NET2.0 isn't supported (hasn't it been out about 2 years now?), and also haven't responded to me yet.... So, I'm hoping someone here will know what I'm doing wrong. I also tried compiling the DLL under version 1.1 of the framework, and get the same error (for the purposes of testing, all the DLL does is open MSGBOX). When I start from the command line, if I don't have a .config file in the bin folder specifying the 1.1 version of the framework, I get an error on mscorwks.dll. I CAN, however, get to the same place in the program (and the same error), using version 2.0 of the framework, if I start my COBOL program using wrunnet.dll from a .NET2.0 program.

I apologize for the somewhat rambling post, but it's still early in the morning :D

Here is a snippet of the relevant definition of the DLL, created by NETDEFGEN:

           OBJECT @ASSEMBLY
           NAME "@VBPrint"
                  VERSION "1.0.2693.32016"
                  CULTURE "neutral"
                  STRONG "null"

      * FULLY-QUALIFIED-NAME CFDataSystems.CallFunctions, VBPrint, Version=1.0.2693.32016, Culture=neutral, PublicKeyToken=null

      * CFDataSystems.CallFunctions
           NAMESPACE "CFDataSystems"
           CLASS "CallFunctions"
           MODULE "vbprint.dll"


                CONSTRUCTOR,  0, @CONSTRUCTOR1

                CONSTRUCTOR,  0, @CONSTRUCTOR2

      * Void TestStartFunction()
                METHOD,  0, "@TestStartFunction"



Here is the COBOL call:


           CREATE "VBPrint"
                NAMESPACE is "CFDataSystems",
                CLASS-NAME is "CallFunctions",
                HANDLE is vbprint-handle.

           modify vbprint-handle "TestStartFunction"().

           DESTROY vbprint-handle.



Thanks in advance,
-Chris
Have you registered AcuToNet.dll?

Is your dll in the same directory as the runtime?

Try the Amort sample program:

(1) compile AmortControl.cbl - it uses AmortControl.def

(2) Place the event handlers in the Acucobol directory where the runtime
is located.
(3) Enter AmortControl.dll in the NET cache or place it in the same directory
where WRUN32.EXE and AcuToNet.dll reside.
(4) Execute WRUN32.EXE AmortControl.acu

[Migrated content. Thread originally posted on 18 May 2007]

I wrote a dll in VB.NET (using Visual Studio 2005) to do print preview and printing functions. I am able to access the DLL when called from other .NET programs, and tried to get it to work from the AcuGT 7.2.0 runtime. I ran into a few issues with registering assemblies and whatnot, but now I am stuck with the following message "LoadEntity invoke failed". I haven't got a clue how to troubleshoot this, since I can't seem to step through any of this in debug mode. I have a call in to the tech support, but they told me that .NET2.0 isn't supported (hasn't it been out about 2 years now?), and also haven't responded to me yet.... So, I'm hoping someone here will know what I'm doing wrong. I also tried compiling the DLL under version 1.1 of the framework, and get the same error (for the purposes of testing, all the DLL does is open MSGBOX). When I start from the command line, if I don't have a .config file in the bin folder specifying the 1.1 version of the framework, I get an error on mscorwks.dll. I CAN, however, get to the same place in the program (and the same error), using version 2.0 of the framework, if I start my COBOL program using wrunnet.dll from a .NET2.0 program.

I apologize for the somewhat rambling post, but it's still early in the morning :D

Here is a snippet of the relevant definition of the DLL, created by NETDEFGEN:

           OBJECT @ASSEMBLY
           NAME "@VBPrint"
                  VERSION "1.0.2693.32016"
                  CULTURE "neutral"
                  STRONG "null"

      * FULLY-QUALIFIED-NAME CFDataSystems.CallFunctions, VBPrint, Version=1.0.2693.32016, Culture=neutral, PublicKeyToken=null

      * CFDataSystems.CallFunctions
           NAMESPACE "CFDataSystems"
           CLASS "CallFunctions"
           MODULE "vbprint.dll"


                CONSTRUCTOR,  0, @CONSTRUCTOR1

                CONSTRUCTOR,  0, @CONSTRUCTOR2

      * Void TestStartFunction()
                METHOD,  0, "@TestStartFunction"



Here is the COBOL call:


           CREATE "VBPrint"
                NAMESPACE is "CFDataSystems",
                CLASS-NAME is "CallFunctions",
                HANDLE is vbprint-handle.

           modify vbprint-handle "TestStartFunction"().

           DESTROY vbprint-handle.



Thanks in advance,
-Chris
We also use a .NET dll for printing operations. (Framework 1.1)

Place your dll in the same directory as wrun32.exe

Run this commands under Windows start / run and everything works.

regasm acutonet.dll
marshal.exe /regserver

[Migrated content. Thread originally posted on 18 May 2007]

I wrote a dll in VB.NET (using Visual Studio 2005) to do print preview and printing functions. I am able to access the DLL when called from other .NET programs, and tried to get it to work from the AcuGT 7.2.0 runtime. I ran into a few issues with registering assemblies and whatnot, but now I am stuck with the following message "LoadEntity invoke failed". I haven't got a clue how to troubleshoot this, since I can't seem to step through any of this in debug mode. I have a call in to the tech support, but they told me that .NET2.0 isn't supported (hasn't it been out about 2 years now?), and also haven't responded to me yet.... So, I'm hoping someone here will know what I'm doing wrong. I also tried compiling the DLL under version 1.1 of the framework, and get the same error (for the purposes of testing, all the DLL does is open MSGBOX). When I start from the command line, if I don't have a .config file in the bin folder specifying the 1.1 version of the framework, I get an error on mscorwks.dll. I CAN, however, get to the same place in the program (and the same error), using version 2.0 of the framework, if I start my COBOL program using wrunnet.dll from a .NET2.0 program.

I apologize for the somewhat rambling post, but it's still early in the morning :D

Here is a snippet of the relevant definition of the DLL, created by NETDEFGEN:

           OBJECT @ASSEMBLY
           NAME "@VBPrint"
                  VERSION "1.0.2693.32016"
                  CULTURE "neutral"
                  STRONG "null"

      * FULLY-QUALIFIED-NAME CFDataSystems.CallFunctions, VBPrint, Version=1.0.2693.32016, Culture=neutral, PublicKeyToken=null

      * CFDataSystems.CallFunctions
           NAMESPACE "CFDataSystems"
           CLASS "CallFunctions"
           MODULE "vbprint.dll"


                CONSTRUCTOR,  0, @CONSTRUCTOR1

                CONSTRUCTOR,  0, @CONSTRUCTOR2

      * Void TestStartFunction()
                METHOD,  0, "@TestStartFunction"



Here is the COBOL call:


           CREATE "VBPrint"
                NAMESPACE is "CFDataSystems",
                CLASS-NAME is "CallFunctions",
                HANDLE is vbprint-handle.

           modify vbprint-handle "TestStartFunction"().

           DESTROY vbprint-handle.



Thanks in advance,
-Chris
Hello!

I add a question to this thread, as we also experience problems with this.

I saw the answer from sboeder, and tried this. That helped us through the first problem, with only Framework 1.1 installed we now got it to work.

But, because of a 3 part software, we need to have Framework 2.0 installed. As soon as we install this, the AcuToNet.dll crashes. We do not register the .dll with Framework 2.0, only install it.

When I developed the program that use this, I had the same problem on my own pc. But, now it works with both Framework 1.1 and Framework 2.0 installed. My pc also works when I register the .dll with regasm.exe from Framework 2.0. I do not know what has happened on my pc that makes both work.

Does anyone have a clue about this, and can give me a hint?

I also wonder what marshal.exe does?

I would be grateful for some tips here.

Best regards
Dag L?nh?iden

[Migrated content. Thread originally posted on 18 May 2007]

I wrote a dll in VB.NET (using Visual Studio 2005) to do print preview and printing functions. I am able to access the DLL when called from other .NET programs, and tried to get it to work from the AcuGT 7.2.0 runtime. I ran into a few issues with registering assemblies and whatnot, but now I am stuck with the following message "LoadEntity invoke failed". I haven't got a clue how to troubleshoot this, since I can't seem to step through any of this in debug mode. I have a call in to the tech support, but they told me that .NET2.0 isn't supported (hasn't it been out about 2 years now?), and also haven't responded to me yet.... So, I'm hoping someone here will know what I'm doing wrong. I also tried compiling the DLL under version 1.1 of the framework, and get the same error (for the purposes of testing, all the DLL does is open MSGBOX). When I start from the command line, if I don't have a .config file in the bin folder specifying the 1.1 version of the framework, I get an error on mscorwks.dll. I CAN, however, get to the same place in the program (and the same error), using version 2.0 of the framework, if I start my COBOL program using wrunnet.dll from a .NET2.0 program.

I apologize for the somewhat rambling post, but it's still early in the morning :D

Here is a snippet of the relevant definition of the DLL, created by NETDEFGEN:

           OBJECT @ASSEMBLY
           NAME "@VBPrint"
                  VERSION "1.0.2693.32016"
                  CULTURE "neutral"
                  STRONG "null"

      * FULLY-QUALIFIED-NAME CFDataSystems.CallFunctions, VBPrint, Version=1.0.2693.32016, Culture=neutral, PublicKeyToken=null

      * CFDataSystems.CallFunctions
           NAMESPACE "CFDataSystems"
           CLASS "CallFunctions"
           MODULE "vbprint.dll"


                CONSTRUCTOR,  0, @CONSTRUCTOR1

                CONSTRUCTOR,  0, @CONSTRUCTOR2

      * Void TestStartFunction()
                METHOD,  0, "@TestStartFunction"



Here is the COBOL call:


           CREATE "VBPrint"
                NAMESPACE is "CFDataSystems",
                CLASS-NAME is "CallFunctions",
                HANDLE is vbprint-handle.

           modify vbprint-handle "TestStartFunction"().

           DESTROY vbprint-handle.



Thanks in advance,
-Chris
Hello dagl,

When we began to interface with .Net dll's, we also experienced some problems on PC's with Framework 1.1 and 2.0 installed. (at this moment we have several computers with both frameworks installed and succesfully calling our 1.1 dll for image resizing and printing.)

Could you give some additional information about your problems?
- Error description/code
- Is your dll compiled in Framework 1.1 or 2.0

You can try to run the marshal.exe/regserver after installation of the 2.0 framework.


Regards,

Stephan Boeder

[Migrated content. Thread originally posted on 18 May 2007]

I wrote a dll in VB.NET (using Visual Studio 2005) to do print preview and printing functions. I am able to access the DLL when called from other .NET programs, and tried to get it to work from the AcuGT 7.2.0 runtime. I ran into a few issues with registering assemblies and whatnot, but now I am stuck with the following message "LoadEntity invoke failed". I haven't got a clue how to troubleshoot this, since I can't seem to step through any of this in debug mode. I have a call in to the tech support, but they told me that .NET2.0 isn't supported (hasn't it been out about 2 years now?), and also haven't responded to me yet.... So, I'm hoping someone here will know what I'm doing wrong. I also tried compiling the DLL under version 1.1 of the framework, and get the same error (for the purposes of testing, all the DLL does is open MSGBOX). When I start from the command line, if I don't have a .config file in the bin folder specifying the 1.1 version of the framework, I get an error on mscorwks.dll. I CAN, however, get to the same place in the program (and the same error), using version 2.0 of the framework, if I start my COBOL program using wrunnet.dll from a .NET2.0 program.

I apologize for the somewhat rambling post, but it's still early in the morning :D

Here is a snippet of the relevant definition of the DLL, created by NETDEFGEN:

           OBJECT @ASSEMBLY
           NAME "@VBPrint"
                  VERSION "1.0.2693.32016"
                  CULTURE "neutral"
                  STRONG "null"

      * FULLY-QUALIFIED-NAME CFDataSystems.CallFunctions, VBPrint, Version=1.0.2693.32016, Culture=neutral, PublicKeyToken=null

      * CFDataSystems.CallFunctions
           NAMESPACE "CFDataSystems"
           CLASS "CallFunctions"
           MODULE "vbprint.dll"


                CONSTRUCTOR,  0, @CONSTRUCTOR1

                CONSTRUCTOR,  0, @CONSTRUCTOR2

      * Void TestStartFunction()
                METHOD,  0, "@TestStartFunction"



Here is the COBOL call:


           CREATE "VBPrint"
                NAMESPACE is "CFDataSystems",
                CLASS-NAME is "CallFunctions",
                HANDLE is vbprint-handle.

           modify vbprint-handle "TestStartFunction"().

           DESTROY vbprint-handle.



Thanks in advance,
-Chris
Hello again!
Thank you very much for the fast answer.

Running marshal.exe after installing Framework 2.0 does not get us any longer. Still it crashes.

I have tried to include the error message that we get. I do not know if I have done it correct. If you cannot see the error message (.bmp - file attached), the error code (first line in the error message) is:

CoCreateInstance failed for AcuToNet.IAcuToNet

My .dll is compiled with Framework 1.1

I also noticed that the first post in this thread mentioned a .config file that should reside in the bin - directory. One of my colleques that develop in C told me that we could use an .config file to point out the correct Framework version to use on our system. Is this the same .config, and how should we set this up?

Best regards
Dag L?nh?iden

[Migrated content. Thread originally posted on 18 May 2007]

I wrote a dll in VB.NET (using Visual Studio 2005) to do print preview and printing functions. I am able to access the DLL when called from other .NET programs, and tried to get it to work from the AcuGT 7.2.0 runtime. I ran into a few issues with registering assemblies and whatnot, but now I am stuck with the following message "LoadEntity invoke failed". I haven't got a clue how to troubleshoot this, since I can't seem to step through any of this in debug mode. I have a call in to the tech support, but they told me that .NET2.0 isn't supported (hasn't it been out about 2 years now?), and also haven't responded to me yet.... So, I'm hoping someone here will know what I'm doing wrong. I also tried compiling the DLL under version 1.1 of the framework, and get the same error (for the purposes of testing, all the DLL does is open MSGBOX). When I start from the command line, if I don't have a .config file in the bin folder specifying the 1.1 version of the framework, I get an error on mscorwks.dll. I CAN, however, get to the same place in the program (and the same error), using version 2.0 of the framework, if I start my COBOL program using wrunnet.dll from a .NET2.0 program.

I apologize for the somewhat rambling post, but it's still early in the morning :D

Here is a snippet of the relevant definition of the DLL, created by NETDEFGEN:

           OBJECT @ASSEMBLY
           NAME "@VBPrint"
                  VERSION "1.0.2693.32016"
                  CULTURE "neutral"
                  STRONG "null"

      * FULLY-QUALIFIED-NAME CFDataSystems.CallFunctions, VBPrint, Version=1.0.2693.32016, Culture=neutral, PublicKeyToken=null

      * CFDataSystems.CallFunctions
           NAMESPACE "CFDataSystems"
           CLASS "CallFunctions"
           MODULE "vbprint.dll"


                CONSTRUCTOR,  0, @CONSTRUCTOR1

                CONSTRUCTOR,  0, @CONSTRUCTOR2

      * Void TestStartFunction()
                METHOD,  0, "@TestStartFunction"



Here is the COBOL call:


           CREATE "VBPrint"
                NAMESPACE is "CFDataSystems",
                CLASS-NAME is "CallFunctions",
                HANDLE is vbprint-handle.

           modify vbprint-handle "TestStartFunction"().

           DESTROY vbprint-handle.



Thanks in advance,
-Chris
Some more questions and hints.

- Did you also install Framework 1.1 on the PC with 2.0 installed, you can try to reinstall 1.1.

- Which Acucorp version do you use? We use 7.2.1 and experienced some problems with the previous 6.2 version.

- Remove the mscoree.dll from your Acucobol bin directory.

- Try to reinstall the Acucorp runtime from the original Acucorp CD after you have installed the Framework.

- Hint: you cannot use overloaded method's in your .net dll

[Migrated content. Thread originally posted on 18 May 2007]

I wrote a dll in VB.NET (using Visual Studio 2005) to do print preview and printing functions. I am able to access the DLL when called from other .NET programs, and tried to get it to work from the AcuGT 7.2.0 runtime. I ran into a few issues with registering assemblies and whatnot, but now I am stuck with the following message "LoadEntity invoke failed". I haven't got a clue how to troubleshoot this, since I can't seem to step through any of this in debug mode. I have a call in to the tech support, but they told me that .NET2.0 isn't supported (hasn't it been out about 2 years now?), and also haven't responded to me yet.... So, I'm hoping someone here will know what I'm doing wrong. I also tried compiling the DLL under version 1.1 of the framework, and get the same error (for the purposes of testing, all the DLL does is open MSGBOX). When I start from the command line, if I don't have a .config file in the bin folder specifying the 1.1 version of the framework, I get an error on mscorwks.dll. I CAN, however, get to the same place in the program (and the same error), using version 2.0 of the framework, if I start my COBOL program using wrunnet.dll from a .NET2.0 program.

I apologize for the somewhat rambling post, but it's still early in the morning :D

Here is a snippet of the relevant definition of the DLL, created by NETDEFGEN:

           OBJECT @ASSEMBLY
           NAME "@VBPrint"
                  VERSION "1.0.2693.32016"
                  CULTURE "neutral"
                  STRONG "null"

      * FULLY-QUALIFIED-NAME CFDataSystems.CallFunctions, VBPrint, Version=1.0.2693.32016, Culture=neutral, PublicKeyToken=null

      * CFDataSystems.CallFunctions
           NAMESPACE "CFDataSystems"
           CLASS "CallFunctions"
           MODULE "vbprint.dll"


                CONSTRUCTOR,  0, @CONSTRUCTOR1

                CONSTRUCTOR,  0, @CONSTRUCTOR2

      * Void TestStartFunction()
                METHOD,  0, "@TestStartFunction"



Here is the COBOL call:


           CREATE "VBPrint"
                NAMESPACE is "CFDataSystems",
                CLASS-NAME is "CallFunctions",
                HANDLE is vbprint-handle.

           modify vbprint-handle "TestStartFunction"().

           DESTROY vbprint-handle.



Thanks in advance,
-Chris
Hello dagl,

I've found the problem.

I can create the same error as you "CoCreateInstance failed for AcuToNet.IAcuToNet" when I register AcuToNet.dll version 7.000 and I use Acucobol runtime version 7.2. So it's very important that you register the right version from AcuToNet.dll. When I register the AcuToNet 7.200 version. The problem is solved.

Use AcuToNet version 7.2.0.0 with runtime V721
Use AcuToNet version 7.0.0.0 with runtime V701

Let me now if this solves the problem

Succes and regards,

Stephan Boeder

[Migrated content. Thread originally posted on 18 May 2007]

I wrote a dll in VB.NET (using Visual Studio 2005) to do print preview and printing functions. I am able to access the DLL when called from other .NET programs, and tried to get it to work from the AcuGT 7.2.0 runtime. I ran into a few issues with registering assemblies and whatnot, but now I am stuck with the following message "LoadEntity invoke failed". I haven't got a clue how to troubleshoot this, since I can't seem to step through any of this in debug mode. I have a call in to the tech support, but they told me that .NET2.0 isn't supported (hasn't it been out about 2 years now?), and also haven't responded to me yet.... So, I'm hoping someone here will know what I'm doing wrong. I also tried compiling the DLL under version 1.1 of the framework, and get the same error (for the purposes of testing, all the DLL does is open MSGBOX). When I start from the command line, if I don't have a .config file in the bin folder specifying the 1.1 version of the framework, I get an error on mscorwks.dll. I CAN, however, get to the same place in the program (and the same error), using version 2.0 of the framework, if I start my COBOL program using wrunnet.dll from a .NET2.0 program.

I apologize for the somewhat rambling post, but it's still early in the morning :D

Here is a snippet of the relevant definition of the DLL, created by NETDEFGEN:

           OBJECT @ASSEMBLY
           NAME "@VBPrint"
                  VERSION "1.0.2693.32016"
                  CULTURE "neutral"
                  STRONG "null"

      * FULLY-QUALIFIED-NAME CFDataSystems.CallFunctions, VBPrint, Version=1.0.2693.32016, Culture=neutral, PublicKeyToken=null

      * CFDataSystems.CallFunctions
           NAMESPACE "CFDataSystems"
           CLASS "CallFunctions"
           MODULE "vbprint.dll"


                CONSTRUCTOR,  0, @CONSTRUCTOR1

                CONSTRUCTOR,  0, @CONSTRUCTOR2

      * Void TestStartFunction()
                METHOD,  0, "@TestStartFunction"



Here is the COBOL call:


           CREATE "VBPrint"
                NAMESPACE is "CFDataSystems",
                CLASS-NAME is "CallFunctions",
                HANDLE is vbprint-handle.

           modify vbprint-handle "TestStartFunction"().

           DESTROY vbprint-handle.



Thanks in advance,
-Chris
Thank you for your fast answer!

Deleting mscoree.dll did it! This is consistently, and can be reproduced. Now, we can go on with our work implementing this to customers.

Thank you again for all help!

Best regards
Dag L?nh?iden