Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
S

SimonSays

@SimonSays
About
Posts
11
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Resolution for Dialog
    S SimonSays

    By way of pointing out the obvious -- if you have an 820 pixel high dialog on a 600 pixel high display, part of it will be cut off no matter what.

    C / C++ / MFC question

  • Differentiating 2 methods with the same name for a pointer
    S SimonSays

    In your first example, the one without the C-style cast, the type system should prevent you from performing an illegal assignment -- in other words the right thing would have to happen or a compiler error be generated. Because the compiler will not allow the following: typedef int(* FUNC_ONE)(int); int Func2Parm(int x, int y) { return x + y; } FUNC_ONE pFuncOne = Func2Parm; Once you introduce the explicit cast, I am not sure what will happen. I would have guessed that the compiler would report an ambiguity error (after all it could cast either pointer that way).

    C / C++ / MFC help tutorial question announcement

  • how to get the HWND from the windows on the "locked screen"
    S SimonSays

    You pretty much don't. The security screen is on a different desktop (read up on Windows Desktop objects) which is completely inaccessible to normal code.

    C / C++ / MFC tutorial question

  • Object Definition
    S SimonSays

    The problem is that function pointer syntax is bizarre (sorry guys it is). In this example you are typdefing a function pointer that returns void and two parameters (ObjectRootPtr, const RTI::AttributeHandleValuePairSet&) to the name UpdateHandler. It does look wierd, but it works. On those occasions I need function pointers, I always have to look at an example because I can never quite remember it.

    C / C++ / MFC question

  • Background color
    S SimonSays

    Well, I believe that the background color is GetSysColor(COLOR_3DFACE), as long as XP Visual Styles don't come into play -- they it could be anything, including a bitmap. You would be better served to just call dc->SetBkMode(TRANSPARENT) and just draw transparent text.

    C / C++ / MFC c++ tutorial

  • Polymorphic pointer points to what?
    S SimonSays

    Well, as earlier posters have pointed out, dynamic_cast and typeid can be used to extract the information you want. However, to me at least, when you need to do this (and presumably frequently for an astroids game) you might start asking if you have the best possible design. I kind of liked the suggestion of the eariler poster about adding a function like "virtual bool ResolveColision (baseClass *)". Otherwise you could have a huge ugly mess of collision resolution between any 2 possible object types. If you happen to just need to be able to get set of all asteroids in the game, why not keep around an extra container just for astroids (and one for ships, missles, etc). Then you can iterate through any specific object without messing with all the other object types you are not interested in.

    C / C++ / MFC game-dev graphics question learning

  • WM_ACTIVATE question
    S SimonSays

    Does creating it with WS_EX_NOACTIVATE help?

    C / C++ / MFC question c++ com json help

  • ???
    S SimonSays

    Are you possibly refering to alloca? I don't think that it was ever in the C standard, but most compiler implmentations (including Visual Studio) do provide it. Given that VS (at least through 2003) does not support local array declaration with a variable number of elements, it is occasionally useful.

    C / C++ / MFC question com data-structures tools performance

  • Timer
    S SimonSays

    You could always try timeSetEvent to create a multimedia timer -- I have used that from time to time. That essentially creates the new thread for you and calls a function you specify when it times out. Saves you some of the details about thread management.

    C / C++ / MFC c++ tutorial question

  • How i create my own graphics for my applications
    S SimonSays

    This is a very broad topic. The first part would be to get the graphics themselves. You can download them or create them using the VC bitmap editor or use a third party editor depending on your preferences. It is beyond the scope of these forums to discuss graphics creation. Your best bet will be to get the graphics in .bmp format. Then browse the button classes on this site there are a whole bunch that will display bitmap buttons and select one for your needs and follow the instructions there. As for reshaping the window, for Win2K or higher you could use layered windows and a transparent color key or you could use SetWindowRgn to set the window to a specific shape.

    C / C++ / MFC csharp visual-studio graphics question

  • VERTICAL SCROLL is visible or available
    S SimonSays

    Well, this is how I would do it: CRect clRect; m_ListEx.GetClientRect(clRect); int visibleCount = clRect.Height() / m_ListEx.GetItemHeight(0); while (m_ListEx.GetCount() < visibleCount) { m_ListEx.AddString (_T("Hi")); } Ok, it is a bit of a hack, but given the tools you get in CListBox, this is the best I could come up with.

    C / C++ / MFC database
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups