Okay, here's my problem:
I wanted to move some of Ultima's dialogs into a VC++ DLL, b'cause of better data type check and etc. However, I wanted to call the dialog via DoModal() and *BANG* - it crashed...

I've been debugging the dll and I've found out that it has got to do with the dialogs parent window. Well, if you call a Dialog via DoModal() in a C++ app, then it has it parent window - the mainframe.
However, if you call it from a DLL, I will have to specify the parent window manually, but how??
Okay, here's the code I used:
I've got a Dialog and its Class CDiaVert. The window will be created by a global function called DiaAddVertex by Ultima:
// Add New Vertex Dialog Function
int APIENTRY DiaAddVertex(int *iNumVertex, ff7_vertex *pVertex, ff7_color *pColor)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
CDiaVert VertDia;
VertDia.SetData( iNumVertex, pVertex, pColor);
if(VertDia.DoModal() != IDOK)
{
return -1;
}
else
{
VertDia.GetData(iNumVertex, pVertex, pColor);
return 0;
}
}
Okay, passing Ultima's main window handle to the DLL should be no problem, but how do I tell the DoModal()-Function to use this handle??
- Alhexx