question

Upvotes
Accepted
25 2 5 6

access violation when reading from a container

I'm trying to test the code from example with a small addition (map.toString()):

try {
	FieldList fieldList;
	Map map;
	fieldList.addUInt( 1, 64 )
		.addReal( 6, 11, OmmReal::ExponentNeg2Enum )
		.addDate( 16, 1999, 11, 7 )
		.addTime( 18, 02, 03, 04, 005 )
		.complete();
	map.addKeyAscii( "entry_1", MapEntry::AddEnum, fieldList );
	map.complete();
	const auto& res = map.toString();
} catch ( const OmmException& excp  ) {
	cout << excp << endl;
}

map.toString() - results in the access violation. What im doing wrong?

elektronrefinitiv-realtimeelektron-sdkema-apirrtelektron-message-apierrorcontainer
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hello @dmitry.kozhevnikov,

Thank you for your participation in the forum.

Is the reply below satisfactory in answering your question? If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

-AHS

Upvotes
Accepted
7.6k 15 6 9

@dmitry.kozhevnikov

From my understanding, currently, EMA C++ does not support immediately retrieving data from freshly created OMM containers or messages. It comes from the note in EMA Developer Guide section 3.2.3 Data Class.

In the old version of EMA, it causes the Access Violation crash when you try to call .toString from the EMA object. But as far as I remember the behavior has been changed to return some message instead of crashing.

I have tested the codes with ESDK 1.3 and found that it will return the following message instead. "Decoding of just encoded object in the same application is not supported"

-What version of EMA C++ you currently use? Is this from ESDK 1.3?

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
79.1k 250 52 74

It is a known issue fixed in EMA C++ 3.2.1.L1 (ESDK C++/C Release 1.2.1.L1).

EMA C++ 3.2.1.L1 Issues Resolved
--------------------------------

[ESDK-1595] Calling toString on a newly created message throws Access Violation Exception [Case Number: 06484891]

EMA C++ 3.2.1.L1 or above will return "Decoding of just encoded object in the same application is not supported" instead.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.