Discussion:
newbie Windows programmer HELP ME!
(too old to reply)
John Watson
2005-02-12 09:14:57 UTC
Permalink
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);
}
}
The Ghost In The Machine
2005-02-12 15:00:05 UTC
Permalink
In comp.windows.x.intrinsics, John Watson
<***@CS.Arizona.EDU>
wrote
on Sat, 12 Feb 2005 02:14:57 -0700
Post by John Watson
newb note: Being taught solely in Java, I really don't fully grasp
pointers and indirection/deferencing/address operators.
error c2227: left of'->GetChallenge' must point to class/struct/union
[rest snipped]

This newsgroup is primarily for the discussion of Xt Intrinsics,
which is the basis for Motif and Athena Widgets, but AFAIK isn't
being actively used anywhere else. Xt Intrinsics, of course,
is part of the X Windows System, originally published by MIT, and
has nothing (or at least not much) to do with Microsoft Windows.

Since you are apparently having troubles with a generic
concept (pointers/structures) as opposed to any Windows-specific
or user interface-specific concept, you might try
the newsgroup comp.lang.c++ .

However, I will note that the item mentioned in the error message
is an LPVOID, which needs to be cast or otherwise managed
so as to have the member GetChallenge (which is probably in
a veyr specific structure which you want to use). LPVOID is,
admittedly, a macro defined somewhere in Microsoft' include files
(the rough equivalent in non-Microsoft C++ is "void *").

Good luck.
--
#191, ***@earthlink.net
It's still legal to go .sigless.
Loading...