Windows2000 C-API conenction callback, publish crash

Hi there, I need help on the foolowing issue: I am just need to publish event to the 5.0 server and I am using windows 2000 C API in an MFC application and testing in debug mode. I have two problems:

a) the connection callback doesn’t seem working when disconnected from server. the callback only get triggered when try another publish. I used awThreadedCallbacks(1) after a successful BrokerClient is created. when the callback get called, which thread is it in? and in MFC app, what type of thread is it? another question, among connect/disconnect calls, how do I use awThreadedCallbacks(1|0)? the doc doesn’t give much help.

b) after disconnected from server, the awPublishEvent() crashes after the callback is called. this looks like a bug because it detects the broken connection but still try to publish (from call stack). it seems this crash happens only in debug mode not in the release mode. but still this is annoying.

here are the calls I used:

. awNewOrReconnectBrokerClient
. awRegisterClientConnectionCallback
. awThreadedCallbacks(1)

. awPublishEvent - ok

disconnected from server
no callback response
try awPublishEvent
callback called and returned
crash! the call stack shows:
TDESK! aweCheckAndSetField line 6500 + 9 bytes
TDESK! awSetStringField line 1030 + 21 bytes
TDESK! awSetErrorString line 341 + 20 bytes
TDESK! awPublishEvent line 1397 + 27 bytes

– jay