Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Code Samples & Tips > Additional Libraries
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Additional Libraries Users contributed libraries.
This sub-forum is only available to licensed users.


ByteConverter library


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-19-2008, 12:45 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,697
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default ByteConverter library

Here is my latest library that is probably no use to anyone except me It should work on .NET 1.0 and later and on device and desktop.

It grew out of playing with the AdaptorsInfo library that I knocked up for Cableguy. AdaptorsInfo returns a byte array which is basically a C Struct containing several different data types detailing a network adaptor's data.

This library takes a specified start position in a byte array and returns the data in the array converted to a required datatype. It can also reverse that process, taking a datatype and returning a byte array. For good measure string conversions to and from byte arrays are provided. As this library is really intended for Win API use the byte arrays representing string data assume that the strings are terminated by a zero character which is C/Win32 convention. Hence, unlike B4ppc/.NET strings they cannot contain a zero character.

With the BytesConverter library there is a help file, demo and the source for merging with compiled exes.

I have also included an improved AdaptorsInfo library that can return data for any of the network adaptors on a system, the original only returned the first. With the library is a demo. For technical reasons it is not possible to merge this library with a compiled exe. This should be possible in the next version of B4ppc - Erel willing!

EDIT: Note that the AdaptorsInfo demo needs the BytesConverter library. I didn't include it in the zip as I don't believe in scattering copies of dlls around in zips too often as they may need to be updated at some time in the future.

EDIT: Version 1.2 with a CodepageFile object added. Updated help, new demo and updated source included.
Attached Files
File Type: zip AdaptorsInfo1.0.zip (3.1 KB, 38 views)
File Type: zip BytesConverter1.2.zip (17.6 KB, 37 views)

Last edited by agraham : 06-21-2008 at 06:26 PM.
Reply With Quote
  #2 (permalink)  
Old 06-21-2008, 06:02 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,697
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Version 1.2 posted above. It now includes a CodepageFile object that implements FileOpen, FileRead, FileReadToEnd, FileWrite and FileClose in imitation of the native B4ppc methods.

Whereas native B4ppc File methods can only read/write ASCII or UTF8 text files this objects reads/writes using a specified code page. This enables direct use of a codepage without having to go through a byte array as an intermediate step.

Last edited by agraham : 06-23-2008 at 06:50 PM.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
PhoneticAlgorithms Library (ex-StringComparison Library) moster67 Additional Libraries 10 11-11-2008 08:46 PM
Door library (Beta) - Special library Erel Official Updates 48 07-18-2008 03:33 PM
Merging Outlook library and Phone library Erel Official Updates 2 07-14-2008 04:38 PM


All times are GMT. The time now is 08:32 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0