Click here to Skip to main content
15,920,031 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: IJW or P/Invoke Pin
Nish Nishant16-May-02 17:18
sitebuilderNish Nishant16-May-02 17:18 
GeneralRe: IJW or P/Invoke Pin
Rama Krishna Vavilala16-May-02 17:19
Rama Krishna Vavilala16-May-02 17:19 
GeneralRe: IJW or P/Invoke Pin
Nish Nishant16-May-02 17:29
sitebuilderNish Nishant16-May-02 17:29 
GeneralRe: IJW or P/Invoke Pin
Madhu _Cheriyedath17-May-02 4:21
Madhu _Cheriyedath17-May-02 4:21 
GeneralRe: IJW or P/Invoke Pin
Nish Nishant17-May-02 16:15
sitebuilderNish Nishant17-May-02 16:15 
QuestionHow to call C# public function from inside Managed C++ Pin
Albert Pascual14-May-02 8:57
sitebuilderAlbert Pascual14-May-02 8:57 
AnswerFixed! Re: How to call C# public function from inside Managed C++ Pin
Albert Pascual14-May-02 10:58
sitebuilderAlbert Pascual14-May-02 10:58 
General.NET via unmanaged C++ COM Pin
13-May-02 11:02
suss13-May-02 11:02 
I have the following method that instantiates a specified class in a given .NET assembley with specified activation attributes.

HRESULT LoadCORClassEx(
BSTR AssemblyName, /* mscorlib */
BSTR typeName, /* System.Text.RegularExpressions.Regex */
REFIID riid,
void **ppv,
SAFEARRAY *args)
{
HRESULT hr = S_OK;
if(ppv == NULL) return E_POINTER;
*ppv = 0;

/*** debug ***/
VARIANT var;
HRESULT hresult;
long ix = 0;

VariantInit(&var);
hresult = SafeArrayGetElement( args, &ix, &var);
if(FAILED(hresult)) return hresult;
/*** end debug ***/

CComPtr<_ObjectHandle> spHandle;
spHandle.p = g_host.spDefaultAppDomain->CreateInstance_2(
AssemblyName,
typeName,
args);

CComVariant unwrapped;
unwrapped = spHandle->Unwrap();
if (unwrapped.vt != VT_UNKNOWN && unwrapped.vt != VT_DISPATCH)
return E_UNEXPECTED;

return unwrapped.punkVal->QueryInterface(riid, ppv);
}

I can get the contents of the args SAFEARRAY that is passed into this method into a variant -- shown in the debugger as {"abc" VT_BSTR} -- before the subsequent call to CreateInstance_2(), however, when I step into the call to CreateInstance_2(), the underlying raw_CreateInstance_2() call in mscorlib.tli blows up Cry | :(( .

Can anyone see what I am doing wrong here? I tried adding the save /*** debug ***/ code to mscorlib.tli in order to peek at the content of the SAFEARRAY being passed for activation attributes, but the debugger seems to ignore the added code...

Thanks for any insights!

--
Roy
GeneralMaking DLLs Pin
zakimurtaza12-May-02 6:27
zakimurtaza12-May-02 6:27 
GeneralRe: Making DLLs Pin
Nish Nishant13-May-02 4:45
sitebuilderNish Nishant13-May-02 4:45 
Generalwchar_t* to __gc String* Pin
Nish Nishant11-May-02 1:18
sitebuilderNish Nishant11-May-02 1:18 
GeneralRe: wchar_t* to __gc String* Pin
James T. Johnson11-May-02 1:56
James T. Johnson11-May-02 1:56 
GeneralRe: wchar_t* to __gc String* Pin
Nish Nishant11-May-02 3:37
sitebuilderNish Nishant11-May-02 3:37 
General#pragma managed/unmanaged Pin
Nish Nishant11-May-02 1:15
sitebuilderNish Nishant11-May-02 1:15 
GeneralRe: #pragma managed/unmanaged Pin
James T. Johnson11-May-02 1:55
James T. Johnson11-May-02 1:55 
GeneralRe: #pragma managed/unmanaged Pin
Nish Nishant11-May-02 3:38
sitebuilderNish Nishant11-May-02 3:38 
GeneralRe: #pragma managed/unmanaged Pin
James T. Johnson11-May-02 3:51
James T. Johnson11-May-02 3:51 
GeneralRe: #pragma managed/unmanaged Pin
Nish Nishant11-May-02 4:52
sitebuilderNish Nishant11-May-02 4:52 
GeneralRe: #pragma managed/unmanaged Pin
James T. Johnson11-May-02 5:02
James T. Johnson11-May-02 5:02 
GeneralRe: #pragma managed/unmanaged Pin
Rama Krishna Vavilala11-May-02 4:29
Rama Krishna Vavilala11-May-02 4:29 
GeneralRe: #pragma managed/unmanaged Pin
Nish Nishant11-May-02 4:50
sitebuilderNish Nishant11-May-02 4:50 
GeneralVC++.Net Pin
Ollie8-May-02 23:16
Ollie8-May-02 23:16 
GeneralRe: VC++.Net Pin
James T. Johnson8-May-02 23:35
James T. Johnson8-May-02 23:35 
GeneralRe: VC++.Net Pin
Ollie9-May-02 0:02
Ollie9-May-02 0:02 
GeneralRe: VC++.Net Pin
James T. Johnson9-May-02 0:18
James T. Johnson9-May-02 0:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.