[omniORB] DLLified echo example

Gavin Uttley guttley at iess.co.uk
Mon May 23 12:45:27 BST 2005


Hi,

As per my previous post im looking to do alot of the functionality i 
require in delphi, however i need to transfer data between C++ and 
delphi via a dll.
To get used to how it all works with omni im have transfered the code 
from the echo example using a remote servant.

I can use this almost fine, however i have a small problem with the 
return from a function, the code is as follows.

/*---------------------------------------------------------------------------*/
char* Hello(CORBA::Object_ptr obj, CORBA::String_var src)
{
    Echo_ptr e = Echo::_narrow(obj);

    if( CORBA::is_nil(e) ) {
        errLog << "hello: The object reference is nil!\n" << endl;
        return "";
    }

    CORBA::String_var dest = e->echoString(src);

    return (char*)dest;
}
/*---------------------------------------------------------------------------*/


As you can see this is pretty much the same as the example with the 
addition of what to echo and the return from the servant.
I can call the servant just fine and it returns the expected result, 
however as soon as i jump off the "return (char*)dest"
I get a "user break point called from 0x<memory address>" when i run it 
outside the debugger i get debug assertion failed
error with the expression _CrtIsValidHeapPointer(pUserData).
The problem seems to be with the line that calls the servant, if i 
comment this line out it returns fine.

any ideas?

gav.


This message has been sent from Initial Electronic Security Systems Ltd.

Initial Electronic Security Systems
Shadsworth Road
Blackburn
BB1 2PR
United Kingdom
Tel +44(0) 1254 688688

This e-mail message and any attachments are confidential
and are intended for the use of the addressee only. If you 
are not the addressee you should not copy or use them for 
any purpose, nor disclose their contents to anyone else. 
If you believe you have received this e-mail by mistake please 
notify us immediately by telephoning +44 (0) 1254 688688.
_____________________________________________________________________
This message has been checked for all known viruses by the MessageLabs Virus Scanning Service.



More information about the omniORB-list mailing list