[CE U12 C# and C++] ElementScanCriteria -> MdlScanCriteriaP() return Value seems to be without reason.

Hello :-)

In V8 it works fine to use MdlScanCriteriaP() and to call mdlScanCriteria_setXAttributeTest(), since there seems no fitting method published in ElementScanCriteria.

In CE the code will lead directly to an exception.

BCOM.ElementScanCriteria scanCri = new BCOM.ElementScanCriteriaClass();
int nTest = scanCri.MdlScanCriteriaP();
Int64 nTest64 = scanCri.MdlScanCriteriaP();

During the debugging I got always something like: 0xfffffffff44c9d50 == -196305584 == scanCri.MdlScanCriteriaP(). A strange thing for a pointer to start with 0xf….

If I go further and try any mdlScanCriteria_...() function I got exceptions like: “Exception thrown at 0x00007FFF4FA90BE0 (DgnPlatform5.dll) in microstation.exe: 0xC0000005: Access violation writing location 0xFFFFFFFFF44C9D5C.”, which is no surprise with such a strange pointer.

So, there are 3 Questions:
1. Is it "just" a bug inside the SDK?
2. Do I need some C#-voodoo bevor I can pass this pointer to native?
3. Is there a way to set XAttribute Test direct in C#, so there is no need to call MdlScanCriteriaP()?

Thanks a Lot.