A
alex
how do i initialize an atl ULONG* variable?
alex said:how do i initialize an atl ULONG* variable?
alex said:[snip]
ULONG* pnChars = 50; does not compile (int)
ULONG* pnChars = 50.0; does not compile (double)
ULONG* pnChars = 0; compiles but causes assertion failure when used in:
if ( MyCRegKey.QueryStringValue(valName.c_str(), pszValue, pnChars) ==
ERROR_SUCCESS )
ULONG* pnChars = 50; does not compile (int)
ULONG* pnChars = 50.0; does not compile (double)
ULONG* pnChars = 0; compiles but causes assertion failure when used in:
if ( MyCRegKey.QueryStringValue(valName.c_str(), pszValue, pnChars) ==
ERROR_SUCCESS )
MyCRegKey is an object instantiated from CRegKey -- a microsoft class that
wraps the registry functions.
for this QueryStringValue issue I think I'll just call one or more of the
registry functions directly, that should take care
of things, it would be good to know how to handle this though.
John Harrison said:Common newbie mistake. Just because a function takes a pointer argument it
doesn't mean that you have to declare a pointer variable. Just declare a
ULONG (no pointer) and use the address of operator.
ULONG nChars;
if ( MyCRegKey.QueryStringValue(valName.c_str(), pszValue, &nChars) ==
ERROR_SUCCESS )
john
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.