locked
datawriter

    Question

  •  

    streamSocket^ socket =   ref new StreamSocket();

    IOutputStream^ senddata = socket->OutputStream;

    DataWriter ^ writer_ =  ref new DataWriter(senddata);

    DataWriterStoreOperation^ store_data = nullptr;

    store_data = writer->StoreAsync(); 

    when I reconnect the server.

    the program run here "store_data = writer->StoreAsync();  "

    it will thrown execption like this ,if I click continued ,the program will be going ,this problem can be solved?

    First-chance exception at 0x758EE54E in me_test.exe: Microsoft C++ exception: Platform::COMException ^ at memory location 0x0545B170. HRESULT:0x8000000E

    If there is a handler for this exception, the program may be safely continued.

     

    Monday, May 07, 2012 6:22 AM

Answers

  • I am so sorry about it. Now I found it root cause. when I reconnect the server. I don't verify the connectasync() had completed. so if I send data use the now streamsocket, it will thrown exception. I had fixed it.

    thanks for you help Rob

    • Marked as answer by oishixixi Tuesday, May 08, 2012 6:54 AM
    Tuesday, May 08, 2012 6:54 AM

All replies

  • This is a first chance exception and may be expected and handled. If it occurred inside of a call you made and didn't get raised up to your code and if everything worked then you can probably ignore it.

    0x8000000E is E_UNEXPECTED, but without knowing where exactly that occurred I can't guess if it is benign or problematic.

    --Rob

    Tuesday, May 08, 2012 3:33 AM
    Owner
  • I am so sorry about it. Now I found it root cause. when I reconnect the server. I don't verify the connectasync() had completed. so if I send data use the now streamsocket, it will thrown exception. I had fixed it.

    thanks for you help Rob

    • Marked as answer by oishixixi Tuesday, May 08, 2012 6:54 AM
    Tuesday, May 08, 2012 6:54 AM