- Joined
- Jan 13, 2008
- Messages
- 2,302
- Reaction score
- 6
- Points
- 38
- Location
- Atlanta, GA, USA, North America
I've run into an interesting problem working with dialogs and Orbiter. Using the DeltaGlider's source as a guide, I'm getting a VESSEL3 pointer of a vessel, but it's not a valid vessel. Thanks to dbeachy1 finding the getHandle() function for me, I now have the OBJHANDLE. However, when I pass it to oapiIsVessel() it returns false. Unfortunately, the dialog is designed to alter a vessel as a scenario editor page. I'm currently using the same code the DeltaGlider sample project uses to get the VESSEL3*:
What do I need to do to ensure I get the right vessel?
Thanks,
Matt
Code:
BOOL CALLBACK EdPgProc (HWND hTab, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
VESSEL3 *ves = (uMsg == WM_INITDIALOG ? (VESSEL3*)lParam : (VESSEL3*)oapiGetDialogContext (hTab));
OBJHANDLE theves = ves->GetHandle();
if(oapiIsVessel(theves))
{
//does not enter
...
}
...
}
Thanks,
Matt