body { margin:0px; padding:0px; background:#f6f6f6; color:#000000; font-size: small; } #outer-wrapper { font:normal normal 100% 'Trebuchet MS',Trebuchet,Verdana,Sans-Serif; } a { color:#DE7008; } a:hover { color:#9E5205; } a img { border-width: 0; } #content-wrapper { padding-top: 0; padding-right: 1em; padding-bottom: 0; padding-left: 1em; } @media all { div#main { float:right; width:66%; padding-top:30px; padding-right:0; padding-bottom:10px; padding-left:1em; border-left:dotted 1px #e0ad12; word-wrap: break-word; /* fix for long text breaking sidebar float in IE */ overflow: hidden; /* fix for long non-text content breaking IE sidebar float */ } div#sidebar { margin-top:20px; margin-right:0px; margin-bottom:0px; margin-left:0; padding:0px; text-align:left; float: left; width: 31%; word-wrap: break-word; /* fix for long text breaking sidebar float in IE */ overflow: hidden; /* fix for long non-text content breaking IE sidebar float */ } } @media handheld { div#main { float:none; width:90%; } div#sidebar { padding-top:30px; padding-right:7%; padding-bottom:10px; padding-left:3%; } } #header { padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; border-bottom:dotted 1px #e0ad12; background:#F5E39e; } h1 a:link { text-decoration:none; color:#F5DEB3 } h1 a:visited { text-decoration:none; color:#F5DEB3 } h1,h2,h3 { margin: 0; } h1 { padding-top:25px; padding-right:0px; padding-bottom:10px; padding-left:5%; color:#F5DEB3; background:#DE7008; font:normal bold 300% Verdana,Sans-Serif; letter-spacing:-2px; } h3.post-title { color:#9E5205; font:normal bold 160% Verdana,Sans-Serif; letter-spacing:-1px; } h3.post-title a, h3.post-title a:visited { color: #9E5205; } h2.date-header { margin-top:10px; margin-right:0px; margin-bottom:0px; margin-left:0px; color:#777777; font: normal bold 105% 'Trebuchet MS',Trebuchet,Verdana,Sans-serif; } h4 { color:#aa0033; } #sidebar h2 { color:#B8A80D; margin:0px; padding:0px; font:normal bold 150% Verdana,Sans-serif; } #sidebar .widget { margin-top:0px; margin-right:0px; margin-bottom:33px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; font-size:95%; } #sidebar ul { list-style-type:none; padding-left: 0; margin-top: 0; } #sidebar li { margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; list-style-type:none; font-size:95%; } .description { padding:0px; margin-top:7px; margin-right:12%; margin-bottom:7px; margin-left:5%; color:#9E5205; background:transparent; font:bold 100% Verdana,Sans-Serif; } .post { margin-top:0px; margin-right:0px; margin-bottom:30px; margin-left:0px; } .post strong { color:#000000; font-weight:bold; } pre,code { color:#999999; } strike { color:#999999; } .post-footer { padding:0px; margin:0px; color:#444444; font-size:80%; } .post-footer a { border:none; color:#968a0a; text-decoration:none; } .post-footer a:hover { text-decoration:underline; } #comments { padding:0px; font-size:110%; font-weight:bold; } .comment-author { margin-top: 10px; } .comment-body { font-size:100%; font-weight:normal; color:black; } .comment-footer { padding-bottom:20px; color:#444444; font-size:80%; font-weight:normal; display:inline; margin-right:10px } .deleted-comment { font-style:italic; color:gray; } .comment-link { margin-left:.6em; } .profile-textblock { clear: both; margin-left: 0; } .profile-img { float: left; margin-top: 0; margin-right: 5px; margin-bottom: 5px; margin-left: 0; border: 2px solid #DE7008; } #sidebar a:link { color:#999999; text-decoration:none; } #sidebar a:active { color:#ff0000; text-decoration:none; } #sidebar a:visited { color:sidebarlinkcolor; text-decoration:none; } #sidebar a:hover { color:#B8A80D; text-decoration:none; } .feed-links { clear: both; line-height: 2.5em; } #blog-pager-newer-link { float: left; } #blog-pager-older-link { float: right; } #blog-pager { text-align: center; } .clear { clear: both; } .widget-content { margin-top: 0.5em; } /** Tweaks for layout editor preview */ body#layout #outer-wrapper { margin-top: 0; } body#layout #main, body#layout #sidebar { margin-top: 10px; padding-top: 0; } -->

Thursday, February 28, 2008

[C++/CLI] Show a child form only one instance using event

Replying an answer, I've found interesting question.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2906249&SiteID=1
There will be many ways to do that.

First, find window caption name or class name using FindWindow(...) native API.
But it's require an InteropServices.

Second, Do not show a new form duing a child form alive.
When a child form closed, fire an event.

I've implemented sample codes.
Here is sample codes on MSDN Forums
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2906249&SiteID=1

Tuesday, February 26, 2008

Atomic Operation

Programmer SHOULD know about this.
http://www.dlugosz.com/Repertoire/refman/Classics/atomic_counter_whitepaper.html
http://www.codemaestro.com/reviews/8#comment-2497

Writing Stupid codes

  • Do not use class member access controller(public, private, protected), Just use public.

Any classes can access variables, I don't care that variable can change unexpected value by other threads.

When debugging I shoud search all the files for which line access that variable.

  • Do not add comment.

I don't care , other programmer can understand these codes or not.

  • Use external variable when can't way to access some class's instance.

Yes, other programmer will be confuse, but I don't care.

Yes, I know there are some patterns, but I don't know and I dislike studing something new.

  • Copy and paste open source group's codes.

Oh making spaghetti codes , It's really gorgeous ability.

I don't care how these codes run. Result is more important.

Have you guys met these guys?

I meet every days.

Thursday, February 21, 2008

Developing applications using the Eclipse C/C++ Development Toolkit

It's really damm too many things to do!!
IBM should learn, why MSFT be a dinosarus of the Software area.
I think MSFT will defeat an IBM Rational Software Architect tools sooner or later.

http://www.ibm.com/developerworks/opensource/library/os-eclipse-stlcdt/

Thursday, February 14, 2008

How to locate the Flight Simulator 9 SDK

View products that this article applies to.
function loadTOCNode(){}
Author: Nick Whittome
Community Solutions Content Disclaimer
Article ID:555857
Last Review:August 17, 2007
Revision:1.0
SUMMARY
loadTOCNode(1, 'summary');
Since the release of Flight Simulator X, the ACES team have provided links on the www.fsinsider.com website to the new version SDK's. Some users still require links to the version 9 SDK's.
RESOLUTION
loadTOCNode(1, 'resolution');


The Flight Simulator 9 SDK's are available from the following links:

Autogen: http://download.microsoft.com/download/3/d/4/3d460861-18ca-433c-9118-75f749ecce36/autogen_sdk_setup.exe

Netpipes: http://download.microsoft.com/download/f/d/5/fd5a11fe-4a5a-41e2-ba02-24f596af6328/netpipes_sdk_setup.exe

Terrain : http://download.microsoft.com/download/4/f/f/4ffb2a54-cb13-4c3d-996d-7e7bd86b884c/terrain_sdk_setup.exe

Weather Themes : http://download.microsoft.com/download/6/b/e/6be850a6-5b2a-4795-89e3-eb0b5c725cb4/weather_theme_sdk_setup.exe

Panels and Gauges: http://download.microsoft.com/download/a/2/6/a263954a-3649-4654-ab1b-0ee4e30d7261/panels_sdk_setup.exe

Traffic Toolbox: http://download.microsoft.com/download/f/2/8/f287f6a9-1cb3-4067-a720-0bdaf3543ff6/traffictoolbox_sdk_setup.exe

ABL: http://download.microsoft.com/download/7/1/c/71c72136-acef-44b6-9a9d-f9dbb5cab6dd/fs2004_sdk_abl_setup.exe

Aircraft Container: http://download.microsoft.com/download/9/f/5/9f57691b-7c5f-4031-aa29-2ab00f676ba6/aircraft_container_setup.exe

ATC Voicepack: http://download.microsoft.com/download/c/a/0/ca0f7542-1e1d-4ea0-96d0-57981d1f314a/fs2004_sdk_atc_voicepack_setup.exe

FSEdit: http://download.microsoft.com/download/9/4/3/943f9e01-f457-4300-91cf-a1762839f64a/fs2004_sdk_fsedit_setup.exe

Make Model: http://download.microsoft.com/download/1/1/8/1181a250-ac2c-43fa-b35b-bfd7b87934ad/makemdl_sdk_setup.exe

BGL Comp: http://download.microsoft.com/download/b/9/3/b930da2a-b3bf-40dc-b830-b1da916eb9e2/fs2004_sdk_bglcomp2_setup.exe

GMAX: http://download.microsoft.com/download/4/d/e/4de1e425-c932-4232-829b-eeb7f2658885/fs2004_sdk_gmax_setup.exe

Special Effects : http://download.microsoft.com/download/0/8/8/0886f451-15da-43ea-b948-a36d9796c045/fs2004_sdk_special_effects_setup.exe

CabDIR : http://download.microsoft.com/download/f/e/5/fe55ede7-3818-40c4-8790-468a0d74798f/cabdir_sdk_setup.exe

APPLIES TO
•Microsoft Flight Simulator 2004: Century of Flight
Back to the top
Keywords:
kbpubmvp kbpubtypecca kbhowto KB555857

COMMUNITY SOLUTIONS CONTENT DISCLAIMER
MICROSOFT CORPORATION AND/OR ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY, RELIABILITY, OR ACCURACY OF THE INFORMATION AND RELATED GRAPHICS CONTAINED HEREIN. ALL SUCH INFORMATION AND RELATED GRAPHICS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT AND/OR ITS RESPECTIVE SUPPLIERS HEREBY DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THIS INFORMATION AND RELATED GRAPHICS, INCLUDING ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, WORKMANLIKE EFFORT, TITLE AND NON-INFRINGEMENT. YOU SPECIFICALLY AGREE THAT IN NO EVENT SHALL MICROSOFT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, PUNITIVE, INCIDENTAL, SPECIAL, CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF USE, DATA OR PROFITS, ARISING OUT OF OR IN ANY WAY CONNECTED WITH THE USE OF OR INABILITY TO USE THE INFORMATION AND RELATED GRAPHICS CONTAINED HEREIN, WHETHER BASED ON CONTRACT, TORT, NEGLIGENCE, STRICT LIABILITY OR OTHERWISE, EVEN IF MICROSOFT OR ANY OF ITS SUPPLIERS HAS BEEN ADVISED OF THE POSSIBILITY OF DAMAGES.

http://support.microsoft.com/kb/555857

About Sleep() function

void Sleep(DWORD dwMilliseconds);

  • Calling Sleep alows the thread to volunatarily give up the remainder of its time slice.
  • The System makes the thread not schedulable for approxmitely the number of milliseconds specified. That's right-if you tell the system you want to sleep for 100 miliseconds, you will sleep approximitely that long, but possivly several seconds or minutes more. Remember that Windows is not a real-time operating system. Your thread will probably wake up at theright time, but whether it does depends on what else is going on in the system.
  • You can call Sleep and pass INFINITE for the dwMilliseconds parameter. This tells the system to never schedule the thread. This is not a useful thing to do. It is much better to havethe thread exit and to recover its stack and kernel object.
  • You can pass 0 to Sleep. This tells the system that the calling thread relinquishes the remainder if its time slice, and it forces the system to schedule another thread. However, the system can reschedule the thread that just called Sleep. This will happen if there are no more schedulable threads at the same priority or higher.

On Windows Via C/C++ page 177.

Monday, February 11, 2008

Visual C++ Solution Center


Visual C++ 2005 Solution Center
VC++ 2005 Information

[KB]C++ Application failed to start after Visual Studio upgrade

http://support.microsoft.com/default.aspx?scid=kb;en-us;948619&sd=rss&spid=3041

Friday, February 8, 2008

error C2660: 'Gdiplus::GdiplusBase::operator new' : function does not take 3 parameters

PRB: Microsoft Foundation Classes DEBUG_NEW Does Not Work with GDI+

On MFC, you'll got an error C2660 when create new gdi plus object using new operator.
It's caused by preprocessor macro.
To prevent this error.

First, remove these lines on source files.

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


Second, add these lines



//// Ensure that GdiPlus header files work properly with MFC DEBUG_NEW and STL header files


#define iterator _iterator

#ifdef _DEBUG

namespace Gdiplus
{
namespace DllExports
{
#include <gdiplusmem.h>
};


#ifndef _GDIPLUSBASE_H
#define _GDIPLUSBASE_H
class GdiplusBase
{
public:
void (operator delete)(void* in_pVoid)
{
DllExports::GdipFree(in_pVoid);
}

void* (operator new)(size_t in_size)
{
return DllExports::GdipAlloc(in_size);
}

void (operator delete[])(void* in_pVoid)
{
DllExports::GdipFree(in_pVoid);
}

void* (operator new[])(size_t in_size)
{
return DllExports::GdipAlloc(in_size);
}

void * (operator new)(size_t nSize, LPCSTR lpszFileName, int nLine)
{
return DllExports::GdipAlloc(nSize);
}

void operator delete(void* p, LPCSTR lpszFileName, int nLine)
{
DllExports::GdipFree(p);
}

};
#endif // #ifndef _GDIPLUSBASE_H
}
#endif // #ifdef _DEBUG

#include <gdiplus.h>
#undef iterator
//// Ensure that Gdiplus.lib is linked.
#pragma comment
(lib, "gdiplus.lib")


http://support.microsoft.com/kb/317799

Friday, February 1, 2008

Powered By Blogger