Skip to main content
amitkinor
Participant
February 26, 2012
Answered

NE for Windows caches data from previous call.

  • February 26, 2012
  • 2 replies
  • 680 views

Hi all,I am experiencing a very strange problem.I wrote a native extenion in C++ .This extension wrapps another C++ class which performs some math operation.THe extension itself

gets std vectors of result from that math class and I convert them to AS3 Vector.<Vector<Vector3D>>   2 dimensional vector and return it to flash .

THe problem is that on first call the returned vector contains the correct data.

But on the next call (just after the first one) when I pass a new data for the extension to return another set of new data what is happening that it return a vector with both the old and new data.

Inside the DLL I clean everything including vectors and deallocating all the pointer.Still nothing helps.It is as if the DLL just keeps the old data inside itself.

Any help will be greatly appreciated!

This topic has been closed for replies.
Correct answer amitkinor

Ok ,first thanks to the  Adobe for their "wonderful" support .Adobe -your forum support SUCKS !  Second ,Adobe ,you guys should make better docs on NE development. The current PDF manul is aweful. And eventually I solved my problem by myself. For the curoius ones-

make sure in C++ DLL source you wrap all the NE API callable methods with extern "C"  . __declspec(dllexport) is not enough .

2 replies

amitkinor
amitkinorAuthorCorrect answer
Participant
February 28, 2012

Ok ,first thanks to the  Adobe for their "wonderful" support .Adobe -your forum support SUCKS !  Second ,Adobe ,you guys should make better docs on NE development. The current PDF manul is aweful. And eventually I solved my problem by myself. For the curoius ones-

make sure in C++ DLL source you wrap all the NE API callable methods with extern "C"  . __declspec(dllexport) is not enough .

chris.campbell
Legend
February 29, 2012

Glad to hear you figured this out.  Your original post was on a Sunday so the likelyhood of an Adobe response that day was very slim.  I'll let the docs people know that you'd like to see better documentation.  Is there anything in particular you found misleading or missing?

Chris

amitkinor
amitkinorAuthor
Participant
February 29, 2012

Hi Chris.Well sorry for that ,I live in Israel.So here the first day of the week is Sunday    .  Look the current .PDF doc gives only the overall API archtecture explanation and describes its core methods and variables in a really brief way.

And for many developers that is a real problem.Most of us here are not seasoned C++ developer. While I have been coding C++ occasionaly ,I got stuck here because in fact I have never wrote C++ DLLs which are wrapped with C.Only after reading many posts in StackOverflow.com about setting up C++ to C sources and also digging into the sources of the NE apps you have at one of Adobe pages I managed to figure out the problem.But many other dev could just have faild on it if they had very little or no C++ coding experience. So I suggest you to add some practical examples to that doc and put a better description on how C++ sources should be integrated with NE C API .

Thanks.

amitkinor
amitkinorAuthor
Participant
February 27, 2012

Not even a single comment?  I address it to Adobe guys : I just wrote the same dll but without implementing AIR NE C API .Running it in VS environment works like a charm. Can it be related to all those fata types of C API I work with to

convert C++ to AS3 data? Fore example the vector I return back to the AS3 is 2 dimensional  : Vector.<Vector<int>>  . Is it supported in the API ? because I have seen so far only  demos of single arays or vectors 

Thanks .