Highlighted
Absent Member.
Absent Member.
1917 views

Error calling a DLL

[Migrated content. Thread originally posted on 23 June 2011]

I am experiencing a problem calling a DLL from Acucobol.

The programs work fine on the development system (running Windows 7 64 bit), but when I move them to the server (windows 2008 R2 64 bit) I get the following error:

Invalid Class String(Exception from HRESULT: 0x800401F3 )CO_E_CLASSSTRING)

Any help would be appreciated.

Thank you
0 Likes
6 Replies
Highlighted
Absent Member.
Absent Member.

RE: Error calling a DLL

Things that work under development but not on the server are often caused by permissions.
When calling Acucobol from .NET, this is one of them:

Control Panel > Administrative Tools > Component Services > Component Services > Computers > My Computer > DCom Config > Acucobol (Properties) > Security
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Error calling a DLL

Thanks for the response Robert.

I did take a look on both machines, and the entry you described did not exist on either one of them (even the dev system where it is working).

I do not believe it is a security error because it does the create, but errors out on the modify statement.

If I was experiencing a security error I would expect it to error out on the create statement also.

Any further assistance would be appreciated. I've been looking at this problem for over a week now with no luck.

Thank you again.

J
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Error calling a DLL

In additions to permissions, Windows 2008 has roles. As the error is happening on a modify - what does the modify do (i.e. update a field) - is it possible that the modify is doing something where the user has not been identified permission to do that role. Consider looking at the Windows 2008 roles - turn them all on for that user and see if the error still occurs, then you can change the roles back one by one.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Error calling a DLL

Thank you Shjerpe for your response.

In an effort to resolve any possible security or role issues I have tested this application under an accont that my systems and network people assure me has 100% access to do anything and has full administrator privalages.

The error still happens on the modify statement.

The test program I am using is very simplistic. I will post the .cbl below here

PROGRAM-ID. TESTDLL.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.
COPY "SampleDLL.def".
.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
DATA DIVISION.
FILE SECTION.
WORKING-STORAGE SECTION.

77 SampleDLL-RC PIC X(04) COMP-N VALUE 0.
77 SampleDLL-REPLY PIC X(80) VALUE SPACES.
77 SampleDLL-HANDLE USAGE IS HANDLE.

PROCEDURE DIVISION.

0000-MAIN.

CREATE "SampleDLL"
NAMESPACE IS "SampleDLL"
CLASS-NAME IS "SampleDLLapi"
CONSTRUCTOR IS CONSTRUCTOR1()
HANDLE IS SampleDLL-HANDLE

MODIFY SampleDLL-HANDLE "SampleDLLping"()
GIVING SampleDLL-RC


MOVE " " TO SampleDLL-REPLY
MODIFY SampleDLL-HANDLE "SampleDLLver"(SampleDLL-REPLY)
GIVING SampleDLL-RC

STOP RUN.

The DLL code is also simplistic, and I will post it below here:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SampleDLL
{
public class SampleDLLapi
{
~SampleDLLapi() { }

public SampleDLLapi() { }

public int SampleDLLping()
{
return 999;
}

public int SampleDLLver(ref string ReturnMsg)
{
ReturnMsg = "Version 1.0.00";
return 0;
}
}
}

As I said in the original post it works on one computer but not the other.

I have been all through the manual and even did the regasm20acu /register /codebase AcuToNet.dll even though I have not had any other versions of the software on the machine.

Again, thak you everyone for your help.

J
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Error calling a DLL

In addition to registering Acu2Net did you also register marshall on the Windows 2008 machine

\acucbl\bin\marshal.exe /RegServer
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Error calling a DLL

That did the trick.

Thank you very much 🙂

J
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.