Skip to main content
jochens5907408
Known Participant
July 30, 2016
Question

Wrong parametrisation of StreamUtil-method calls

  • July 30, 2016
  • 1 reply
  • 789 views

I use the xmlcatalghandler sample within my plug-in tp load and parse some kind of order specific configration XML at CS2.

So fare I get permanetly an empty readstream back from StreamUtil::CreateFileStream(catalogName);

I've seem that the method is declared and implmented in the following way:

IPMStream *CreateFileStream(ClassID clsID, const IDFile& sysFile, uint32 mode , OSType fileType , OSType creator)

An overloading method, only with the IDFile paramemeter, can't be found.

This discrepantion I've recogniced also at CS5.5.

So I need hepl to fix that error eighter by:

a) send my the implementation for an overloading one parameter method

b) let me know how the values, to be passes as 2.-4.th parameter to nearly all the methods of StreamUtil. and wher to get them from

This topic has been closed for replies.

1 reply

Legend
July 30, 2016

Revisit the header, not the implementation.

The declaration has default parameters.

jochens5907408
Known Participant
August 23, 2016

Hi Dirk,

obiusly the method StreamUtil::CreateFileStreamRead has default parameters.

At StreamUtil.h is mentioned even a sample call

Example Code:

<pre>

   InterfacePtr<IPMStream> s(StreamUtil::CreateFileStreamRead(myFile));
   if (s)    {
   // read from file
   }
   else {
  

// handle error

</pre>

But the Function is never reached. I've implemented a CAlert at that function.

Even when I send all the parameters (values from StreamUtil.h and IPMStream.h,

the test : if (!readStream) {

} is entered.

I can't incorporate StreamUtil.cpp into my project. The compilation throws errors.

What's to do to get StreamUtl usable at my plug-in?

Regards

Jochen Seliger

Legend
August 23, 2016

There is no need to add StreamUtil.cpp, it already comes with some library.

Before your failing call to StreamUtil, please check your file - e.g. if( !myFile.Exists() ) throw "oops!";