none
AsyncCallback RRS feed

  • Question

  • I can't get this to work

    voidcrawlForInformation() {

    String^ fileName =

    "http://en.wikipedia.org/wiki/Law_of_cosines";

    String^ url =

    "http://en.wikipedia.org/wiki/Law_of_cosines";

    String^ query =

    "http://en.wikipedia.org/wiki/Law_of_cosines";

    System::Web::

    HttpRequest^ httpStream =

    gcnewSystem::Web::HttpRequest(fileName, url, query);

    System::IO::

    Stream^ stream =

    httpStream->GetBufferlessInputStream();

    // array<unsigned char^> buffer


    // int System32


    // int count


    // System::AsyncCallback callback


    // Type System::Object


    array<unsignedchar^, 1> *arrayList = newarray<unsignedchar^, 1>();

    // IntelliSense: a delegate type is not allowed here      on AsyncCallback

    // IntelliSense: identifier "MyTaskIsCallback" is undefined    

    AsyncCallbackwebSearch = gcnewAsyncCallback(MyTaskIsCallback);

    stream->BeginRead(arrayList, 0, 4294967296.0f, webSearch, stream);

    // IntelliSense: function "System::IO::Stream::BeginRead" cannot be called with the given argument list
    //            argument types are: (std::array<System::Byte ^, 1U> *, int, float, <error-type>, // System::IO::Stream ^)
    //            object type is: System::IO::Stream ^

    }

    // The delegate must have the same signature as the method


    // it will call asynchronously.


    publicvoidMyTaskIsCaller(IAsyncResultresult) {

    // IAsynResult - IntelliSense: a parameter cannot have a C++/CLI interface class type

    }

    };

    with errors :

     6 IntelliSense: identifier "MyTaskIsCallback" is undefined                                                                    IntelliSense: a delegate type is not allowed here                                                               9 IntelliSense: a parameter cannot have a C++/CLI interface class type
     7 IntelliSense: function "System::IO::Stream::BeginRead" cannot be called with the given argument list
                argument types are: (std::array<System::Byte ^, 1U> *, int, float, <error-type>, System::IO::Stream ^)
                object type is: System::IO::Stream ^


    • Edited by sub0000 Friday, September 12, 2014 1:44 PM
    Friday, September 12, 2014 2:51 AM