[omniORB] cannot convert from 'list_var *__w64 ' to 'list *

Luke Deller ldeller at iress.com.au
Mon Mar 4 23:37:34 GMT 2013


Hi Janusz,

> lcc::ProtocolDataList* TugunSituationListener::getSupportedProtocols()
> {
>     lcc::ProtocolDataList_var list = new lcc::ProtocolDataList();
...
>     return &list;

The return type of this function should be lcc::ProtocolDataList_ptr rather than lcc::ProtocolDataList*
Also the return statement should be:
    return list._retn();

For documentation about how to do this right, see the C++ language mapping for CORBA IDL.  The language mappings are available here:
http://www.omg.org/technology/documents/idl2x_spec_catalog.htm

> Error      2              error C2440: 'return' : cannot convert from 'lcc::ProtocolDataList_var *__w64 ' to 'lcc::ProtocolDataList *'
> I don't understand this, why omniORB is trying to use 64 bit version for pointer?

This "__w64" modifier is not saying what you think - it merely indicates that the size of this ProtoclDataList_var type is 32-bits when compiled as 32-bit, and the size is 64-bits when compiled as 64-bit.  This is used by the /Wp64 compiler option to help detect 64-bit portability issues.

http://msdn.microsoft.com/en-us/library/yt4xw8fh(v=vs.80).aspx

Regards,
Luke.
**********************************************************************************************
Important Note
This email (including any attachments) contains information which is confidential and may be subject to legal privilege.  If you are not the intended recipient you must not use, distribute or copy this email.  If you have received this email in error please notify the
sender immediately and delete this email. Any views expressed in this email are not necessarily the views of IRESS Limited.

It is the duty of the recipient to virus scan and otherwise test the information provided before loading onto any computer system.
IRESS Limited does not warrant that the information is free of a virus or any other defect or error.
**********************************************************************************************




More information about the omniORB-list mailing list