>NotesInfo mytest(char *fHMM, char *fWaveUserQuery)
>{
[quoted text clipped - 11 lines]
> return *Score;
>}
This doesn't return an array, it returns a single NotesInfo instance.
Plus it leaks memory since you don't have any way of releasing the
array memory after the function returns.
I suggest you rewrite it to return the array via output parameters.
Mattias

Signature
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
lov4mu6@gmail.com - 16 Sep 2006 21:09 GMT
Thank you! Would you possibly give an example of how that would be
done?
Vlad.
> >NotesInfo mytest(char *fHMM, char *fWaveUserQuery)
> >{
[quoted text clipped - 24 lines]
> http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> Please reply only to the newsgroup.
Mattias Sjögren - 25 Sep 2006 21:01 GMT
>Thank you! Would you possibly give an example of how that would be
>done?
Something like this
bool mytest(NotesInfo *Score, unsigned int count)
{
if (!Score || count < 2) return false;
Score[0].StartTime = 0;
Score[0].EndTime = 1;
Score[0].Note = 60;
Score[1].StartTime = 2;
Score[1].EndTime = 3;
Score[1].Note = 70;
return true;
Mattias

Signature
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.