It is true that you get an exception when you try to convert the data in the buffer to a structure of a different type than what CONAFileSystem.CONAFindNextFolder originally created.
You are trying to force a data structure of type CONADefinitions.CONAPI_FOLDER_INFO into a structure of type CONADefinitions.CONAPI_FOLDER_INFO2. They almost certainly have different lengths and so on, so it is highly unlikely that this method will work.
From the experience of developing C ++ on Symbian OS, the Nokia model is likely to be used here, where they subsequently developed a new version of the API and therefore created a newer version of the CONADefinitions.CONAPI_FOLDER_INFO structure (i.e. CONADefinitions.CONAPI_FOLDER_INFO2).
Assuming this is correct, there are three probabilities:
1) The enum parameter for the first function determines which version of the output structure should be created.
2) There is a new function that returns a new structure, for example. CONAFileSystem.CONAFindFirstFolder2, CONAFileSystem.CONAFindNextFolder2
3) Nokia has developed a new version, but has not yet published it publicly.
source share