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.
Volker Hüfner said:Do I need some C#-voodoo
I can't answer your question, but while researching it I came across this vodoo...
ElementScanCriteria:zzRestricted28
Volker Hüfner said:Int64 nTest64 = scanCri.MdlScanCriteriaP(); During the debugging I got always something like: 0xfffffffff44c9d50
Pointers are unsigned (where would a negative pointer point?). Does this improve your debugging?
UInt64 nTest64 = ...
Regards, Jon Summers LA Solutions
Hello Jon,
I agree, pointers are unsigned. and I would have expected UInt64 from MdlScanCriteriaP(). But it returns int :-O That's why I have posted this sample with int and Int64.
Converting to unsigned did not change the value to something more useful. I do not have that much memory on my Computer to be addressed by this pointer.
Mit freundlichen Grüßen / Best regards Volker Hüfner
| AB_DATE Engineering Software | ab-date.de |