Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

RE: mdlMeasure_elmDscrArea : is this changed in connect version

$
0
0

[quote user="djeten"]cExpression = "mdlMeasure_elmDscrArea(" & VarPtr(area) & "," & VarPtr(perimeter) & "," & desc & ")"[/quote]

What could be happening is that the pointers are wrong.  VarPtr is an undocumented function in VBA (it's undocumented because Microsoft doesn't want to become involved in discussions like this).  It converts a VBA variable into a C address-of variable.  The problem you've encountered is that V8i is 32-bit whereas CONNECT is 64-bit.  In CONNECT, the MDL functions want 64-bit addresses.

Try changing VarPtr to LongPtr for CONNECT...

cExpression = "mdlMeasure_elmDscrArea(" & LongPtr(area) & "," & LongPtr(perimeter) & "," & desc & ")"

Having said that, I think Jan's suggestion to declare the MDL function and use it directly is better than burying it inside a C expression.


Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>