- Viewing Profile: Reputation: Endurion
Community Stats
- Group Members
- Active Posts 3,347
- Profile Views 9,992
- Member Title Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Not Telling
#4988616 string::size_type
Posted by Endurion
on 09 October 2012 - 11:52 PM
string::size_type is not a function, it's a typedef for size_t usually.
#4987592 C++ -- Undinitialized Variables
Posted by Endurion
on 06 October 2012 - 11:45 PM
Check if cellPosition gets >= CELLS_IN_GRID. If it does you're writing in memory that is not yours. Once that happens all kind of weird things can happen (hence undefined).
The lines inside the for loop look ok.
#4985672 entering a string of data to an ofstream file
Posted by Endurion
on 01 October 2012 - 01:58 AM
std::cin >> filedata
Replace that with
std::getline ( std::cin, filedata );
#4985271 Saving desktops icons dosen't work...
Posted by Endurion
on 29 September 2012 - 11:32 PM
You need to allocate memory in the explorer process with VirtualAllocEx and use ReadProcessMemory and WriteProcessMemory to access it. Also, be sure to chose the right bitness (32bit vs. 64bit).
#4985263 Tile path following algorithm
Posted by Endurion
on 29 September 2012 - 10:51 PM
Pseudocode:
while ( number_of_pixels_to_move > 0 )
{
if ( number_of_pixels_to_move >= pixels_left_to_move_on_one_tile )
{
// arrive at a tile
number_of_pixels_to_move -= pixels_left_to_move_on_one_tile;
move pixels_left_to_move_on_one_tile pixels in move direction
adjust direction according to tile below
}
else
{
// move object number_of_pixels_to_move pixels in move direction
number_of_pixels_to_move = 0;
}
}
Edit: The dumb editor keeps screwing up indentation
#4977518 Zork like text input
Posted by Endurion
on 07 September 2012 - 01:41 AM
Back then the programmer had a list of verb strings (with index so different verbs with the same id existed) and list of object strings.
Then you would parse the input string, split for spaces and try to find all the single words in the lists. The puzzle logic would then analyse the verb and object indices and act accordingly.
If you want to get fancy allow for a secondary object (put xxx in yyy) and fill words that would be discardid ("the", "in", etc.).
Steps:
* Split a string by a separator (space)
* Handle string to index maps (std::map<std::string,int>)
#4976694 Combo Box Insert String
Posted by Endurion
on 04 September 2012 - 10:58 PM
#4976677 understanding return by value.
Posted by Endurion
on 04 September 2012 - 09:45 PM
The signature looks like this:
Test::Test( const Test& rhs )
#4973467 TotalCmd - delete file from a custom pack
Posted by Endurion
on 26 August 2012 - 07:23 AM
Basically removing a file from a .zip doesn't involve any decompression/recompression at all.
#4973407 TotalCmd - delete file from a custom pack
Posted by Endurion
on 25 August 2012 - 11:22 PM
#4971351 Full Screen to Windowed - Window loses border and style
Posted by Endurion
on 19 August 2012 - 11:54 PM
Before going fullscreen:
m_WindowedModeStyles = GetWindowLong( hwndViewport, GWL_STYLE );
m_WindowedModeExStyles = GetWindowLong( hwndViewport, GWL_EXSTYLE );
m_WindowedModeExStyles &= ~WS_EX_TOPMOST;
Returning to windowed mode:
SetWindowLong( hwndViewport, GWL_STYLE, m_WindowedModeStyles );
SetWindowLong( hwndViewport, GWL_EXSTYLE, m_WindowedModeExStyles );
SetWindowPos( hwndViewport, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_FRAMECHANGED );
#4968973 win32 dialog question
Posted by Endurion
on 13 August 2012 - 01:43 AM
If you want your main window visible, use WS_OVERLAPPEDWINDOW | WS_VISIBLE in CreateWindow. That also relieves you of having to call ShowWindow.
#4968614 Win32 Button Commands
Posted by Endurion
on 11 August 2012 - 10:35 PM
You cannot generally return 0. Look up the handled message and see what you should return (if you should do so).And also you should return 0 for handled messages. I don't know if this is the full code, but I can't see a "return 0" statement. Returning 0 is important.
#4968321 WndProc and WinMain
Posted by Endurion
on 10 August 2012 - 10:27 PM
#4966905 DX7 VC++6 Slow Alpha Blending
Posted by Endurion
on 06 August 2012 - 10:45 PM
And additionally, what jbadams said ;)
- Home
- » Viewing Profile: Reputation: Endurion

Find content