Map events OnDrawBackBufferEvent return (int backBuffer) in 64-bit

Hello,

My application is a 64-bit C# desktop application using Visual studio 2019. I installed the 64-bit MapWinGis and use 32-bit MapWinGis to register OCX. I turn on “SendOnDrawBackBuffer” and “SendMouseUp” so I get Map events OnDrawBackBufferEvent fired, however, the event argument returns an integer e.backBuffer. Should it be a long in 64-bit version? The same issue in Image.SetImageBitsDC(int) , etc. So, how shall I solve this problem?

Another question is how to get Map event this.axMap1.OnDrawBackBuffer2 fired?

Your help will be very much appreciated,
Peter

Hello @petery, and welcome.

A 64-bit build allows you to take advantage of, and live within, a 64-bit memory space. However:

  1. Even 64-bit applications will use 32-bit handles, for compatibility. See documentation here.

  2. Being a COM interface, with the parameter defined as VT_I4, the interface remains consistent even in a 64-bit build.

  3. Regarding OnDrawBackBuffer2, checking the code, it looks like if the following bit is set:

    (AxMap.CustomDrawingFlags & tkCustomDrawingFlags.OnDrawBackBufferHdc)

    you will get the OnDrawBackBuffer event, but if instead, the following bit is set:

    (AxMap.CustomDrawingFlags & tkCustomDrawingFlags.OnDrawBackBufferBitmapData)

    then you will get the OnDrawBackBuffer2 event

Hope that helps.

Regards,
Jerry.

Hi Jerry,

Thank you very much for the reply. I just truncate 64-bit handle to 32-bit and it works well.
Appreciated!!!
Regards,
Peter