Discussion:
[omniORB] cannot convert from 'list_var *__w64 ' to 'list *
Dalecki, Janusz
2013-03-04 23:06:18 UTC
Permalink
Hi,
I am using omniORB 4.1.2 in C++ code that I develop using Visual Studio 2005. I am developing a C++ service with CORBA interface on 64 bit Windows 7 version. I would like the app to be 32 bit version though. My pre-processor variables are:
WIN32
_DEBUG
__NT__
__WIN32__
__x86__
_WIN32_WINNT=0x0400
__OSVERSION__=4

I have right now very simple idl (attached).
When I wrote my first method to return the list of string:
lcc::ProtocolDataList* TugunSituationListener::getSupportedProtocols()
{

lcc::ProtocolDataList_var list = new lcc::ProtocolDataList();
list->length(1);
list[0].eventType = lcc::ProtocolTypeEnum::RS232C;
list[0].displayname = "RS232C";
return &list;
}
I am getting this error:
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?
Any help appreciated.
Regards,
Janusz


________________________________

This e-mail contains privileged and confidential information intended for the use of the addressees named above. If you are not the intended recipient of this e-mail, you are hereby notified that you must not disseminate, copy or take any action in respect of any information contained in it. If you have received this e-mail in error, please notify the sender immediately by e-mail and immediately destroy this e-mail and its attachments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20130304/28b26129/attachment.html>
Luke Deller
2013-03-04 23:37:34 UTC
Permalink
Hi Janusz,
Post by Dalecki, Janusz
lcc::ProtocolDataList* TugunSituationListener::getSupportedProtocols()
{
lcc::ProtocolDataList_var list = new lcc::ProtocolDataList();
...
Post by Dalecki, Janusz
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
Post by Dalecki, Janusz
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.
**********************************************************************************************
Loading...