×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
You might want to take a little time to explore the System.Text.Encoding
namespace, specifically the Encoding.GetEncoding(int codepage) static
method.
Might not work but could be worth a shot.
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of ibm
Sent: 25 June 2009 20:34
To: Midrange Systems Technical Discussion
Subject: RE: API: cwbOBJ_ReadSplF
RE: losing bytes
Looks like the problem is with StringConverter.FromBytes. I tested
reading 500 bytes at a time, then looping though the 500 byte array and
running FromBytes method byte-by-byte.
I was also thinking there must be a .NET way to convert IBM's Ebcidic?
To ASCII.
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of ibm
Sent: Thursday, June 25, 2009 2:25 PM
To: Midrange Systems Technical Discussion
Subject: RE: API: cwbOBJ_ReadSplF
Dave, looks like CWBX.StringConverter.FromBytes(bytedata) did the trick.
There are still some formatting issues, such as TABs and other
characters are displayed as squares.
Also in the below code I had to change the code to read 1 byte at a
time. Otherwise I was getting just parts of the spooled file.
I tried to speed the processing up by reading one byte from file,
Marshal.Copy the pointer to a byte, then copy that byte to a byte array,
increase the byte array by 1, read one byte from file... etc... Then
when the entire file was read I used
StringConverter.FromBytes(destinationByteArray). The size of the byte
array was over 2000 but only 5 characters were displayed.
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Dave
Sent: Thursday, June 25, 2009 1:16 PM
To: Midrange Systems Technical Discussion
Subject: re: API: cwbOBJ_ReadSplF
Not sure if it applies to spool files, but I know when using data queues
you need to use IcwbxStringConverter to and from bytes...
Dave
====
www.openDave.com
----------------------------------------
From: "ibm" <ibm@xxxxxxxxxx>
Sent: Thursday, June 25, 2009 10:34 AM
To: MIDRANGE-L@xxxxxxxxxxxx
Subject: API: cwbOBJ_ReadSplF
I'm trying to read the contents of a spooled file, but all I am getting
is garbage. Anyone have any insight into this?
Thanks
_
Public Shared Function cwbOBJ_ReadSplF(ByVal objectHandle As IntPtr,
_
ByVal bBuffer As IntPtr, _
ByVal bytesToRead As Integer,
_
ByRef bytesRead As Integer, _
ByVal errorHandle As IntPtr)
As Integer
End Function
Public Sub TryObjList()
Dim listSize As Integer = 0
Dim objHandle As IntPtr = IntPtr.Zero
Dim bBuffer As IntPtr = IntPtr.Zero
Dim bbBuffer(1000) As Byte
Dim bytesRead As Integer = 0
Dim CWBOBJ_RC_SPLFENDOFFILE As Integer = (6000 + 8)
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.