private void btnWriteInt_Click(object sender, EventArgs e) { int value = Convert.ToInt32(tbValueInt.Text); // The value we want to store String namIntMem = tbMemInt.Text; // Name of the Memory in which we will store int position = Convert.ToInt32(tbPosInt.Text); // Position to be written in SmClientCdecl.setInt(namIntMem, position, value); // Function use }
private void button5_Click(object sender, EventArgs e) { SmClientCdecl.freeMemories(); MessageBox.Show("The memories have been released.", "SMClient", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { SmClientCdecl.freeViews(); MessageBox.Show("All views created are released", "Views Releasing", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void btnWriteString_Click(object sender, EventArgs e) { String value = tbValueString.Text; // The value we want to store String namStrMem = tbMemString.Text; // Name of the Memory in which we will store int position = Convert.ToInt32( // Position to be written in tbPosString.Text ); SmClientCdecl.setString(namStrMem, position, value); // Function use }
private void btnReadFloat_Click(object sender, EventArgs e) { String namFloatMem = tbMemFloat.Text; // Name of the Memory from which we will read int position = Convert.ToInt32( // Memory position we want to read tbPosRestFloat.Text ); tbResFloat.Text = Convert.ToString( // Function use SmClientCdecl.getFloat(namFloatMem, position) ); }
private void btnWriteFloat_Click(object sender, EventArgs e) { float value = (float)Convert.ToDouble( // The value we want to store tbValueFloat.Text ); String namFloatMem = tbMemFloat.Text; // Name of the Memory in which we will store int position = Convert.ToInt32( tbPosFloat.Text // Position to be written in ); SmClientCdecl.setFloat(namFloatMem, position, value); // Function use }
private void btnWriteDouble_Click(object sender, EventArgs e) { double value = Convert.ToDouble( // The value we want to store tbValueDouble.Text ); String namDoubleMem = tbMemDouble.Text; // Name of the Memory in which we will store int position = Convert.ToInt32( // Position to be written tbPosDouble.Text ); SmClientCdecl.setDouble(namDoubleMem, position, value); // Funtion use }
private void btnReadString_Click(object sender, EventArgs e) { var sb = new StringBuilder((int)64); String nomMemoria = tbMemString.Text; // Name of the Memory from which we will read int posicion = Convert.ToInt32( // Memory position we want to read tbPosResString.Text ); SmClientCdecl.getString(nomMemoria, posicion, sb); // Function use string palabra = sb.ToString(); tbResString.Text = palabra; }
private void btnOpenFloat_Click(object sender, EventArgs e) { String namFloatMem = tbMemFloat.Text; // Name of shared memory to open if (SmClientCdecl.openMemory(namFloatMem, (int)SmClientCdecl.memoryType.Float) == 0) { MessageBox.Show("Shared Memory opened correctly", "SM type: float", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Error opening Shared Memory", "SM type: Float", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnCreateString_Click(object sender, EventArgs e) { String namStringMem = tbMemStringCreate.Text; int stringQuantity = Convert.ToInt32(tbStringQuantity.Text); int ret = SmClientCdecl.createMemory(namStringMem, stringQuantity, (int)SmClientCdecl.memoryType.String); if (ret == 0) { MessageBox.Show("Shared Memory was created correctly", "SM type: String", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Error opening Shared Memory", "SM type: String", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnCreateInt_Click(object sender, EventArgs e) { String namIntMem = tbMemIntCreate.Text; int intQuantity = Convert.ToInt32(tbIntQuantity.Text); int ret = SmClientCdecl.createMemory(namIntMem, intQuantity, (int)SmClientCdecl.memoryType.Integer); if (ret == 0) { MessageBox.Show("Shared Memory was created correctly", "SM type: Integers", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Error creating Shared Memory", "SM type: Integers", MessageBoxButtons.OK, MessageBoxIcon.Error); } }