|
This is not a question. Try posting something that is, and that includes what you did to try to solve your issue.
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 )
|
|
|
|
|
Flash has support programming.so You Can use Script on Flash for Running Application.
Best Regard
Anubhava Dimri
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
please help i need a visual basic 6 conversion or equivalence of the below code
i tried several codes but i am getting different results
urgently in need of help
/*************************************************************************
Function: 16 bit CRC-CCITT calculation
--------------------------------------------------------------------------
Call: calc_crc(unsigned short crc_buff, unsigned char input)
--------------------------------------------------------------------------
Response: Newly calculated 16 bit CRC checksum
--------------------------------------------------------------------------
Description: Calculates the checksum for 'input' in accordance with the CRC polynomial x^16 + x^12 + x^5 + 1. 'crc_buff' is the previously calculated checksum. This must be set to 0xFFFF at the beginning of a test sequence.
*************************************************************************/
unsigned short calc_crc(unsigned short crc_buff, unsigned char input)
{
unsigned char i;
unsigned short x16; // we’ll use this to hold the XOR mask
for (i=0; i<8; i++)
{
// XOR current D0 and next input bit to determine x16 value
if( (crc_buff & 0x0001) ^ (input & 0x01) )
x16 = 0x8408;
else
x16 = 0x0000;
// shift crc buffer
crc_buff = crc_buff >> 1;
// XOR in the x16 value
crc_buff ^= x16;
// shift input for next iteration
input = input >> 1;
}
return(crc_buff);
}
File: UMB-Protokoll 1_0 Version 1_5_e.doc,
Version 1.5,
Status 14.12.2007
37
// ******************* MAIN ************************************
void main(void)
{
// example: CRC for 8 Bytes
unsigned char values[8] =
{0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37};
// initialise startvalue FFFFh
unsigned short crc = 0xFFFF;
// calculation
for(int n = 0; n < 8; n++)
{
crc = calc_crc(crc, values[n]);
}
// output
printf("\ndata: 30h, 31h, 32h, 33h, 34h, 35h, 36h, 37h");
printf("\nCRC: %04Xh\n", crc);
}
|
|
|
|
|
Can you post your attempts at converting this and explain what is going wrong? It is unlikely that someone will just do it for you, unless you pay them of course!
|
|
|
|
|
the following is VBA (VB6 is dead on my system)
Private Sub CommandButton1_Click()
Dim crc As Long
Dim n As Integer
Dim values(8) As Byte
crc = &HFFFF&
For n = 0 To 7
values(n) = &H30 + n
Next n
For n = 0 To 7
crc = calc_crc(crc, values(n))
Next n
MsgBox ("Crc " & crc)
End Sub
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
crc_buff = crc_buff \ 2
crc_buff = crc_buff Xor x16
inp = inp \ 2
Next i
calc_crc = crc_buff
End Function
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]
|
|
|
|
|
please be blessed i have seen some light with your code. i will come back to you in due course let me try to implement it it looks it will do the magic
|
|
|
|
|
That code might not work correctly. Doesn't VB6 implicitly pass all parameters by reference?
|
|
|
|
|
Computafreak wrote: Doesn't VB6 implicitly pass all parameters by reference?
Unless you specify, as I did, ByVal .
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]
|
|
|
|
|
Doesn't the calc_crc method try to alter the parameters in the for-loop?
|
|
|
|
|
Nope, none of the two versions, of course.
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]
|
|
|
|
|
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
|
|
|
|