What's the proper sytax, and initialization of HWND *pHwnd[]={}; ?

This is a discussion on What's the proper sytax, and initialization of HWND *pHwnd[]={}; ? within the Windows Programming forums, part of the Platform Specific Boards category; HOLY MOLY!!! I did not expect any reasonable answer from this board, but you matsp and Elysia(Legend of the skys) ...

  1. #16
    Registered User
    Join Date
    Aug 2008
    Posts
    15
    HOLY MOLY!!! I did not expect any reasonable answer from this board, but you matsp and Elysia(Legend of the skys) have showed me otherwise....


    THANK YOU THANK YOU THANK YOU for putting some real effort into answering me. I will evaluate what you have written after writing this, but it looks like it actually might answer my question.


    My original way was infact matsp's way before I had originally even posted, and yet I still could not get my program to work right(previously that is). As of now, I put the static keyword in front of phWnd and hWnd and my program is actually working. I agree with the post on this thread that what I was asking was very simple, and that I should already have known about pointers, but you see I have heard that an HWND type was some kind of complicated structure(or something of that nature), and I assumed that my program was not working because maybe I was not casting the return of CreateWindowEx() properly even though I new that this situation shoud not use a cast. But it turns out that I had it right from the beginning(before I originally even posted)... I just needed to define the hWnd and phWnd as a static.

    So I do, in my opininion, have at least a fundamental understanding of pointers, if not greater. I mean I am able to write even complex pointer expressions like pointers to functions returning pointers to pointers to arrays of pointers to chars etc... I am also able to cast, allocate, and deallocate complex pointer expressions. I simply got confused for a moment , and questioned what I knew was right, because I was not sure why my program was not working or what was an HWND type exactly anyways. Personally I neither think pointers nor C++ nor even Win32 is very difficult to learn. If it weren't for this awful and strange perdicament I've been in for a while now I probably would already be a professional. I managed to learn most of the C++ semantics in about two weeks or at least what you'd find on the website "http://www.cplusplus.com/doc/tutorial/". Of course I've read that the language is far more complicated than this... I think these particular statements must have been reffering to the application of the language rather than the semantics because the semantics were easy to learn....

    Anyway --- I tried a bunch of different methods, that I knew were incorrect, but that was all I could figure to do since the right way was not working. I posted one of these incorrect methods assuming that someone would simply give me an answer regardless of wether my example was correct or not, especially considering that it was an example demonstrating a problem and not a solution. All the while all I needed was the static keyword.



    Again THANK YOU SO MUCH matsp and Elysia, especially you matsp for the example which was exactly what I wanted. Please have a wonderful day!!!

    P.S. You can bet that I will be giving you two a good rating, especially you matsp for the example. THANKS again you two!!!
    Last edited by JimmyJones; 08-05-2008 at 05:53 AM.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21