The thing is that I'm almost using the same project configuration (the /J switch, multithreaded static debug linking of the C libraries, etc) of the OpenGl12 Renderer DLL, which I compiled using my visual studio solution and it works fine.
What could be causing this error?
Also, when using CaWE (vc++ solution-generated too) everything works right too- but the option Tie to entity is not working. I mean, I just create a block brush, I select it, but when I try to tie it to an entity I get the message 'Nothing is selected that could be tied to an entity'. Here's the code:
Code: Select all
void MapDocumentT::OnToolsAssignPrimToEntity(wxCommandEvent& CE)
{
ToolT* NewEntityTool = m_ChildFrame->GetToolManager().GetTool(*GetToolTIM().FindTypeInfoByName("ToolNewEntityT"));
if (!NewEntityTool) return;
OptionsBar_NewEntityToolT* Bar=dynamic_cast<OptionsBar_NewEntityToolT*>(NewEntityTool->GetOptionsBar());
if (!Bar) return;
ArrayT<MapEntityT*> SelEntities; // All entities that are in the selection.
ArrayT<MapPrimitiveT*> SelPrimitives; // All primitives that are in the selection.
for (unsigned long SelNr=0; SelNr<m_Selection.Size(); SelNr++)
{
MapElementT* Elem=m_Selection[SelNr];
if (Elem->GetType()==&MapEntityT::TypeInfo)
{
SelEntities.PushBack(static_cast<MapEntityT*>(Elem));
}
else if (Elem->GetType()==&MapPrimitiveT::TypeInfo)
{
SelPrimitives.PushBack(static_cast<MapPrimitiveT*>(Elem));
}
}
// If there were no primitives among the selected map elements, quit here.
if (SelPrimitives.Size()==0)
{
wxMessageBox("Nothing is selected that could be tied to an entity.");
return;
}
....it continues
Code: Select all
Elem->GetType()==&MapPrimitiveT::TypeInfo
I checked the TypeInfos of MapBrushT, MapPrimitiveT and MapElementT and everything is ok. MapBrushT inherits from the MapPrimitiveT class which in turn inherits from MapElementT.
So, I'm pretty sure that Elem is a MapBrushT (got it using the debugger), but its GetType() it's not equal to &MapPrimitiveT::TypeInfo?.