[omniNotify] problem with inserting a struct/valuetype into an Any

Min Tjong min at vidient.com
Thu Sep 28 19:57:15 BST 2006


Hi,

 

I was wondering if anyone has had any success sending an Any containing
a struct or a valuetype on Win32?

I modified the function "sample_supply_any_fn" in
<NOTIFY_TOP>\examples\sample_functions.cc to insert a struct into the
Any as shown below:

 

CORBA::Boolean

sample_supply_any_fn (CORBA::Any& event,

                  const char* obj_name,

                  const CORBA::ULong event_num,

                  CORBA::Boolean verbose

                  )

{

  AttN::ChannelStats stat;

  stat.num_announcements = (CORBA::Long)20;

  stat.num_notifications = (CORBA::Long)35;

  event <<= stat;

 

  // event <<= event_num;

  if (verbose) cout << "Supplied event # " << event_num << endl;

  return 1; // OK

} 

 

When I ran any_push_supplier.exe, I got a window showing this error:

 

"The application failed to intialize properly (0xc0000005). Click on OK
to terminate the application."

 

If I ran it in the debugger, in addition to the above error, I would see
the following in the output console (omni.exe is my debug test program):

 

First-chance exception at 0x003caac0 (AttNotificationDynamic410_rt.dll)
in omni.exe: 0xC0000005: Access violation writing location 0x003c7578.

 

The same problem happened with valuetype as well.  I have also verified
that the OmniORB's anyExample (it sends a struct in an Any) works fine.

I am using OmniORB 4.1.0 and OmniNotify 2.1.  Any
ideas/suggestions/comments on this would be greatly appreciated.

 

Regards,

Min

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omninotify-list/attachments/20060928/87f3b58f/attachment.htm


More information about the omninotify-list mailing list