Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

non null terminated string help

Status
Not open for further replies.

kmfna

MIS
Sep 26, 2003
306
0
0
US
Hello all,

My company has recently started working with a 3rd party that has provided us with a .dll which returns a non null-terminated string. I'm not sure exactly what their rationale is behind that, as opposed to a byte array (since we are retrieving an image), but we are looking for a good way to loop through the string and extract the bytes. The further complication is that when the string object comes into c#, it is being interpreted as a 3 character string! The only other piece of information they give is what the size is supposed to be...so, if it weren't being crazily interpreted by c# we could loop through the string and create a byte array, which we could actually use.

If anyone has any ideas, I'd love to hear them.

Thanks in advance!!
-Kevin

- "The truth hurts, maybe not as much as jumping on a bicycle with no seat, but it hurts.
 
hmm.. could it be the string is in the form of delimiter hex hex, does it look something like 0255255 ?

Age is a consequence of experience
 
BTW What does the dll do? Also you did say three chars so the hex may just look lke 255 or 192 or 000

Age is a consequence of experience
 
strings in c# don't have terminators on them.

"non null-terminated string?" what does that mean? has a terminator but not a null, or is just n bytes? either way, how does it expect c# to know when the string is done?

could you post the code you use to access the method in the DLL?

what is the string you're expecting, and what does c# see?



mr s. <;)

 
When an image is given as a string it could mean that it is in hex data, if it has a delimiter or none null terminator this could mean it has been zipped using a RLE (Run Length Encoded) type algorithm? Just a thought as I have worked with some such images in the past.

Age is a consequence of experience
 
Hello all,

thank you for your responses, I will work on getting the code snippet from my colleague who is directly dealing with this issue. My understanding is that the .dll is actually a C language file, which doesn't actually have the string class, but they apparently created some kind of wrapper (non .net) that returns a string to us. This is used when scanning check images. Ideally, they should have returned an array or a variant type. My first idea was to create our own c++ wrapper and include it as a .dll in our application, since we could actually create pointers and loop through the data, with the hopes that it actually comes in to us correctly. If it helps, I believe the company calls the .dll A2IA (I have no idea what it stands for) just in case someone has seen this issue before.

Again, I will try to get our sample code and post it.

Thanks again for everyone's help.
-Kevin

- "The truth hurts, maybe not as much as jumping on a bicycle with no seat, but it hurts.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top