C++ Question Sketchpad already exists for this surface

JMW

Aspiring Addon Developer
Joined
Aug 5, 2008
Messages
670
Reaction score
89
Points
43
Location
Happy Wherever
Hi All,

A shot in the dark that someone may have had this already,

I'm getting a ctd with this error in orbiter log

"000089.707: D3D9ERROR: Sketchpad already exists for this surface"

It's specifically in VC mode when HUD is removed [H] and attempted to restore (D3D9Client only)


1738940312694.png
 
Most likely an oapiGetSketchpad without a matching oapiReleaseSketchpad. What vessel are you using?
 
Most likely an oapiGetSketchpad without a matching oapiReleaseSketchpad. What vessel are you using?
Hi Gondos,
It's my F-35B plane.
Comes with this in 2016 with D3D9 4.26

1738972652763.png
 
OK so you have the source code. Enabling/disabling the HUD should trigger a call to clbkHUDMode.
Do you call oapiGetSketchpad somewhere in the vicinity?
 
Tried to reproduce this on the ShuttleA/ShuttlePB/DG but no luck so far. You confirm it's only with your vessel that it happens?
Without a proper backtrace to identify where it's trying to get the sketchpad, it's gonna be tricky.
Don't know how your code is made but if there is no way to use a debugger I'd start by removing clbkxxx methods to identify which one leads to the crash.
 
  • Like
Reactions: JMW
Tried to reproduce this on the ShuttleA/ShuttlePB/DG but no luck so far. You confirm it's only with your vessel that it happens?
Without a proper backtrace to identify where it's trying to get the sketchpad, it's gonna be tricky.
Don't know how your code is made but if there is no way to use a debugger I'd start by removing clbkxxx methods to identify which one leads to the crash.
This happened after creating the SR71r and changing focus to it. (might be eroneous)
1739021686800.png

After creating SR71r again (from DG-S) and setting initial focus to it.

1739021962138.png

Anyways, I'll start sifting thro' the clbk's


I'm getting this from Norton -- causing or resulting from??
I've tried "excluding" it, but still blocking...

1739025075572.png
 
Last edited:
Hi Gondos,

Have prevented ctd by removing this from clbkDrawHUD and moving to a keypress function.
"if (oapiGetHUDMode() == HUD_ORBIT) oapiSetHUDMode (HUD_SURFACE);"

Thanks for the pointers :cheers:
 
Yes, it's not really documented but oapiSetHUDMode ultimately recreates a HUD object that calls clbkGetSketchpad in its constructor.
Maybe you can move it to clbkPostStep if you want to lock the HUD mode.
 
  • Like
Reactions: JMW
oapiSetHUDMode ultimately recreates a HUD object that calls clbkGetSketchpad in its constructor.
That explains it.
Maybe you can move it to clbkPostStep if you want to lock the HUD mode.
Want it to lock only on a key press so works fine where it is.
Thankee.
 
Back
Top