question

Upvotes
Accepted
25 0 1 5

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-sdkrrtema-apielektron-message-apierrorcontainer
icon clock
10 |1500

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

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 5.0 MiB each and 10.0 MiB total.

Upvotes
38.1k 71 35 53

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 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea