handling managed representatives unmanaged code
i know i technically work nonetheless i'd exercise cleanest illusory solution. here's situation:
i have managed library wraps an unmanaged c-style library. c-style library functionality i'm now jacket does guess involving list strings. library's fan formula yield delegate, such during list processing, an "invalid" unfolding encountered, library callback fan around nominee grant select plan (throw an exception, reinstate unfair characters, etc.)
what i'd ideally have managed c++ removed function, following means removed duty takes wholly unmanaged parameters internal c++ unmanaged formula removed during point. providing callback apparatus unmanaged formula explanation adhering indicate me.
#pragma managed
public nominee twine invalidstringfilter(int linenumber, twine text);
...
public ilist<result> dolistprocessing(ilist<string> listtoprocess, invalidstringfilter filter)
{
// managed formula goes here, interpret parameters etc.
}
#pragma unmanaged
// should wholly duty indeed touches c-library directly
std::vector<nativeresult> processlist(std::vector<char*> list, ?? callback);
in snippet, i wish keep c-library opening within processlist, nonetheless during processing, need callbacks, callback presumption form invalidstringfilter nominee upheld fan managed library.
Comments
Post a Comment