Overcoming 1K limit with Custom Socket Control?

If anyone has found an ocx, or dll, that gives and interface to tcp socket programming that; 1) blocks, so that c/side waits for data 2) can receive text larger than 1024 bytes into Navision Please, pretty please, let me know. I’ve looked at about 25 or so on the web, but they all return strings (as opposed to arrays or variants). In short, I am sending a string to a server that sometimes generates a response string larger that 1K (1024 bytes). BTW - If anyone has “with events” working with a custom socket control please let me know as well! Thanks, john

If you’re just needing an ocx for that… why don’t you create your own?? If you’ve found ocx that return strings, you just need to create your own ocx that uses the other one functions and handles the return string making it an array or whatever you want if the string is larget than 1K. Then use your ocx for handling the functions on the other ocx in a transparent way… example: if the ocx is having just three functions: connect() receive(string) disconnect() your ocx can have also three functions: connect () { originalocx.connect(); } disconnect{} { originalocx.disconnect(); } receive(string1,string2,string3) { mystring : string; originalocx.receive(mystring); if (strlen(mystring) > 1024) then { string1 := copystr(mystring,1,1024); mystring := copystr(mystring,1025,strlen(mystring)); if (strlen(mystring) > 1024) then { string2 := copystr(mystring,1,1024); string3 := copystr(mystring,1025,1024); } } } (as you can see i’ve mixed different languages in the sample… but you can translate it to the development language you’re going to use for your ocx… as this was just an orientative example :slight_smile: ) Regards,

Good ideas Alfonso, but I don’t have a compiler. Anyone want to build for me? I have the specs! -john

You can only fire events into Navision when you use an automation server, not an OCX. I can recommend the Borland compilers. Not that expensive either. By the way. Attain now have a socket bus adapter, to complement the named pipes and MSMSQ adapters.

Allan, i think his problem was not the events, but the string return. In fact you can use an OCX which function is the one who wait for receiving the data and just having navision calling that function… as long as the function is not ended, navision will wait for the result… Regards,

Any takers on the coding of an ocx? I’ll pay!