Click here to Skip to main content
15,891,607 members
Home / Discussions / C#
   

C#

 
QuestionC# Serial port data read and write Pin
Member 132923104-Jul-17 4:15
Member 132923104-Jul-17 4:15 
AnswerRe: C# Serial port data read and write Pin
OriginalGriff4-Jul-17 4:22
mveOriginalGriff4-Jul-17 4:22 
GeneralRe: C# Serial port data read and write Pin
Member 132923109-Jul-17 0:48
Member 132923109-Jul-17 0:48 
AnswerRe: C# Serial port data read and write Pin
Gerry Schmitz4-Jul-17 5:15
mveGerry Schmitz4-Jul-17 5:15 
GeneralRe: C# Serial port data read and write Pin
Member 132923109-Jul-17 0:46
Member 132923109-Jul-17 0:46 
AnswerRe: C# Serial port data read and write Pin
Bernhard Hiller4-Jul-17 21:38
Bernhard Hiller4-Jul-17 21:38 
GeneralRe: C# Serial port data read and write Pin
Member 132923109-Jul-17 0:47
Member 132923109-Jul-17 0:47 
Questionobject reference use else where : on application.run(new form1()) Pin
prog.sidra2-Jul-17 6:40
prog.sidra2-Jul-17 6:40 
my video/audio/text application give this exception specially when i allow video call.
project is tcp/ip base , allow video in picturebox by directx capture and for audio is NAudio.
butwhen i allow user to communicate with video also give above exception . i dont know why? plz help.

private void button_PuchVideo_Click(object sender, EventArgs e)
     {
         lblVCleint1.Visible = true;
         lblVCleint2.Visible = true;
         pictureBox.Visible = true;
         pictureBox_Remote.Visible = true;
         try
         {
             // Start Capturing

             if (capture != null)
             {
                 if (capture.PreviewWindow != panelVideo)
                 {
                     capture.PreviewWindow = panelVideo;
                 }
                 capture.FrameEvent2 += new Capture.HeFrame(CaptureDone);
                 capture.GrapImg();

                 PeerIP_TXT.Enabled = false;
                 button_PuchVideo.Enabled = false;
                // mnuDevices.Enabled = false;
                 //menuItem7.Enabled = false;
                 isSending = true;
             }


         }
         catch (Exception) { }
     }


     void server()
     {
         try
         {
             server_sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
             server_sock.Bind(new IPEndPoint(IPAddress.Any, 6000));
             //server_sock.Bind(epLocal);
             server_sock.Listen(-1);

             while (true)
             {
                 try
                 {
                     Socket new_socket = server_sock.Accept();
                     NetworkStream ns = new NetworkStream(new_socket);
                     pictureBox_Remote.Image = Image.FromStream(ns);
                     ns.Close();
                     new_socket.Close();
                 }
                 catch (Exception)
                 {
                 }
             }
         }
         catch (Exception) { }

     }
     void SendVideoBuffer(object bufferIn)
     {
         try
         {
             TcpClient tcp = new TcpClient(PeerIP_TXT.Text, 6000);
             NetworkStream ns = tcp.GetStream();
             Image buffer = (Image)bufferIn;
             lock(buffer)
             buffer.Save(ns, System.Drawing.Imaging.ImageFormat.Jpeg);
             ns.Close();
             tcp.Close();
         }
         catch (Exception) { }
     }



     bool isSending = false;
     private void CaptureDone(System.Drawing.Bitmap e)
     {
         try
         {
             this.pictureBox.Image = e;
             //MemoryStream ms = new MemoryStream();
             //pictureBox.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
             //byte[] buffer = ms.GetBuffer();
             if (isSending)
                 ThreadPool.QueueUserWorkItem(new WaitCallback(SendVideoBuffer), pictureBox.Image);
         }
         catch (Exception) { }
     }

AnswerRe: object reference use else where : on application.run(new form1()) Pin
Pete O'Hanlon2-Jul-17 7:12
mvePete O'Hanlon2-Jul-17 7:12 
AnswerRe: object reference use else where : on application.run(new form1()) Pin
Pete O'Hanlon2-Jul-17 22:42
mvePete O'Hanlon2-Jul-17 22:42 
QuestionCould not load file or assembly 'Newtonsoft.Json, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b9a188c8922137c6' Pin
jubayer1-Jul-17 23:33
jubayer1-Jul-17 23:33 
AnswerRe: Could not load file or assembly 'Newtonsoft.Json, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b9a188c8922137c6' Pin
Eddy Vluggen2-Jul-17 1:08
professionalEddy Vluggen2-Jul-17 1:08 
QuestionC# Color challenge Pin
BillWoodruff30-Jun-17 15:25
professionalBillWoodruff30-Jun-17 15:25 
AnswerRe: C# Color challenge Pin
Eddy Vluggen1-Jul-17 0:31
professionalEddy Vluggen1-Jul-17 0:31 
GeneralRe: C# Color challenge Pin
BillWoodruff2-Jul-17 14:53
professionalBillWoodruff2-Jul-17 14:53 
GeneralRe: C# Color challenge Pin
Eddy Vluggen3-Jul-17 23:30
professionalEddy Vluggen3-Jul-17 23:30 
GeneralRe: C# Color challenge Pin
harold aptroot2-Jul-17 2:34
harold aptroot2-Jul-17 2:34 
GeneralRe: C# Color challenge Pin
BillWoodruff2-Jul-17 14:35
professionalBillWoodruff2-Jul-17 14:35 
GeneralRe: C# Color challenge Pin
harold aptroot2-Jul-17 15:07
harold aptroot2-Jul-17 15:07 
GeneralRe: C# Color challenge Pin
BillWoodruff2-Jul-17 19:21
professionalBillWoodruff2-Jul-17 19:21 
GeneralRe: C# Color challenge Pin
Richard Deeming3-Jul-17 1:35
mveRichard Deeming3-Jul-17 1:35 
GeneralRe: C# Color challenge Pin
BillWoodruff3-Jul-17 2:51
professionalBillWoodruff3-Jul-17 2:51 
Questionprinting an string data. Pin
rahul199529-Jun-17 20:21
rahul199529-Jun-17 20:21 
AnswerRe: printing an string data. Pin
OriginalGriff29-Jun-17 20:34
mveOriginalGriff29-Jun-17 20:34 
AnswerRe: printing an string data. Pin
Richard MacCutchan29-Jun-17 21:36
mveRichard MacCutchan29-Jun-17 21:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.