Я пытаюсь загрузить сборку C # методом _AppDomainPtr
Load_3
.У вас есть какой-то пример, поскольку я получаю ошибку: hr = 0x80131533 : A mismatch has occurred between the runtime type of the array and the sub type recorded in the metadata.
Вот фрагмент кода, как загрузить сборку:
static void binarray(SAFEARRAY** output, const char* data, size_t size)
{
SAFEARRAYBOUND Bound;
Bound.lLbound = 0;
Bound.cElements = size;
*output = SafeArrayCreate(VT_R8, 1, &Bound);
double HUGEP *pdFreq;
HRESULT hr = SafeArrayAccessData(*output, (void HUGEP* FAR*)&pdFreq);
if (SUCCEEDED(hr))
{
// copy sample values from data[] to this safearray
for (DWORD i = 0; i < size; i++)
{
*pdFreq++ = data[i];
}
SafeArrayUnaccessData(*output);
}
}
И вызов:
hr = spDefaultAppDomain->Load_3(output, &spAssembly);
Кто-нибудь использовал это?