IWIDGET_SetText for mod1/dll1? | developer.brewmp.com IWIDGET_SetText for mod1/dll1? | developer.brewmp.com

Developer

IWIDGET_SetText for mod1/dll1?

Forums:

In mod1/dll1 mode, we can't use IWIDGET_SetText.

I want to create an Static Widget and set text on it but I can't get any substitute of IWIDGET_SetText.

Error like this: unresolved external symbol _AEEMod_Load referenced in function "int __cdecl IWIDGET_SetText(struct IWidget *,unsigned short const *,unsigned char)" (?IWIDGET_SetText@@YAHPAUIWidget@@PBGE@Z)

How I can solve this issue?

I found we can't get the text model out of the Static widget.
This function inside of WIDGET_SetText returns pitm as NULL.
IWidget_GetModel(pMe->piwTitle, AEEIID_ITextModel, (IModel**)(void*)&pitm);
When it comes to TextWidget, there is no problem.

I found we can't get the text model out of the Static widget.
This function inside of WIDGET_SetText returns pitm as NULL.
IWidget_GetModel(pMe->piwTitle, AEEIID_ITextModel, (IModel**)(void*)&pitm);
When it comes to TextWidget, there is no problem.

The default model on a static widget is a value model. The default model on a text widget is a text model.
If you didn't set a text model on the static widget, you can't get a text model from it. You can try one of the following:
1. getting AEEIID_IValueModel instead
2. create a text model, set text on it, and then set the model on the static widget.
IShell_CreateInstance(pMe->piShell, AEECLSID_CTextModel, (void **)&pitm);
ITextModel_SetSel(pitm, 0, -1);
ITextModel_ReplaceSel(pitm, pwText, -1);
nErr = IWidget_SetModel(pMe->piwText, CAST(IModel *, pitm));

The default model on a static widget is a value model. The default model on a text widget is a text model.
If you didn't set a text model on the static widget, you can't get a text model from it. You can try one of the following:
1. getting AEEIID_IValueModel instead
2. create a text model, set text on it, and then set the model on the static widget.
IShell_CreateInstance(pMe->piShell, AEECLSID_CTextModel, (void **)&pitm);
ITextModel_SetSel(pitm, 0, -1);
ITextModel_ReplaceSel(pitm, pwText, -1);
nErr = IWidget_SetModel(pMe->piwText, CAST(IModel *, pitm));