From: Jacquelin Hardy on
Tym,

I suppose you are working on NMEA sentences !

In plain words, the translation would be:

The tail of the message consists of a two character checksum (hexadecimal
notation) followed by a carriage return then a line feed. The checksum
consists of the byte-wise exclusive OR of all bytes in the message. This
includes the leading dollar sign and is terminated by the asterisk
immediately before the checksum (which is included in the checksum).

Regards

Jacquelin H.

"Tym" <no_spam(a)Ictis.net> a ýcrit dans le message de news:
j1qve15is8u1b31b5fucig9ljl64lr3jec(a)4ax.com...
>I can only find this routine in C and need it in VB6 - can anyone
> translate this please:
>
> --8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--
>
> unsigned char Calc_checksum(char* sz, int nCount)
> {
> unsigned char cs; // Checksum
> //Omit the $-character
> for (i=1; i<Count; i++)
> {
> cs = cs ^((unsigned char)sz[i]);
> }
> return cs;
> }
>
> --8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--
>
>
>
> ---
>
>
> Tym
>
> Please do not adjust your brain, there is a fault with reality
>
> Email - Domain is valid - user is not - I'm sure you can work it out
> though!
>
> However, there is an agressive spam trap here, so you'll get blacklisted
> until I
> white list you. If you've emailed and asked for a reply and not got one -
> please
> post a message in here and I'll re-check the black hole!
>
> A plague of Jonathan Ross a thousand fold on the spammers!!


From: Galen Somerville on
Go to Planet source code and look for the ctovb convertor.

Galen

"Ted" <2000(a)xxxmsn.com> wrote in message
news:OYmeqN9lFHA.2060(a)tk2msftngp13.phx.gbl...
> You know C ?? :-)
> How about this one please ?
>
> Wow64DisableWow64FsRedirection and Wow64RevertWow64FsRedirection
>
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''
> #define _WIN32_WINNT 0x0501
> #include <windows.h>
>
> PVOID OldValue;
> HANDLE hFile;
>
> BOOL bRet = Wow64DisableWow64FsRedirection (&OldValue);
>
> if (bRet == TRUE)
> {
> // Open a file
>
> hFile = CreateFile(TEXT("c:\\windows\\system32\\notepad.exe"),
> GENERIC_READ,
> FILE_SHARE_READ,
> NULL,
> OPEN_EXISTING,
> FILE_ATTRIBUTE_NORMAL,
> NULL);
>
> // Restore the previous WOW64 file system redirection value.
>
> Wow64RevertWow64FsRedirection (OldValue);
> }
>
> if( INVALID_HANDLE_VALUE != hFile )
> {
> // Use the file handle
> }
>
> ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
> 'Also may be GetSystemWow64Directory
>
> The GetSystemWow64Directory function retrieves the path of the system
> directory used by WOW64. This directory is not present on 32-bit Windows.
>
> UINT GetSystemWow64Directory(
> LPTSTR lpBuffer,
> UINT uSize
> );
>
> Parameters
> lpBuffer
> [out] Pointer to the buffer to receive the null-terminated string
containing
> the path. This path does not end with a backslash.
> uSize
> [in] Maximum size of the buffer, in TCHARs. This value should be set to
> MAX_PATH.
> Return Values
> If the function succeeds, the return value is the length, in TCHARs, of
the
> string copied to the buffer, not including the terminating null character.
> If the length is greater than the size of the buffer, the return value is
> the size of the buffer required to hold the path.
>
> If the function fails, the return value is zero. To get extended error
> information, call GetLastError.
>
> On 32-bit Windows, the function always fails, and the extended error is
set
> to ERROR_CALL_NOT_IMPLEMENTED.
>
> Remarks
> WOW64 uses the system directory to store shared 32-bit code on 64-bit
> Windows. Most applications have no need to access this directory
explicitly.
>
>
> Requirements
> Header Declared in Winbase.h; include Windows.h.
> Library Link to Kernel32.lib.
> DLL Requires Kernel32.dll.
> Unicode Implemented as GetSystemWow64DirectoryW (Unicode) and
> GetSystemWow64DirectoryA (ANSI).
>
>
>


From: Ted on
> Go to Planet source code and look for the ctovb convertor.

I couldn't find it in the beginning then I tried c2vb and
it worked.

Many Thanks

"Galen Somerville" <galen(a)surewest.net> wrote in message
news:epBHuYJmFHA.3656(a)TK2MSFTNGP09.phx.gbl...
> Go to Planet source code and look for the ctovb convertor.
>
> Galen
>
> "Ted" <2000(a)xxxmsn.com> wrote in message
> news:OYmeqN9lFHA.2060(a)tk2msftngp13.phx.gbl...
>> You know C ?? :-)
>> How about this one please ?
>>
>> Wow64DisableWow64FsRedirection and Wow64RevertWow64FsRedirection
>>
> ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
> '''''''''''''''''
>> #define _WIN32_WINNT 0x0501
>> #include <windows.h>
>>
>> PVOID OldValue;
>> HANDLE hFile;
>>
>> BOOL bRet = Wow64DisableWow64FsRedirection (&OldValue);
>>
>> if (bRet == TRUE)
>> {
>> // Open a file
>>
>> hFile = CreateFile(TEXT("c:\\windows\\system32\\notepad.exe"),
>> GENERIC_READ,
>> FILE_SHARE_READ,
>> NULL,
>> OPEN_EXISTING,
>> FILE_ATTRIBUTE_NORMAL,
>> NULL);
>>
>> // Restore the previous WOW64 file system redirection value.
>>
>> Wow64RevertWow64FsRedirection (OldValue);
>> }
>>
>> if( INVALID_HANDLE_VALUE != hFile )
>> {
>> // Use the file handle
>> }
>>
>> ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
>> 'Also may be GetSystemWow64Directory
>>
>> The GetSystemWow64Directory function retrieves the path of the system
>> directory used by WOW64. This directory is not present on 32-bit Windows.
>>
>> UINT GetSystemWow64Directory(
>> LPTSTR lpBuffer,
>> UINT uSize
>> );
>>
>> Parameters
>> lpBuffer
>> [out] Pointer to the buffer to receive the null-terminated string
> containing
>> the path. This path does not end with a backslash.
>> uSize
>> [in] Maximum size of the buffer, in TCHARs. This value should be set to
>> MAX_PATH.
>> Return Values
>> If the function succeeds, the return value is the length, in TCHARs, of
> the
>> string copied to the buffer, not including the terminating null
>> character.
>> If the length is greater than the size of the buffer, the return value is
>> the size of the buffer required to hold the path.
>>
>> If the function fails, the return value is zero. To get extended error
>> information, call GetLastError.
>>
>> On 32-bit Windows, the function always fails, and the extended error is
> set
>> to ERROR_CALL_NOT_IMPLEMENTED.
>>
>> Remarks
>> WOW64 uses the system directory to store shared 32-bit code on 64-bit
>> Windows. Most applications have no need to access this directory
> explicitly.
>>
>>
>> Requirements
>> Header Declared in Winbase.h; include Windows.h.
>> Library Link to Kernel32.lib.
>> DLL Requires Kernel32.dll.
>> Unicode Implemented as GetSystemWow64DirectoryW (Unicode) and
>> GetSystemWow64DirectoryA (ANSI).
>>
>>
>>
>
>