Skip to main content

Hello, 

I've run into an issue regarding the use of pointers in a .net assembly when using Thin Client(version 9.2.4). The code that follows runs fine when local, however through thin client the acuthin executable crashes when running the Marshal.StructureToPtr in the .net code. I'm suspecting this is because the pointer is getting created server side, rather than client side. I did find some documentation regarding calling dlls that use pointers through thin client(7.2.6.3 Passing pointers in DLL calls ), however neither the -Zm compile option or the M$ memory calls seemed to solve the problem. In the windows event viewer I'm seeing acuthin throw a memory access violation. Any help here would be much appreciated. Thanks!

.net Code:

public int Swipe_Card(int resultPointer)
{
var code = CardSwipeResultCode.SwipeTechnicalError;
try
{
var pointer = new IntPtr(resultPointer);
SwipeResult result;
(result, code) = DebitCreditProcessor.SwipeCard();
Marshal.StructureToPtr(result, pointer, true);
}
catch (Exception exception)
{
DisplayErrorMessage(exception);
}
return (int)code;
}

COBOL Code:

       77  RESULT-POINTER USAGE POINTER.

SET RESULT-POINTER TO ADDRESS OF SWIPE-RESULT
MODIFY NET-HANDLE
"@Swipe_Card"
(RESULT-POINTER)
GIVING WS-RESULT


#ThinClientPointer.netAssembly

Hello, 

I've run into an issue regarding the use of pointers in a .net assembly when using Thin Client(version 9.2.4). The code that follows runs fine when local, however through thin client the acuthin executable crashes when running the Marshal.StructureToPtr in the .net code. I'm suspecting this is because the pointer is getting created server side, rather than client side. I did find some documentation regarding calling dlls that use pointers through thin client(7.2.6.3 Passing pointers in DLL calls ), however neither the -Zm compile option or the M$ memory calls seemed to solve the problem. In the windows event viewer I'm seeing acuthin throw a memory access violation. Any help here would be much appreciated. Thanks!

.net Code:

public int Swipe_Card(int resultPointer)
{
var code = CardSwipeResultCode.SwipeTechnicalError;
try
{
var pointer = new IntPtr(resultPointer);
SwipeResult result;
(result, code) = DebitCreditProcessor.SwipeCard();
Marshal.StructureToPtr(result, pointer, true);
}
catch (Exception exception)
{
DisplayErrorMessage(exception);
}
return (int)code;
}

COBOL Code:

       77  RESULT-POINTER USAGE POINTER.

SET RESULT-POINTER TO ADDRESS OF SWIPE-RESULT
MODIFY NET-HANDLE
"@Swipe_Card"
(RESULT-POINTER)
GIVING WS-RESULT


#ThinClientPointer.netAssembly

Good morning, David Wrightson

May I suggest you to review our updated v10.4.0 Documentation: https://bit.ly/2ZCvrcz

If this is not enough and does not solve the problem, you can proceed in two ways:

1. Test AcuConnect Thin Client 10.4.0.
If what you are exposing is due to a lack present in version 9.2.4, there are good chances that it has already been solved.
Please note that 9.2.4 is now 7 years old, and it's not tested for the latest Windows OS's.
You didn't specify what OS is installed on your client machine, but the latest Windows OS's are certified from v10.0.0 and forward.
Using a certified version of Thin Client may help.
Using a new release of Thin Client that includes dozens of new fixes may help more.

2. Provide our Customer Care with the full source of both your assembly and your COBOL program, using https://portal.microfocus.com
A snippet of the program cannot help a lot.
Customer Care should be able to compile the program (the shorter and dedicated it is, the easier the test will be) and replicate the issue in-house. 

Looking forward for your feedback.

Regards.