hey mate.. sorry just giving you the updates.. the dllimport statement from ASP.NET below should be passing byref for string.
'Web service cobol dll
<DllImport("TRIAL.DLL", EntryPoint:="TRIAL", _
SetLastError:=True, CharSet:=CharSet.Unicode, _
ExactSpelling:=True, _
CallingConvention:=CallingConvention.StdCall)> _
Public Shared Sub test(ByRef Size As Integer, ByRef Buffer _
As String)
End Sub
Now, here is another real problem (please ignore all the questions that I had asked you - sorry for the confusion):
1) when execute this line "test(iInt, sString)" in wsCobol function, the application is halted immediately.
2) When I tried to call this dll from VBA code, I'm getting the error: "114 Attempt to access item beyond bounds of memory" and the application was also terminated.
3) In the import dll statement, When I used "ByVal Buffer as string" instead of "ByRef Buffer as string" then the dll cobol will return the extended ASCII char.
It's been driving me crazy.. i need get this done by the end of this year as I need to ensure the stakeholders by next year if the project is a "go" or not.
Please help..
Thanks
R