From: jc on
Hello,

Yes, I did step through the code, and all of return values
were OK. The only value that was NULL was the return
value from the CreateIconFromResource(...).

jc
From: Seetharam on
On Apr 9, 12:19 pm, jc <j...(a)discussions.microsoft.com> wrote:
> Hello,
>
> Yes, I did step through the code, and all of return values
> were OK. The  only value that was NULL was the return
> value from the CreateIconFromResource(...).
>
> jc

What does GetLastError() return?
-Seetharam
From: jc on
Hello,

This works OK, but the cursor is not part of the application.
The cursor is a separate file.

hRetCursor = LoadCursorFromFile(_T("MyAniCursor.ani"));

Any ideas, about what is wrong with the initial implementation?

-jc
From: Joseph M. Newcomer on
On Fri, 9 Apr 2010 09:19:01 -0700, jc <jc(a)discussions.microsoft.com> wrote:

>Hello,
>
>Yes, I did step through the code, and all of return values
>were OK. The only value that was NULL was the return
>value from the CreateIconFromResource(...).
****
Well, that is pretty serious! What did GetLastError() report? You can put
err,hr
in the watch window and you don't have to call GetLastError explicitly.

I'll wager it is "invalid parameter", one of the most useless messages you can get,
because the manuals NEVER tell you what the likely causes of "invalid parameter" are, and
since we can't step into the code or even read it, we can't tell which of the possibly
several dozen tests for parameter validity are failing! (It is times like these that I
realize that Microsoft deserves to lose the open-source battle. They really need to
document what the causes of errors are, essentially by explaining what tests are applied)

But if something fails, you need to report that, not just assume it had worked.
joe
****
>
>jc
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
From: Joseph M. Newcomer on
What did GetLastError tell you? (See my other post)
joe
On Fri, 9 Apr 2010 08:19:02 -0700, jc <jc(a)discussions.microsoft.com> wrote:

>Hello,
>
>Thank you for replying to my posting.
>I apologize for not providing more information.
>
>Yes, I did step through the code, and the
>value of hCur is NULL (last line). That's my question.
>
>Why is the value returned for CreateIconFromResource(...) NULL?
>
>TIA,
>-jc
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
First  |  Prev  | 
Pages: 1 2
Prev: strsafe.lib
Next: OnAccept() in CAsyncSocket