S
Smith
Hi,
I have a the following COM method:
HRESULT GiveString(LPWSTR name, INT inputLen)
{
WHAR myString[] = L"Hello";
if (wcslen(myString) > inputLen)
return E_FAIL;
else
wcscpy(name, myString);
return S_OK;
}
My IDL prototype is the following:
HRESULT GiveString([out, size_is(inputLen)] LPWSTR name, INT inputLen);
From a C++ COM client, it makes sense to do the following:
WHAR myString[9+1]; // +1 for terminating null char
GiveString(myString, 9);
However when I use COM interop from a CF 2.0 application, the signature
generated becomes:
GiveString(string name, int inputLen);
which is definitely not what I want, since 'name' is an output parameter.
Also, inputLen doesn't really make sense with .NET, so I'd like to get rid
of it.
Is there a way for me to setup my MIDL attributes so that TLBIMP generates
the following:
GiveString(out string name);
Any idea?
I have a the following COM method:
HRESULT GiveString(LPWSTR name, INT inputLen)
{
WHAR myString[] = L"Hello";
if (wcslen(myString) > inputLen)
return E_FAIL;
else
wcscpy(name, myString);
return S_OK;
}
My IDL prototype is the following:
HRESULT GiveString([out, size_is(inputLen)] LPWSTR name, INT inputLen);
From a C++ COM client, it makes sense to do the following:
WHAR myString[9+1]; // +1 for terminating null char
GiveString(myString, 9);
However when I use COM interop from a CF 2.0 application, the signature
generated becomes:
GiveString(string name, int inputLen);
which is definitely not what I want, since 'name' is an output parameter.
Also, inputLen doesn't really make sense with .NET, so I'd like to get rid
of it.
Is there a way for me to setup my MIDL attributes so that TLBIMP generates
the following:
GiveString(out string name);
Any idea?