My software is working under Win XP but is not working under Windows 2008 and Windows 7 . Do you have any advises or comments ? Thank you
dec82
Posts
-
Software performance under differences windows environment? -
Find a string in another string?How to find the numeric position of the first occurrence of a string in another string?
-
The type initializer threw an exception?Here is the code : if (rdAnalog.Checked == true) { Class1.SelectedProtocol = Protocol.Analog; private void buttonStartTest_Click(object sender, EventArgs e) { try { if (Analog1.Checked == true) { Class1.ModelSelected = Model.Analog1; } else if (Analog2.Checked == true) { Class1.ModelSelected = Model.Analog2; } else { return; } else { return; } } catch (Exception c) { MessageBox.Show(c.Message); Environment.Exit(0); } }
-
The type initializer threw an exception?I have the class Class1: public enum Protocol { Digital, Analog } public enum Model { Digital1, Digital2, Analog1, Analog2 } public static Protocol m_selectedProtocol; public static Model m_ModelSelected; public static Protocol SelectedProtocol { get { return Class1.m_selectedProtocol; } set { Class1.m_selectedProtocol = value; } } public static Model ModelSelected { get { return Class1.m_m_ModelSelected ; } set { Class1.m_ModelSelected= value; } } Then here is the code being executed: if (rdAnalog.Checked == true) { Class1.SelectedProtocol = Protocol.Analog; if (Analog1.Checked == true) { Class1.ModelSelected = Model.Analog1; } else if (Analog2.Checked == true) { Class1.ModelSelected = Model.Analog2; } else { return; } else { return; } i have this error when this line is executed :Class1.SelectedProtocol = Protocol.Analog; How can it be solved ? thanks
-
pointer and address?In C++, we have pointer and address. How would we handle them when C++ code is converted to C#?
-
pointer and address?What the differences in these code : Write(address, size, data) Write( address, size , &data) The function basically write data into a address, with size is the size of the data to be written . Thanks
-
Data Conversion?the code have error: cannot implicitly convert type 'byte[]' to 'object[]'
-
Data Conversion?I have these code: protected bool EEWrite(UInt16 Address, byte Size, object[] ByteData) { bool Status = true; object[] Data = new object[4 + Size]; Data[0] = SerialNumber; Data[1] = (byte)0x80; Data[2] = (UInt16)Address; Data[3] = (byte)Size; for(int i = 4; i<=4+Size;i++) { Data[i] = (byte)ByteData[i - 4]; } Status = Device.Write( Data); return Status; } Then i 'd like to write a float number write_number as below: Status = EEWrite(0x9021, 1, ByteData); How would i convert a float write_number into ByteData? Thanks !
-
Perform the conversion from a float decimal number to single precision (4 byte) IEEE 754 format number?Could anyone explain for me what these code doing? Could give me an example ? thanks typedef union ieee_754_single_precision { BYTE bytes[FLOAT_BYTES]; float value; IEEE_SBITS bits; } SIEEE_754; void cHARTTransmitter::Float2IEEE(float fDecimalNum, BYTE *pbIEEE) { SIEEE_754 local; short j = FLOAT_BYTES - 1; local.value = fDecimalNum; for (i = 0 ; i < FLOAT_BYTES; i++) { pbIEEE[i] = local.bytes[j--]; } } Float2IEEE((float)m_data, Data);
-
object?how to convert any parameter type into object? thanks
-
Convert number?How to convert a float decimal number into a single precision (4 byte) ? Thanks
-
Perform the conversion from a float decimal number to single precision (4 byte) IEEE 754 format number?What is IEEE 754 format number? how to convert a float decimal number to single precision (4 byte) IEEE 754 format number? Thanks!
-
memset and FLOAT2IEEE?How to convert these code to C#? Thanks! memset(m_bParameterData, 0, sizeof(m_bParameterData)); Float2IEEE((float)EXTERNAL, m_bParameterData);
-
Control cannot fall through from one case to another?is it possible to replace 'switch' by 'while/for' , and 'case' by 'if'? thanks
-
Control cannot fall through from one case to another?I need to convert these C++ code into C# code . What's is the easiest way ? thanks state=1 switch (state) { case 1: //do something state++; case 2: //do something if ( ) { state++; } else { state=state+5; } break; case 3: //do something state++; ............ case 100: break; }
-
Control cannot fall through from one case to another?hi I have these code . What could cause above error ? Thanks state=1 switch (state) { case 1: //do something goto case 2; case 2: //do something goto case 3; case 3: //do something goto case 4; ............ case 100: //do something }
-
the type initializer fror "Myproject.Myclass"threw an exception?what is the meaning of this error? Thanks
-
swicth & case?Could you explain more? thanks
-
swicth & case?Is label needed? Can i do this way: case 1: // do something goto case 2; case 2: //do something goto case 3 ....... thanks!
-
swicth & case?i need to convert C++ code into C#. Then the C++ in the form: number=1 switch(number) { case 1: //do something number++ case 2: //dosomething number++; case 3: if ( ) { //do something number++; } else { number= 100; } case 4: ............ case 120: //do something break; } what is the easiest way to convert these code ? thanks