News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Add To Listbox From Another Thread (SOLVED)

Started by Max_Power, June 04, 2007, 10:58:11 PM

Previous topic - Next topic

Max_Power

The problem was actually because I was accidentally corrupting memory.

Greetings,

I have a bit of a problem if someone can help me out. I have a program that uses plugins, and the engine program (that runs the plugins) exposes an API to the plugins to make programming said plugins easier. The function I am having problems with is this one:


EnginePostString proc pszStatusMessage:DWORD
invoke SendDlgItemMessage,hStatusTab,IDC_LSTSTATUS,LB_ADDSTRING,0,pszStatusMessage
invoke SendDlgItemMessage,hStatusTab,IDC_LSTSTATUS,LB_SETCURSEL,eax,0
invoke SendDlgItemMessage,hStatusTab,IDC_LSTSTATUS,LB_SETHORIZONTALEXTENT ,400,0

ret
EnginePostString endp


It posts a message to a listbox on the engine's UI that displays the status of the plugin. The problem is that the plugins have a function that the engine creates a new thread to call (so the function is executing on a seperate thread). When this threaded function calls EnginePostString the string is properly posted, but the thread terminates, and it shouldn't.

Any ideas or more information needed?

Thanks,

Max_Power

P1

The problem is outside the posted code.

Regards,  P1   :8)