Click here to Skip to main content
15,887,746 members

Articles by Jose David Pujo (Tip/Tricks: 5)

Tip/Tricks: 5

RSS Feed

Average article rating:

No articles have been posted.

Average blogs rating:

No blogs have been submitted.

Average tips rating: 4.06

Desktop Programming
Win32
1 Sep 2011   Updated: 1 Sep 2011   Rating: 0.00/5    Votes: 0   Popularity: 0.00
Licence: CPOL    Views: 7,490     Bookmarked: 0   Downloaded: 0
Please Sign up or sign in to vote.
With SendInput:void SetNumLock (bool active){ BYTE keyState[256]; GetKeyboardState((LPBYTE)&keyState); bool active0= keyState[VK_NUMLOCK] & 1; if (active0!=active) { INPUT inp[2]; ZeroMemory(inp, sizeof(inp)); inp[0].type=INPUT_KEYBOARD; ...
Programming Languages
C
23 Aug 2011   Updated: 23 Aug 2011   Rating: 4.25/5    Votes: 3   Popularity: 2.03
Licence: CPOL    Views: 10,081     Bookmarked: 0   Downloaded: 0
Please Sign up or sign in to vote.
I always use a home-made macro to zero my struct's and class's:#define ZEROMEMORY ZeroMemory (this, sizeof (*this))Sample1:struct S1 { double x; long i; char s[255+1]; S1 () { ZEROMEMORY; } };Sample2:class foo { private: double x[16]; char a,b,c; foo () {...
C#
31 Mar 2011   Updated: 2 Apr 2011   Rating: 4.50/5    Votes: 2   Popularity: 1.35
Licence: CPOL    Views: 9,361     Bookmarked: 2   Downloaded: 0
Please Sign up or sign in to vote.
Here goes my alternate.I am a C++ programmer. My goal is always to try to make code short and simple.bool bFailed=false;if (!bFailed) bFailed= condition1_fails;if (!bFailed) bFailed= condition2_fails;if (!bFailed) bFailed= condition3_fails;if (bFailed) DoFailedCleanup();else {...
C++
25 Aug 2011   Updated: 25 Aug 2011   Rating: 2.63/5    Votes: 4   Popularity: 1.58
Licence: CPOL    Views: 16,380     Bookmarked: 1   Downloaded: 0
Please Sign up or sign in to vote.
Smaller code:void DrawRect(int x, int y, int width, int height, int curPosX=0, int curPosY=0){ setxy(x, y); cout << char(201); cout.width(width); cout.fill (char(205)); cout << char(187); setxy(x,height+y); cout << char(200); cout.width(width); cout.fill...
Shortcut
31 Mar 2011   Updated: 2 Apr 2011   Rating: 4.86/5    Votes: 7   Popularity: 4.10
Licence: CPOL    Views: 26,101     Bookmarked: 2   Downloaded: 0
Please Sign up or sign in to vote.
Sometimes we spend a lot of time opening - closing folders trying to find .cpp / .cs / .h files in the Solution

Average reference rating:

No reference articles have been posted.

Average project rating:

No projects have been posted.
Software Developer (Senior) Freelancer
Spain Spain
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.