John Watson
2005-02-12 09:14:57 UTC
newb note: Being taught solely in Java, I really don't fully grasp
pointers and indirection/deferencing/address operators.
I get the following errors:
error c2227: left of'->GetChallenge' must point to class/struct/union
error C2027: use of undefined type 'CSCardISO7816'
error C2373: 'GetChallenge' : redefinition; different type modifiers
error C2601: 'GetChallenge' : local function definitions are illegal
with the following code:
// Create an ISCardCmd object.
LPVOID* g_pISCardCmd, g_pISCardISO7816;
HRESULT silly, silly2, silly3;
silly2 = CoCreateInstance(CLSID_CSCardCmd,
NULL,
CLSCTX_ALL,
IID_ISCardCmd,
(LPVOID*) &g_pISCardCmd);
// Create an ISCardISO7816 object.
silly3 = CoCreateInstance(CLSID_CSCardISO7816,
NULL,
CLSCTX_ALL,
IID_ISCardISO7816,
(LPVOID*) &g_pISCardISO7816);
// Do challenge.
DWORD dwLengthOfChallenge;
dwLengthOfChallenge = 32;
silly3 = g_pISCardISO7816->GetChallenge(dwLengthOfChallenge,
&g_pISCardCmd);
STDMETHODIMP CSCardISO7816::GetChallenge(IN DWORD dwBytesExpected /*= 0*/,
IN OUT LPSCARDCMD *ppCmd)
{
// Locals.
HRESULT hr = S_OK;
try
{
// Is the ISCardCmd object okay?
hr = IsSCardCmdValid(ppCmd);
if (FAILED(hr))
throw (hr);
// Do it.
hr = (*ppCmd)->BuildCmd(m_byClassId,
(BYTE) INS_GET_CHALLENGE),
(BYTE) INS_NULL), // P1 = 0x00
(BYTE) INS_NULL), // P2 = 0x00
NULL,
&dwBytesExpected);
if (FAILED(hr))
throw (hr);
}
}
pointers and indirection/deferencing/address operators.
I get the following errors:
error c2227: left of'->GetChallenge' must point to class/struct/union
error C2027: use of undefined type 'CSCardISO7816'
error C2373: 'GetChallenge' : redefinition; different type modifiers
error C2601: 'GetChallenge' : local function definitions are illegal
with the following code:
// Create an ISCardCmd object.
LPVOID* g_pISCardCmd, g_pISCardISO7816;
HRESULT silly, silly2, silly3;
silly2 = CoCreateInstance(CLSID_CSCardCmd,
NULL,
CLSCTX_ALL,
IID_ISCardCmd,
(LPVOID*) &g_pISCardCmd);
// Create an ISCardISO7816 object.
silly3 = CoCreateInstance(CLSID_CSCardISO7816,
NULL,
CLSCTX_ALL,
IID_ISCardISO7816,
(LPVOID*) &g_pISCardISO7816);
// Do challenge.
DWORD dwLengthOfChallenge;
dwLengthOfChallenge = 32;
silly3 = g_pISCardISO7816->GetChallenge(dwLengthOfChallenge,
&g_pISCardCmd);
STDMETHODIMP CSCardISO7816::GetChallenge(IN DWORD dwBytesExpected /*= 0*/,
IN OUT LPSCARDCMD *ppCmd)
{
// Locals.
HRESULT hr = S_OK;
try
{
// Is the ISCardCmd object okay?
hr = IsSCardCmdValid(ppCmd);
if (FAILED(hr))
throw (hr);
// Do it.
hr = (*ppCmd)->BuildCmd(m_byClassId,
(BYTE) INS_GET_CHALLENGE),
(BYTE) INS_NULL), // P1 = 0x00
(BYTE) INS_NULL), // P2 = 0x00
NULL,
&dwBytesExpected);
if (FAILED(hr))
throw (hr);
}
}