Example #1
0
        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);
            }
        }
Example #2
0
        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);
            }
        }