Reading from Navision passed IStream in c++

[Deleted User][Deleted User] Posts: 0
I created a new ATL COM project in Visual C++ 6.0. I added a method to my class which receives the instream from Navision. Below is the code:

STDMETHODIMP myclass::readIns(IStream* s)
{
    unsigned char buffer[1024];

    s->Read(buffer, 1024, NULL);
}

When I call the method from Navision, Navision simply crashes.

I'm not sure if this is the proper way to implement passing instreams from Navision to automation and then reading them. If it isn't I'd be glad to hear how to do it right.

Also, since I'm quite new to cpp, any ideas on how to debug this or where to find useful examples would be most appreciated. Thanks.
Sign In or Register to comment.