Thank you for your prompt replies. I should have seen this
because the project I'm working on transmits these characters
out via USB and I can see the 0x0A and 0x0D appear in the
receive buffer of the device.
Problem solved :)
I wonder if anyone can explain this:-
Create a form with a multi line text box and 2 buttons.
Put the following code under the buttons:-
Private Sub Cmd_Count_Click()
MsgBox Len(Text1.Text) & " characters.", vbOKOnly
End Sub
Private Sub Cmd_Fill_Click()
Dim X As Long
Dim sTemp As String
For...
Here is the code to calculate the CRC16-CCITT checksum
which uses the x^16,x^12,x^5,x^1 polynomial.
It uses a lookup table for speed.
DataByte() is the byte array which the checksum is calculated for.
In the example the array is loaded from a hex string in
Text1.Text.
The initial value is loaded...
Oh dear, it's so embarrassing when you reply to your own question. After hours of research on MSDN etc the method is simple. Use the GetCursor () function. Microsoft say it returns a handle to the cursor. A handle which changes depending on the cursor type.
Can anybody please tell me an API function which will return the current cursor style. I specifically want to know when the cursor changes to one of the resize identifiers:-
IDC_SIZENESW
IDC_SIZENS
IDC_SIZENWSE
IDC_SIZEWE
Many thanks.
Problem solved!
I've discovered that if you store the pictures (bitmaps,jpgs etc) in the same directory as the project, or more specifically in the same folder as the forms frx file then the buttons don't loose their graphics. The frx file contains the graphics information contained in the forms...
I have a frame containing an array of graghical command buttons. Each button has a small bitmap image and 3 chrs of text. When working in the IDE the buttons randomly loose
their image. The image can be replaced using the buttons properties but at some future time, when the project is reloaded...
I searched for ages trying to find a way to set the PC
serial port to 10400 baud (the standard for IS0 9141
vehicle diagnostics) so I could monitor bus activity.
It's easy but you need inpout32.dll (get this from the web).
Basically what it's doing is setting the UART clock divisor manually. To...
Paul,
BDC is hex as far as the real value of the number is concerned and is limited to a max value of 0x99.
If you read a PC memory address containing 2 bytes of BCD
0x34,0x12 (remember intel little endian format).
The PC reads this as 0x1234 which is 4669 dec.
(0x12 * 0x100) + 0x34
So to return...
BCD is simply hexadecimal where the individual characters
are limited to between 0 and 9 rather than 0 to F.
So to convert from a decimal BCD number, convert it to
Hex and then back to decimal i.e:-
Private Sub Command1_Click()
Dim Lng_Val As Long
Dim Str_BCD As String
Str_BCD = Hex(10032)...
elziko,
Strange, I ran the code below and got no preceeding
bytes.
Option Explicit
Dim Tmp(3) As Byte
Private Sub Form_Load()
Tmp(0) = 49
Tmp(1) = 50
Tmp(2) = 51
Tmp(3) = 52
Dim fnum As Long
fnum = FreeFile
Open App.Path & "\test.bin" For Binary As fnum
Put #fnum, , Tmp
Close #fnum...
Elziko,
There are several ways to do this :-
One is to use LSET to assign the memory contents of one user
defined variable into another eg ....
Private Type Typ_4Byte
Byte1 As Byte
Byte2 As Byte
Byte3 As Byte
Byte4 As Byte
End Type
Private Type Typ_Single
Byte_All As...
Snaggs and RVBasic - thanks for your help.
Snaggs :-
I found reference to CopyMemory in MSDN and implemented it
as the following example :-
Byte_Array(0) = Val("&h" & Byte1T)
Byte_Array(1) = Val("&h" & Byte2T)
Byte_Array(2) = Val("&h" & Byte3T)
Byte_Array(3) =...
I receive 4 seperate bytes from the comm port.
I need to create an IEEE754 single float out of them.
Presently I have 2 ways of doing this, non are very elegant.
1) Split all 4 bytes into a binary string (0s and 1s),
add them together, split them up using the IEEEE 754
rules, convert them...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.