Jump to content

  • Log In with Google      Sign In   
  • Create Account

Endurion

Member Since 21 Feb 2002
Offline Last Active Today, 12:26 AM

#5193389 Funniest line of code ever ?

Posted by Endurion on 18 November 2014 - 12:38 AM

Found this on TIGSource, and yes, it compiles and works as intended:

 

switch(mode)
{
    case(0): if(test(a, b))
             {
    case(1):     result = foo(a, b);
                 break;
             }
             else
             {
    case(2):     result = bar(a, b);
                 break;
             }
}



#5190517 How to Create a Folder Name using variable Components

Posted by Endurion on 01 November 2014 - 12:42 AM

Since you're obviously using C++, why on earth are you using char pointers as strings? Don't do that. Use std::string. Also, you can't concatenate char pointers like that. You are adding the char value of your Zone ID to your pointer, offsetting it into some undefined territory.

 

How about this?

 

std::ostringstream folderName;
 
folderName << "World" << WorldID;
 
/MAKE NEW DIRECTORY
mkdir( forderName.str().c_str() );



#5188364 IButton interface & other control

Posted by Endurion on 21 October 2014 - 01:03 PM

In this case System.Windows.Forms.ButtonRenderer might be what you're after.

 

Here is a sample at MSDN (http://msdn.microsoft.com/de-de/library/f0ys5025(v=vs.80).aspx)




#5188292 IButton interface & other control

Posted by Endurion on 21 October 2014 - 05:54 AM

You need to provide more information.

 

What framework do you use? (Win32? MFC? Windows.Forms? WPF?)

What language?

 

What is this IButton interface? In what context does it exist?




#5187308 Converting project code from VS13 to Code::Blocks, massive amount of errors

Posted by Endurion on 15 October 2014 - 11:24 PM

It's not a VS bug, it's a intended (and useful) feature. It's what VS calls an extension. Unfortunately it's non standard.

 

There's a switch in the compiler options to turn any non standard extensions off.




#5182319 Win32 Window gets stuck as the top-most window

Posted by Endurion on 22 September 2014 - 11:46 PM

Yeah, I noticed that. DX (at least with 9) adds the WS_EX_TOPMOST style to your window. So whenever I return from fullscreen I remove the style again. Before going fullscreen I store the current window styles (both style and extended style), and restore them afterwards.

 

Use SetWindowLong with GWL_EXSTYLE to do that.




#5180271 Macros doesnt work anymore (visual studio c++)

Posted by Endurion on 14 September 2014 - 11:05 AM

You have to add some entries to a few config files. Which depends on the VS version. Looky here (http://visualstudioextensions.vlasovstudio.com/2014/02/13/visual-studio-2010-macros-stop-working-after-february-2014-windows-update/)




#5179908 GET request contains addional non wanted data for XML document

Posted by Endurion on 12 September 2014 - 10:40 AM

Since you do a direct socket connection, could it be chunked encoding? (http://en.wikipedia.org/wiki/Chunked_transfer_encoding)




#5176588 Weird rendering issue (rows of pixels are drawn weird)

Posted by Endurion on 27 August 2014 - 10:49 PM

This is pretty sure a problem with your backbuffer size not matching the windows' client area size.

 

Do you use AdjustClientRect(Ex) to calculate the required windows size to offset for the border and caption?




#5175934 Moving from dinput to RAW input (mouse)

Posted by Endurion on 24 August 2014 - 11:57 PM

Also, do you pass the message on to DefWindowProc?

 

The MSDN is a bit misleading here, in the description of WPARAM it says that the message should be passed on to DefWindowProc for cleanup.




#5173789 C++ Runtime Error With Odd Workaround

Posted by Endurion on 14 August 2014 - 11:13 PM

The problem and "solution" you describe is pretty much a symptom of either accessing uninitialized memory or writing out of bounds.

 

Not much more can be said without seeing the real code. The problem is simply not in that sample code you posted.




#5173787 Stuck in C#......

Posted by Endurion on 14 August 2014 - 11:06 PM

List<Pokemon> is the typename of the class. The container is a class called List. The < > are a sign that the List uses Generics. The type inside the brackets defines the type of class this List contains.

 

In this line:

 

List<Pokemon> Pokemons = new List<Pokemon>();

 

List<Pokemon> is the type

Pokemans is the name of the list




#5172202 Debugging a system hang (entire OS freezes)

Posted by Endurion on 07 August 2014 - 11:22 PM

Are you using any libraries or systems beside OpenGL? Like playing sound during startup?

 

Sometimes it's the coincidental accessing of a resource (by your game and some other program) getting drivers bonkers

 

(I had something similar on a HP desktop where starting a sound in DirectSound and WinAmp starting a song at the same time would completely hang the machine)




#5167143 Win32 BOOL and bool ?

Posted by Endurion on 16 July 2014 - 08:04 AM

The consensus for the Windows defined types is, usually you DO NOT mix them. Pass a BOOL to a BOOL etc. Don't assume, just because they sound samey, that they are the same. There's usually a reason why they added a new type instead of reusing an existing one.


#5165727 SlimDX background color

Posted by Endurion on 08 July 2014 - 10:44 PM

AFAIR clear fails if you add flags which your backbuffer doesn't have (like clearing the z buffer if you have no z buffer enabled)






PARTNERS