EsCRC - ActiveX control

Eurosource, Gruvbyn 415, S-820 50 LOOS, Sweden
(akhe@eurosource.se) (http://www.eurosource.se)
Updated: 19989-05-05

With this control you can calculate a 32-bit CRC on Files, Buffers and Strings. It is perfect for situation where you need to make shore that the original data is kept intact during a transfer of some form.

 


 

Installation

Transfer EsCrc32.OCX to your \windows\system or \winnt35\system32 directory and register it by executing the command:

RegSvr32 \Windows\System\EsCRC32.OCX

RegSvr32.exe can be found on the Visual Basic 4.0 CD-ROM and in our dll archive (www.eurosource.se). If RegSvr32.exe fails, it's probably because you don't have the MFC 4.0 DLL library installed on your system. This is available from many sources on the Internet including our ftp archive as MFC40DLL.ZIP. Regsvr32.exe is also included in this archive. If you want to check if you already got the files in mfc40dll.zip they are

  • mfc40.dll
  • msvcrt40.dll
  • oc30.dll
  • olepro32.dll
  • regsvr32.exe

Cookbook or how to use the EsCRC Control

Create a EsCRC object for an ASP application

Use the object ID ESCRC.EsCRCCtrl.1 when you create an instance of the EsCRCCtrl.

So the code

<object RUNAT="server" PROGID="ESCRC.EsCRCCtrl.1" id="EsCRC"> </object>
or
set EsCRC = server.CreateObject("EsCRC.EsCRCCtrl.1")

will create the object for you.

Calculate the CRC for a buffer

  1. Set the value of the Length property to the desired length of the buffer.
  2. Fill the buffer with data starting with index=0.
  3. EsCrc32.Length = 3
    EsCrc32.buf(0) = 1
    EsCrc32.buf(1) = 1
    EsCrc32.buf(2) = 1

  4. Call the CalcCrcOnBuf method.
  5. Fetch  the result in the Crc32 property if the above method return TRUE.

Calculate the CRC for a file

  1. Set the InFile property to the path of the file.
  2. Call the CalcCrcOnFile method.
  3. Fetch  the result in the Crc32 property if the above method return TRUE.

 

Calculate the CRC for a string

  1. Call the CalcCrcOnString method with the string as the only argument.
  2. Fetch  the result in the Crc32 property if the above method return TRUE.

 



Properties

 


short Buf( long index)

You can use the buf property to set or fetch data from a buffer. Before using this property you should set the Length property to the desired length of the buffer.


LPSTR InFile

This property holds the name of a file for which a CRC should be calculated.

 


long Length

This is the size of the controls internal buffer. You can manipulate the content of this buffer with the Buf property.

 


long Crc32

This property holds the result after a completed CRC calculation.

 


Methods


BOOL CalcCrcOnBuf

With this method you can calculate the CRC for the content in a buffer defined by the Buf property and the Length property respectively. The method returns TRUE if the calculation completes and the result can then be found in the CRC32 property.


BOOL CalcCrcOnFile

With this method you can calculate the CRC for a file which path is defined by the InFile property. The method returns TRUE if the calculation completes and the result can then be found in the CRC32 property.

 


BOOL CalcCrcOnString (LPCSTR string)

With this method you can calculate the CRC for a string supplied as its argument. The method returns TRUE if the calculation completes and the result can then be found in the CRC32 property.


Events


status (short progress)

Certain operations take some time to complete. This event gives you information about how much of the job that has been completed. When a lengthy job starts the status event is fired with progress set to 0 and then you get status events until the job is complete and a status event with progress set to 100 is fired. You therefore only need to write the progress to a gauge control to give your users dynamic information.


Where to get the control?

It is possible that you are reading this documentation without having access to the control itself. If you have Internet access you just need to connect to http://www.eurosource.se and fetch a fully working sample of the control. At this location you can also find samples on how to use the control.

We can email the control anywhere in the world if you send us a request to do so. Please state if you want MIME or BINHEX coding. Send request to sales@eurosource.se

If you use the unregistered version of the control a splash screen is displayed from time to time reminding you to register.To get rid of this nag-screen you need to register. Information is available at our site.

We ship anywhere in the world with World-wide First Class/Airmail if you select this option. The only media supported is 3.5" diskettes.The charge for this type of delivery is $15 (USD) extra.

Support

You can get support by sending email to support@eurosource.se. You can also find relevant information on-line at http://www.eurosource.se

We also check the newsgroup comp.lang.basic.visual.3rdparty on a regular basis and will try to help on all questions posted there.


How to contact us

  • If you need to contact us the preferred way is through email. Please send a mail to info@eurosource.se
  • If you want to use phone please call us at +46 657 10620 and Fax: +46 657 10612.
  • If you want to send a snailmail you can send it to
  • Eurosource, Gruvbyn 415A, S-820 50 LOOS, SWEDEN