|
CPallini wrote:
Private Function calc_crc(ByVal crc_buff As Long, ByVal inp As Byte) As Long
Dim i As Byte
Dim x16 As Long
For i = 0 To 7
If ((crc_buff And 1) Xor (inp And 1)) = 1 Then
x16 = &H8408&
Else
x16 = 0
End If
<big>crc_buff = crc_buff \ 2</big>
<big>crc_buff = crc_buff Xor x16</big>
<big>inp = inp \ 2</big>
Next i
calc_crc = crc_buff
End Function
Either way, my VB6 is rather rusty. I've not used it for years, so I could be wrong
|
|
|
|
|
Both crc_buff and inp are passed by value (ByVal ), i.e. the called function (calc_crc ) receives a copy of each passed parameter and cannot change the original ones.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Ugh. Stupid mistake. Sorry about that
|
|
|
|
|
Don't worry, my VB6 is rusty too (actually VB6 by itself is quite rusty... ).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
i am newbie into this vb6.
Tell me how best i can implement this, What i really want is to get two check sum bytes for my stream of data i am sending via a MScomms and use it again to cross check the check sum of the incoming data packet and so the validity of the incoming packet
the frame i am sending is like this
0x01 0x10 0x01 0xF0 0x0A 0x02 0x23 0x10 0x10 0x00 0x59 0x16 0x1F ...22bytes with 2 bytes for check sum
And i am receiving a request of length 16bytes so i want to verify the request then send a reply as required by the protocol
will be very thankful for help
|
|
|
|
|
VB6
I'd better be a newbie in (Hair Styling) than be a newbie in VB6.
Do you know what year is it ? They have invented a First Flying car read here http://dsc.discovery.com/news/2009/01/22/flying-car.html[^]
When VB6 was used we were using Camels and Horses to work
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
Schmuck! Now you're stuck supporting the code you posted!
|
|
|
|
|
My code is unsopported by definition: I'm a Klingon programmer [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Why are you using VB6 ? Do you hate yourself ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
|
Hi...M working on a application where there's a seperate bindingsource for each form...Now there's a situation where i have to transit from one form 2 other and then return from that to the before one...
Now the problem that i am facing is when i return it does not accept the previous binding...I tried many things but cant solve it.Please help...
|
|
|
|
|
Hi everyone
I need help on writing a small application on sending a simple text sms like TEXT to the PC and it will get into the database (mySQL) to search for the information on it and reply back the result to the user. Please help me on how to start on the application.
If you have a mini application to this kind of application, can send it to mi at h0n0ka@ymail.com.
by the way, i'm using either VB2005 or VB2008 and for the modem i'm using bluocean serial gsm modem GSM-S-W2..
Thanks in advance
|
|
|
|
|
Is google broken where you live ? You need an SMS server, there's at least one article on this site explaining how to do it.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Hi,
I am using a SCADA application for some control systems, but I don't want the user to be able to drag the application window by using the titlebar. The only option I have left on the titlebar is to close and that is restricted by user privileges within the application.
I can't do away with the titlebar as it has some menus I want to keep, that are specific to the application. I tried the manufacturer of the package and they were as helpful as a chocolate fireguard.
Is there a way to stop mouse clicks being detected as a general OS rule, either by a VBScript or maybe a registry edit. I am running Win XP Pro SP2.
Thanks,
Jon.
|
|
|
|
|
Perhaps you could override the window procedure and fiddle with the WM_MOVING and WM_WINDOWPOSCHANGING notifications in some way
|
|
|
|
|
How do I store image into the database in Microsoft SQL
|
|
|
|
|
Google broken where you live ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Or the forum search tool? It's not like this gets asked weekly.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
When I am dragging a column divider,sysheader32 will issue HDN_TRACK Notification.But the interval of this notification (column width changing) is not by 1 pixel step. How to get notification by every 1 pixel changing?
I want to implement ColMaxWidth and ColMinWidth property into vbaccelerator’s sGrid2.When I am dragging the divider of a column, the column will stop resizing when column width is reaching the colmaxwidth or colminwidth boundary.
I am checking the mouse position or lWidth in sub m_cHeader_ColumnWidthChanging,if Column Width is reaching the colmaxwidth or colminwidth boundary,then I use ClipCursor API to restrict mouse movement. But the problem is that Header's HDN_TRACK notification is not being sent by 1 pixel change . When I got the notification,the column width has been changed by more than 1 pixel.That is why I can't control the column width accurately. e.g. the Max. Column width is set to 100,The min. Column Width is 50,But somehow,the Column width is going to 48 or 102,not the exact 50 or 100 while resizing.
The notification sequence is :
WM_MouseMove, WM_LBUTTONDOWN, HDN_BEGINTRACK, WM_MOUSEMOVE, HDN_TRACK, WM_MOUSEMOVE, HDN_TRACK, WM_MOUSEMOVE, HDN_TRACK ... WM_MOUSEMOVE, HDN_TRACK, HDN_ENDTRACK
[Note]The problem is that the notification is not being sent by per pixel by per pixel. If I am moving mouse very fast, Mouse will over the boundary of ColMaxWidth and ColMinWidth by few pixels.
in Header Class,I am Subclassing those related notifications:
Case HDN_TRACKA, HDN_TRACKW
CopyMemory tHDN, ByVal lParam, LenB(tHDN)
'/* Get HD_ITEM from tHDN.lPtrHDItem. Don't use a HD_ITEM
'/* structure - you will crash...
'
Private Sub m_cHeader_ColumnWidthChanging(ByVal lColumn As Long, _
lWidth As Long, _
bCancel As Boolean)
Dim iCol As Long
Dim iIntCol As Long
Dim tR As RECT
Dim tClipRect As RECT
Dim iCurrentCol As Long
For iCol = 1 To m_iCols
If (m_tCols(iCol).lHeaderColIndex = lColumn + 1) Then
iCurrentCol = iCol
End If
Next
If Not m_tCols(iCurrentCol).lMaxWidth = -1 Then
If lWidth > m_tCols(iCurrentCol).lMaxWidth Then
ClipCursorRect tClipRect
End If
End If
If Not m_tCols(iCurrentCol).lMinWidth = -1 Then
If lWidth < m_tCols(iCurrentCol).lMinWidth Then
ClipCursorRect tClipRect
End If
End If
pGetDragImageRect lColumn, lWidth, tR, False
DrawDragImage tR, False, False
RaiseEvent ColumnWidthChanging(lColumn, lWidth, bCancel)
If bCancel Then
DrawDragImage tR, False, True
End If
End Sub
Private Sub pGerClipColRect(ByVal lCol As Long, _
ByVal lMaxWidth As Long, _
ByVal lMinWidth As Long, _
ByRef tR As RECT)
Dim iCol As Long
Dim iGCol As Long
Dim tP As POINTAPI
'/* Find RECT for header column with Max and Min Width to stop sizing when out of boundary:
If lCol > 0 Then
'
[Chinese]当拖动Header的分界线时候,会发出HDN_TRACK消息(Notification)。问题是HDN_TRACK消息的发出间隔不是1 pixels by 1 pixels,可能多过一个Pixels.请问要用什么办法可以获得sysheader32的Column每改变1 pixels消息?
|
|
|
|
|
Case close.
Should concerns tp.x and column original right coordinate when getting HDN_BEGINTRACK notification.
|
|
|
|
|
i spent 2 days, 48 hours on this to disable the sound but there is nooooooooooo fu***** solution i am crazy anymore!!
i to do with registry and than refresh explorer [NOTHING]
i tried rename file before navigation start and rename after [NOTHING]
i tried move and delete file [NOTHING]
i tried to delete all strings in registry with "Windows XP Start.wav" [NOTHING]
i tried even this:
<br />
Imports System<br />
Imports Microsoft.Win32<br />
Imports System.Runtime.InteropServices<br />
<br />
Module [aclickdisabler]<br />
Dim HisSoundO, HisSoundM As String<br />
<br />
<br />
<br />
Private Sub readKey()<br />
On Error Resume Next<br />
Dim oReg As RegistryKey<br />
Dim tmpS As String<br />
oReg = Registry.CurrentUser.OpenSubKey("AppEvents\\Schemes\\Apps\\Explorer\\Navigating\\.Current")<br />
tmpS = oReg.GetValue("", "").ToString '%SystemRoot%\media\Windows XP Start.wav<br />
oReg.Close()<br />
<br />
If tmpS = "" Then<br />
Else<br />
If tmpS.Contains(":\") Then<br />
Else<br />
tmpS = "C:\WINDOWS\Media\" + tmpS<br />
End If<br />
HisSoundO = tmpS<br />
HisSoundM = System.IO.Path.GetDirectoryName(HisSoundO) & "\" & System.IO.Path.GetFileNameWithoutExtension(HisSoundO) & ".blocked"<br />
End If<br />
<br />
End Sub<br />
<br />
Public Sub ED_Navigate_Sound(ByVal Enabled As Boolean)<br />
'On Error Resume Next<br />
<br />
Dim oReg As RegistryKey<br />
oReg = Registry.CurrentUser.OpenSubKey("AppEvents\\Schemes\\Apps\\Explorer\\Navigating\\.Default", True)<br />
oReg.SetValue("", "C:\Windows\f***in_non_exsisting_file.wav")<br />
oReg.Close()<br />
<br />
readKey()<br />
<br />
'MsgBox(HisSoundO + "-" + HisSoundM)<br />
If Enabled = True Then<br />
System.IO.File.Move(HisSoundM, HisSoundO)<br />
'My.Computer.FileSystem.RenameFile(HisSoundM, HisSoundO)<br />
'Dim oReg As RegistryKey<br />
'oReg = Registry.CurrentUser.OpenSubKey("AppEvents\\Schemes\\Apps\\Explorer\\Navigating\\.Current", True)<br />
'oReg.SetValue("", HisSound, RegistryValueKind.ExpandString)<br />
'oReg.Close()<br />
ElseIf Enabled = False Then<br />
System.IO.File.Move(HisSoundO, HisSoundM)<br />
'Kill(HisSoundO)<br />
'My.Computer.FileSystem.RenameFile(HisSoundO, HisSoundM)<br />
'Dim oReg As RegistryKey<br />
'oReg = Registry.CurrentUser.OpenSubKey("AppEvents\\Schemes\\Apps\\Explorer\\Navigating\\.Current", True)<br />
'oReg.SetValue("", "", RegistryValueKind.ExpandString)<br />
'oReg.Close()<br />
End If<br />
<br />
End Sub<br />
<br />
End Module [NOTHING]<br />
i tried all buth it allways plays f***in default navigation "čing čing" waaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
anyone knows a solution?
|
|
|
|
|
Suddenly
i created new project inserted webbrowser and put on load navigate to Google and guess what no sound no "čing čing" then i started my original application and yeeeeeeee no sound, hope it will work forewer! so solution is up there if someone need's it.
|
|
|
|
|
me again two more things to do to be sure it will work always just edit this two:
FeRtoll wrote: tmpS = "C:\WINDOWS\Media\" + tmpS
tmpS = System.Environment.ExpandEnvironmentVariables("%WinDir%") + "\Media\" + tmpS
and
FeRtoll wrote: 'On Error Resume Next
On Error Resume Next
|
|
|
|
|
sometimes it works sometimes don't what can i do???? anyone?
|
|
|
|
|