Dear Olaf,

I added a button to the ExternalControl activex control and added button1 control as follows:
Private Sub Command1_Click()
Dim hUser32 As Long
hUser32 = GetModuleHandle(StrPtr("user32"))
MsgBox "in button1"
End Sub

When I call from AxThreading exe and click on button1 of activex control the declared api GetModuleHandle works
like a charm without crash even if we don't use RemoveLastDllError module function.Very nice example.Thank you olaf,

regards,
JSVenu