??xml version="1.0" encoding="utf-8" standalone="yes"?>2020久久精品国产免费,久久水蜜桃亚洲av无码精品麻豆,久久久久国产精品三级网http://www.shnenglu.com/aqazero/category/1964.htmlzh-cnFri, 07 Feb 2020 14:03:47 GMTFri, 07 Feb 2020 14:03:47 GMT60Use Skia in MFC or Win32 applicationhttp://www.shnenglu.com/aqazero/archive/2020/02/07/217109.htmlbrentbrentThu, 06 Feb 2020 23:53:00 GMThttp://www.shnenglu.com/aqazero/archive/2020/02/07/217109.htmlhttp://www.shnenglu.com/aqazero/comments/217109.htmlhttp://www.shnenglu.com/aqazero/archive/2020/02/07/217109.html#Feedback0http://www.shnenglu.com/aqazero/comments/commentRss/217109.htmlhttp://www.shnenglu.com/aqazero/services/trackbacks/217109.htmlWhat is Skia

Skia is an open source 2D graphics library which provides common APIs that work across a variety of hardware and software platforms. It serves as the graphics engine for Google Chrome and Chrome OS, Android, Mozilla Firefox and Firefox OS, and many other products.

How to download and build Skia

Just follow https://skia.org/user/download, and do it step by step, we will need a static build for use lately.

How to use Skia in a MFC application

1. Create your MFC application

2. Add Skia path to "VC++ Directories" of the project



3. Add Skia library paths to "Additional Library Directories"



4. Add "uafxcw.lib;LIBCMT.lib;opengl32.lib;glu32.lib;skia.lib;sk_app.GLWindowContext.obj;sk_app.GLWindowContext_win.obj" to "Additional Dependencies". Add "uafxcw.lib;LIBCMT.lib;" to "Ignore Specific Default Libraries."



5. In XXXDlg.h:
#include "tools\sk_app\DisplayParams.h"
#include "tools\sk_app\WindowContext.h"

protected:
HICON m_hIcon;
sk_app::DisplayParams m_paras;
std::unique_ptr<sk_app::WindowContext> m_skaContext;

6. In XXXDlg.cpp:

#include "include\core\SkPoint.h"
#include "include\core\SkFont.h"
#include "include\core\SkCanvas.h"
#include "include\core\SkSurface.h"
#include "tools\sk_app\win\WindowContextFactory_win.h"
using namespace sk_app;

BOOL XXXDlg::OnInitDialog()
{
m_skaContext = window_context_factory::MakeGLForWin(m_hWnd, m_paras);
return TRUE;
}

void XXXDlg::OnSize(UINT nType, int cx, int cy)
{
if(m_skaContext)
m_skaContext->resize(cx, cy);
}

void XXXDlg::OnPaint()
{
sk_sp<SkSurface> backbuffer = m_skaContext->getBackbufferSurface();
if (backbuffer) {
SkCanvas* c = backbuffer->getCanvas();
c->clear(SK_ColorWHITE);
SkPaint p(SkColors::kBlack);
c->drawLine(SkPoint::Make(0, 0), SkPoint::Make(m_skaContext->width(), m_skaContext->height()), p);

static const char message[] = "Hello World";

SkFont font;
font.setSubpixel(true);
font.setSize(20);
c->drawSimpleText(message, strlen(message), SkTextEncoding::kUTF8, 0, m_skaContext->height() -2, font, p);
backbuffer->flush();

m_skaContext->swapBuffers();
}
}

7. If everything is OK, the result will be:




brent 2020-02-07 07:53 发表评论
]]>
polygon offset demo (Fifth and Final version) (Updated)http://www.shnenglu.com/aqazero/archive/2010/09/09/126241.htmlbrentbrentThu, 09 Sep 2010 07:27:00 GMThttp://www.shnenglu.com/aqazero/archive/2010/09/09/126241.htmlhttp://www.shnenglu.com/aqazero/comments/126241.htmlhttp://www.shnenglu.com/aqazero/archive/2010/09/09/126241.html#Feedback20http://www.shnenglu.com/aqazero/comments/commentRss/126241.htmlhttp://www.shnenglu.com/aqazero/services/trackbacks/126241.htmlhttp://www.shnenglu.com/Files/aqazero/OffsetDemo6.zip



brent 2010-09-09 15:27 发表评论
]]>
Polygon offset demo (3rd)http://www.shnenglu.com/aqazero/archive/2010/09/05/125942.htmlbrentbrentSun, 05 Sep 2010 10:01:00 GMThttp://www.shnenglu.com/aqazero/archive/2010/09/05/125942.htmlhttp://www.shnenglu.com/aqazero/comments/125942.htmlhttp://www.shnenglu.com/aqazero/archive/2010/09/05/125942.html#Feedback1http://www.shnenglu.com/aqazero/comments/commentRss/125942.htmlhttp://www.shnenglu.com/aqazero/services/trackbacks/125942.html

http://www.shnenglu.com/Files/aqazero/OffsetDemo6.zip



brent 2010-09-05 18:01 发表评论
]]>
Polygon Offset Demo (Updated)http://www.shnenglu.com/aqazero/archive/2010/09/04/125861.htmlbrentbrentSat, 04 Sep 2010 03:25:00 GMThttp://www.shnenglu.com/aqazero/archive/2010/09/04/125861.htmlhttp://www.shnenglu.com/aqazero/comments/125861.htmlhttp://www.shnenglu.com/aqazero/archive/2010/09/04/125861.html#Feedback6http://www.shnenglu.com/aqazero/comments/commentRss/125861.htmlhttp://www.shnenglu.com/aqazero/services/trackbacks/125861.html

http://www.shnenglu.com/Files/aqazero/OffsetDemo6.zip



brent 2010-09-04 11:25 发表评论
]]>
Polygon Offset Demohttp://www.shnenglu.com/aqazero/archive/2010/09/02/125691.htmlbrentbrentThu, 02 Sep 2010 14:25:00 GMThttp://www.shnenglu.com/aqazero/archive/2010/09/02/125691.htmlhttp://www.shnenglu.com/aqazero/comments/125691.htmlhttp://www.shnenglu.com/aqazero/archive/2010/09/02/125691.html#Feedback0http://www.shnenglu.com/aqazero/comments/commentRss/125691.htmlhttp://www.shnenglu.com/aqazero/services/trackbacks/125691.html

http://www.shnenglu.com/Files/aqazero/OffsetDemo6.zip



brent 2010-09-02 22:25 发表评论
]]>
Speed test: deflation of random 500 points and 1000 points polygon.http://www.shnenglu.com/aqazero/archive/2010/09/01/125505.htmlbrentbrentWed, 01 Sep 2010 02:29:00 GMThttp://www.shnenglu.com/aqazero/archive/2010/09/01/125505.htmlhttp://www.shnenglu.com/aqazero/comments/125505.htmlhttp://www.shnenglu.com/aqazero/archive/2010/09/01/125505.html#Feedback0http://www.shnenglu.com/aqazero/comments/commentRss/125505.htmlhttp://www.shnenglu.com/aqazero/services/trackbacks/125505.html

http://www.shnenglu.com/Files/aqazero/OffsetDemo5_8.zip


 



brent 2010-09-01 10:29 发表评论
]]>
Polygon offset with holes (Expansion and Deflation of polygons with holes)http://www.shnenglu.com/aqazero/archive/2010/09/01/125497.htmlbrentbrentWed, 01 Sep 2010 02:03:00 GMThttp://www.shnenglu.com/aqazero/archive/2010/09/01/125497.htmlhttp://www.shnenglu.com/aqazero/comments/125497.htmlhttp://www.shnenglu.com/aqazero/archive/2010/09/01/125497.html#Feedback0http://www.shnenglu.com/aqazero/comments/commentRss/125497.htmlhttp://www.shnenglu.com/aqazero/services/trackbacks/125497.html

http://www.shnenglu.com/Files/aqazero/OffsetDemo6.zip



brent 2010-09-01 10:03 发表评论
]]>
多边形等距线法的实?/title><link>http://www.shnenglu.com/aqazero/archive/2010/08/25/124744.html</link><dc:creator>brent</dc:creator><author>brent</author><pubDate>Wed, 25 Aug 2010 15:10:00 GMT</pubDate><guid>http://www.shnenglu.com/aqazero/archive/2010/08/25/124744.html</guid><wfw:comment>http://www.shnenglu.com/aqazero/comments/124744.html</wfw:comment><comments>http://www.shnenglu.com/aqazero/archive/2010/08/25/124744.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.shnenglu.com/aqazero/comments/commentRss/124744.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/aqazero/services/trackbacks/124744.html</trackback:ping><description><![CDATA[<p><a title=http://www.shnenglu.com/Files/aqazero/OffsetDemo6.zip href="http://www.shnenglu.com/Files/aqazero/OffsetDemo6.zip">http://www.shnenglu.com/Files/aqazero/OffsetDemo6.zip</a></p> <img src ="http://www.shnenglu.com/aqazero/aggbug/124744.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/aqazero/" target="_blank">brent</a> 2010-08-25 23:10 <a href="http://www.shnenglu.com/aqazero/archive/2010/08/25/124744.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>simulate OnIdle in MFC ActiveX controlhttp://www.shnenglu.com/aqazero/archive/2010/04/15/112672.htmlbrentbrentThu, 15 Apr 2010 07:49:00 GMThttp://www.shnenglu.com/aqazero/archive/2010/04/15/112672.htmlhttp://www.shnenglu.com/aqazero/comments/112672.htmlhttp://www.shnenglu.com/aqazero/archive/2010/04/15/112672.html#Feedback0http://www.shnenglu.com/aqazero/comments/commentRss/112672.htmlhttp://www.shnenglu.com/aqazero/services/trackbacks/112672.html
Method A:
::SetWindowsHookEx(WH_FOREGROUNDIDLE, YourIdleProc, AfxGetInstanceHandle(), GetCurrentThreadId());

Method B (my way):
 1 static HHOOK s_hGetMsgHook = NULL;
 2 
 3 LRESULT FAR PASCAL GetMsgProc(int nCode, WPARAM wParam, LPARAM lParam)
 4 {
 5     AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
 6 
 7     LPMSG lpMsg = (LPMSG) lParam;
 8     if( (nCode >= 0&& PM_REMOVE == wParam)
 9     {
10         //your code here. maybe to deal with hot-keys, accelerators ...
11         //see http://support.microsoft.com/kb/187988
12 
13         //my code to simulate OnIdle
14         static BOOL bIdle = FALSE;
15         CWinApp* pApp = AfxGetApp();
16         if(!bIdle && pApp->IsIdleMessage(lpMsg))
17             bIdle = TRUE;
18         
19         if(bIdle)
20         {
21             MSG msgPeek = {0};
22             if(!::PeekMessage(&msgPeek, NULL, NULL, NULL, PM_NOREMOVE))
23             {
24                 VERIFY(PostMessage(AfxGetMainWnd()->GetSafeHwnd(), WM_USER+0x120x340x56));
25             }
26         }
27 
28         if(lpMsg->hwnd == AfxGetMainWnd()->GetSafeHwnd() &&
29             lpMsg->message == WM_USER+0x12 && lpMsg->wParam == 0x34 && lpMsg->lParam == 0x56)
30         {
31             lpMsg->message = WM_NULL;
32             lpMsg->lParam = 0L;
33             lpMsg->wParam = 0L;
34 
35             pApp->OnIdle(0);
36             bIdle = FALSE;
37         }
38     }
39 
40     return ::CallNextHookEx(s_hGetMsgHook, nCode, wParam, lParam);
41 }
42 
43 int CYourOleControl::OnCreate(LPCREATESTRUCT lpCreateStruct) 
44 {
45     //...
46     
47     if(NULL == s_hGetMsgHook)
48         s_hGetMsgHook = ::SetWindowsHookEx(WH_GETMESSAGE, GetMsgProc, AfxGetInstanceHandle(), GetCurrentThreadId());
49 }
50 
51 void CYourOleControl::OnDestroy() 
52 {
53     //...
54     
55     ::UnhookWindowsHookEx(s_hGetMsgHook);
56     s_hGetMsgHook = NULL;
57 
58     COleControl::OnDestroy();
59 }

Method A is far more simple, but with Method B:

1) You can override CWinApp::IsIdleMessage to filter some special messages, such as a frequent timer which will not affect what you want to do in CWinApp::OnIdle. Because timer will affect message queue and if you don't filter it, OnIdle will be called every time after the timer is invoked.

2) Sometimes your action in OnIdle will affect message queue inevitably, thus you will get a infinite loop: OnIdle->the special messages in message queue->OnIdle->... But with Method B, with SPY++ you can find the special messages, and filter them in IsIdleMessage.


brent 2010-04-15 15:49 发表评论
]]>
q是个很狡猾的bug?/title><link>http://www.shnenglu.com/aqazero/archive/2010/03/04/108868.html</link><dc:creator>brent</dc:creator><author>brent</author><pubDate>Thu, 04 Mar 2010 03:12:00 GMT</pubDate><guid>http://www.shnenglu.com/aqazero/archive/2010/03/04/108868.html</guid><wfw:comment>http://www.shnenglu.com/aqazero/comments/108868.html</wfw:comment><comments>http://www.shnenglu.com/aqazero/archive/2010/03/04/108868.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.shnenglu.com/aqazero/comments/commentRss/108868.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/aqazero/services/trackbacks/108868.html</trackback:ping><description><![CDATA[某天Q?发现一个bugQ?会导致release版本下异常, 但在debug版本下正常, 可以定位该bug在下面代码中Q?br> <div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #0000ff;">void</span><span style="color: #000000;"> CMoveHandlerStateDraw::OnLButtonUp(UINT nFlags, CPoint point)<br>{<br>    <img src="http://www.shnenglu.com/Images/dot.gif"><br>    <br>    AdjustPoint(point);<br><br>    m_pHandler</span><span style="color: #000000;">-></span><span style="color: #000000;">Drop(point, m_ptHandlerPos);<br><br>    <img src="http://www.shnenglu.com/Images/dot.gif"><br>}</span></div> 但是Q一旦往q个函数中插入用来dump数据的代码, bug׃再出玎ͼ 不论是将数据写到文gq是昄在messagebox上?<br>启用release版本?Debug Information"Q?bug也不再出现?br>q只是?span style="color: #000000;">该函C声明一个CString变量Q?q个狡猾的bugg马上q道,马上phQ?把这个变量一LQ?它马上又跑出来了?br><br>但后来发玎ͼ q只是一只很普通的bugQ根本没什么超能力?br><br>聪明的你Q知道这是ؓ什么吗Q?br><br></span> <img src ="http://www.shnenglu.com/aqazero/aggbug/108868.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/aqazero/" target="_blank">brent</a> 2010-03-04 11:12 <a href="http://www.shnenglu.com/aqazero/archive/2010/03/04/108868.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>vista windows 7 areo progress barhttp://www.shnenglu.com/aqazero/archive/2009/11/06/100283.htmlbrentbrentFri, 06 Nov 2009 03:56:00 GMThttp://www.shnenglu.com/aqazero/archive/2009/11/06/100283.htmlhttp://www.shnenglu.com/aqazero/comments/100283.htmlhttp://www.shnenglu.com/aqazero/archive/2009/11/06/100283.html#Feedback0http://www.shnenglu.com/aqazero/comments/commentRss/100283.htmlhttp://www.shnenglu.com/aqazero/services/trackbacks/100283.html
http://stackoverflow.com/questions/313792/disabling-progress-bar-animation-on-vista-aero
http://msdn.microsoft.com/en-us/library/aa511486.aspx

?meters"? 没空啊?br>
我的暴力Ҏ是:
g_xpStyle.SetWindowTheme(m_hProgressWnd, L"",L"");

g_xpStyle 是那个 CVisualStylesXPQ?google 一下就有了?br>

brent 2009-11-06 11:56 发表评论
]]>
从资源中加蝲jpg, png到GDI+ Imagehttp://www.shnenglu.com/aqazero/archive/2009/11/05/100221.htmlbrentbrentThu, 05 Nov 2009 08:01:00 GMThttp://www.shnenglu.com/aqazero/archive/2009/11/05/100221.htmlhttp://www.shnenglu.com/aqazero/comments/100221.htmlhttp://www.shnenglu.com/aqazero/archive/2009/11/05/100221.html#Feedback0http://www.shnenglu.com/aqazero/comments/commentRss/100221.htmlhttp://www.shnenglu.com/aqazero/services/trackbacks/100221.html
1Q?是Bitmap(RT_BITMAP)cd的图片无法加载, RT_BITMAP是预定义cdQ?资源里面没有bmp文g的头Q?SizeofResource 的返回D比图片文?/span>几个字节,因ؓ了q几个字节, 所以GDI+会返回invalid parameter错误?br>
2Q??span style="color: #000000;">IStream
里面创徏出来的Image对象g会引用到堆里面的内存Q?如果hBuffer被释放了Q?创徏的Image的内容就会被破坏Q有时只能画Z部分图片, 有时整个囄是I白Q?视当时的内存状况而定。调用Image的Clone也没用?br>

CYourClass::~CYourClass()
{
    
for(IMG_VECTOR::iterator it = m_arImage.begin(); it != m_arImage.end(); it++)
        delete 
*it;
    
for(HGLB_VECTOR::iterator it = m_arGlobal.begin(); it != m_arGlobal.end(); it++)
    {
        ::GlobalUnlock(
*it);
        ::GlobalFree(
*it);
    }
}

void CYourClass::AddImage(HMODULE hInst, UINT nResourceID, LPCTSTR lpType)
{
    
if(lpType == RT_BITMAP)
    {
        
//GDI+ can not load RT_BITMAP resouce, 
        
//because they are predefined resource, 
        
//they don't contains the image file header.
        assert(FALSE);
        
return;
    }

    HRSRC hResource 
= ::FindResource(hInst, MAKEINTRESOURCE(nResourceID), lpType);
    
if (!hResource)
        
return;

    DWORD imageSize 
= ::SizeofResource(hInst, hResource);
    
if (!imageSize)
        
return;

    
const void* pResourceData = ::LockResource(::LoadResource(hInst, hResource));
    
if (!pResourceData)
        
return;

    HGLOBAL hBuffer 
= ::GlobalAlloc(GMEM_FIXED, imageSize);
    
if (NULL == hBuffer)
        
return;

    
void* pBuffer = ::GlobalLock(hBuffer);
    
if (pBuffer)
    {
        CopyMemory(pBuffer, pResourceData, imageSize);
        IStream
* pStream = NULL;
        
if (::CreateStreamOnHGlobal(hBuffer, FALSE, &pStream) == S_OK)
        {
            Gdiplus::Image 
* pImage = Gdiplus::Image::FromStream(pStream);
            pStream
->Release();
            
if (pImage)
            { 
                
if (pImage->GetLastStatus() == Gdiplus::Ok &&
                    pImage
->GetWidth() > 0)
                {
                    m_arImage.push_back(pImage);
                    
//it seems the image will take usage of the global memory.
                    
//so the global memory should be kept until the image destroy.
                    m_arGlobal.push_back(hBuffer);
                    
return;
                }

                delete pImage;
            }
        }
        ::GlobalUnlock(hBuffer);
    }
    ::GlobalFree(hBuffer);
}



brent 2009-11-05 16:01 发表评论
]]>
恨不盔R未嫁时http://www.shnenglu.com/aqazero/archive/2009/10/29/99731.htmlbrentbrentThu, 29 Oct 2009 03:56:00 GMThttp://www.shnenglu.com/aqazero/archive/2009/10/29/99731.htmlhttp://www.shnenglu.com/aqazero/comments/99731.htmlhttp://www.shnenglu.com/aqazero/archive/2009/10/29/99731.html#Feedback0http://www.shnenglu.com/aqazero/comments/commentRss/99731.htmlhttp://www.shnenglu.com/aqazero/services/trackbacks/99731.htmlbcgcontrolbar

Z间最痛苦的事莫过于此?br>


brent 2009-10-29 11:56 发表评论
]]>
create mfc dialog by template will drive you mad.http://www.shnenglu.com/aqazero/archive/2008/11/19/67287.htmlbrentbrentWed, 19 Nov 2008 07:10:00 GMThttp://www.shnenglu.com/aqazero/archive/2008/11/19/67287.htmlhttp://www.shnenglu.com/aqazero/comments/67287.htmlhttp://www.shnenglu.com/aqazero/archive/2008/11/19/67287.html#Feedback0http://www.shnenglu.com/aqazero/comments/commentRss/67287.htmlhttp://www.shnenglu.com/aqazero/services/trackbacks/67287.html
And now, sometimes , i need CMyDialog to be a model dialog (WS_POPUP), sometimes be a child of another dialog(WS_CHILD).

How to make this done without duplicating the template in resource?

Call ModifyStyle after creation? Failed
Modify the LPCREATESTRUCT's style in CMyDialog::OnCreate ? Failed.
Override PreCreateWindow? Failed.

After a lot of tracing and a lot of googling. I worked out something like this:

BOOL CMyDialog::CreateAsChild(CWnd * pParent)
{
    
if(!IsWindow(pParent->GetSafeHwnd()))
        
return FALSE;

    m_lpszTemplateName 
= ATL_MAKEINTRESOURCE(IDD_WALLLAYER_PROPERTYPAGE);  // used for help
    if (m_nIDHelp == 0)
        m_nIDHelp 
= LOWORD((DWORD_PTR)m_lpszTemplateName);

    HINSTANCE hInst 
= AfxFindResourceHandle(m_lpszTemplateName, RT_DIALOG);
    HRSRC hResource 
= ::FindResource(hInst, m_lpszTemplateName, RT_DIALOG);
    HGLOBAL hTemplate 
= LoadResource(hInst, hResource);
    LPCDLGTEMPLATE lpDialogTemplate 
= (LPCDLGTEMPLATE)LockResource(hTemplate);
    DLGTEMPLATEEX
* lpDlgTmpEx = (DLGTEMPLATEEX* )lpDialogTemplate;
    DWORD dwOldStyle 
= 0;
    BOOL bIsDlgEx 
= lpDlgTmpEx->signature == 0xFFFF;
    
if(bIsDlgEx)
    {
        dwOldStyle 
= lpDlgTmpEx->style;
        lpDlgTmpEx
->style = DS_SETFONT | WS_CHILD;
    }
    
else
    {
        dwOldStyle 
= ((LPDLGTEMPLATE)lpDialogTemplate)->style;
        ((LPDLGTEMPLATE)lpDialogTemplate)
->style = DS_SETFONT | WS_CHILD;
    }
    m_lpDialogInit 
= NULL;
    BOOL bResult 
= CreateDlgIndirect(lpDialogTemplate, pParent, hInst);
    
if(bIsDlgEx)
        lpDlgTmpEx
->style = dwOldStyle;
    
else
        ((LPDLGTEMPLATE)lpDialogTemplate)
->style = dwOldStyle;
    UnlockResource(hTemplate);
    FreeResource(hTemplate);
    
return bResult;
}

If you need your dialog to behavior as WS_POPUP or WS_CHILD without duplicating your dialog template, you just get an ugly answer. And anyone who know another better way, let me know please.

MFC


brent 2008-11-19 15:10 发表评论
]]>
囑Ş文本~辑器的源码和简单文?/title><link>http://www.shnenglu.com/aqazero/archive/2008/08/27/60165.html</link><dc:creator>brent</dc:creator><author>brent</author><pubDate>Wed, 27 Aug 2008 08:05:00 GMT</pubDate><guid>http://www.shnenglu.com/aqazero/archive/2008/08/27/60165.html</guid><wfw:comment>http://www.shnenglu.com/aqazero/comments/60165.html</wfw:comment><comments>http://www.shnenglu.com/aqazero/archive/2008/08/27/60165.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.shnenglu.com/aqazero/comments/commentRss/60165.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/aqazero/services/trackbacks/60165.html</trackback:ping><description><![CDATA[我说的图形文本编辑器不是U文本编辑,?<a target="_blank" title="自己实现囑Ş文本~辑? href="http://www.shnenglu.com/aqazero/archive/2006/12/01/15835.html">自己实现囑Ş文本~辑?/a> 或?<a target="_blank" title="Graphical text proposal (draft)" >Graphical Text Proposal (Draft)</a><br><br><a target="_blank" title="Demo 地址" href="http://www.shnenglu.com/Files/aqazero/BrentEditor_demo.zip">Demo EXE 地址</a> (无公宻I因ؓ是用wxWidgetsQ连Icon都没有,l常把hl吓着了。该E序对硬件无要求Q对使用者有一定要?..)<br><br><a target="_blank" title="源代? href="http://www.shnenglu.com/Files/aqazero/BrentEditor.rar">源代码地址</a><br><br>~译需?a target="_blank" title="wxWidgets" >wxWidgets</a>。在q之后再没用qwxWidgets了,感觉是另一套MFC?br><br>抓个?<br><img src="http://www.shnenglu.com/images/cppblog_com/aqazero/editor.JPG" border="0"><br><br>写到Table和导出html部分的时候就力不从心了,草草了事?导出html是做得最人模狗样Q但却最败Q其中的部分?英文版操作系l下导出html会crashQ原因未?<br><br>一直有用C#重新写一个的冲动Q只是到时一定又是虎头蛇?br> <img src ="http://www.shnenglu.com/aqazero/aggbug/60165.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/aqazero/" target="_blank">brent</a> 2008-08-27 16:05 <a href="http://www.shnenglu.com/aqazero/archive/2008/08/27/60165.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>谁能告诉我有没有E序员专用键盘?我要C++语法的U?_-!http://www.shnenglu.com/aqazero/archive/2008/06/06/52365.htmlbrentbrentFri, 06 Jun 2008 07:00:00 GMThttp://www.shnenglu.com/aqazero/archive/2008/06/06/52365.htmlhttp://www.shnenglu.com/aqazero/comments/52365.htmlhttp://www.shnenglu.com/aqazero/archive/2008/06/06/52365.html#Feedback4http://www.shnenglu.com/aqazero/comments/commentRss/52365.htmlhttp://www.shnenglu.com/aqazero/services/trackbacks/52365.html
http://www.kaufmann.no/roland/dvorak/

take your time and enjoy yourself -_-!



brent 2008-06-06 15:00 发表评论
]]>
Create projects easily with private MFC, ATL and CRT assemblieshttp://www.shnenglu.com/aqazero/archive/2008/05/21/50660.htmlbrentbrentWed, 21 May 2008 09:51:00 GMThttp://www.shnenglu.com/aqazero/archive/2008/05/21/50660.htmlhttp://www.shnenglu.com/aqazero/comments/50660.htmlhttp://www.shnenglu.com/aqazero/archive/2008/05/21/50660.html#Feedback0http://www.shnenglu.com/aqazero/comments/commentRss/50660.htmlhttp://www.shnenglu.com/aqazero/services/trackbacks/50660.htmlhttp://www.codeproject.com/KB/cpp/PrivateAssemblyProjects.aspx

"$(DevEnvDir)..\..\VC\bin\mt.exe" -manifest "$(TargetDir)release.manifest"  –outputresource:"$(TargetDir)$(TargetFileName)";#1

release.manifest:
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.762' processorArchitecture='x86' />
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type='win32' name='Microsoft.VC80.MFC' version='8.0.50727.762' processorArchitecture='x86' />
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*' />
    </dependentAssembly>
  </dependency>
</assembly>

copy  C:\WINDOWS\WinSxS\Manifests\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700.manifest   D:\xxProject\bin\release\Microsoft.VC80.CRT.manifest

copy C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700\*.*  D:\xxProject\bin\release\


copy  C:\WINDOWS\WinSxS\Manifests\x86_Microsoft.VC80.MFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_3bf8fa05.manifest  D:\xxProject\bin\release\Microsoft.VC80.MFC.manifest

copy C:\WINDOWS\WinSxS\x86_Microsoft.VC80.MFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_3bf8fa05\*.*  D:\xxProject\bin\release\


brent 2008-05-21 17:51 发表评论
]]>
令h发中指的代码http://www.shnenglu.com/aqazero/archive/2008/05/11/49502.htmlbrentbrentSun, 11 May 2008 03:09:00 GMThttp://www.shnenglu.com/aqazero/archive/2008/05/11/49502.htmlhttp://www.shnenglu.com/aqazero/comments/49502.htmlhttp://www.shnenglu.com/aqazero/archive/2008/05/11/49502.html#Feedback2http://www.shnenglu.com/aqazero/comments/commentRss/49502.htmlhttp://www.shnenglu.com/aqazero/services/trackbacks/49502.htmlclass CFEPBaseView
{
    CFepBaseView()
    {
       m_pCoord 
= new Coord();
    }
protected:
   CCoord 
* m_pCoord;
}

class CCutListView : public CFEPBaseView
{
    CCutListView()
    {
        m_pCoord 
= new Coord();
    }
protected:
    CCoord 
* m_pCoord;
}



brent 2008-05-11 11:09 发表评论
]]>
ie helper, great!http://www.shnenglu.com/aqazero/archive/2008/03/13/44374.htmlbrentbrentThu, 13 Mar 2008 07:29:00 GMThttp://www.shnenglu.com/aqazero/archive/2008/03/13/44374.htmlhttp://www.shnenglu.com/aqazero/comments/44374.htmlhttp://www.shnenglu.com/aqazero/archive/2008/03/13/44374.html#Feedback0http://www.shnenglu.com/aqazero/comments/commentRss/44374.htmlhttp://www.shnenglu.com/aqazero/services/trackbacks/44374.html

brent 2008-03-13 15:29 发表评论
]]>
render whole html pagehttp://www.shnenglu.com/aqazero/archive/2007/10/11/33986.htmlbrentbrentThu, 11 Oct 2007 15:57:00 GMThttp://www.shnenglu.com/aqazero/archive/2007/10/11/33986.htmlhttp://www.shnenglu.com/aqazero/comments/33986.htmlhttp://www.shnenglu.com/aqazero/archive/2007/10/11/33986.html#Feedback0http://www.shnenglu.com/aqazero/comments/commentRss/33986.htmlhttp://www.shnenglu.com/aqazero/services/trackbacks/33986.htmlHi,
I'm trying to render the contents of a HTML page hosted in a web
browser control so that I can save the result as an image.

There are a number of ways to do this. For example you can use any of
IHTMLElementRender,­ IViewObject or WM_PRINT. The problem with these
methods is that you only will receive the portion of the page's content
that is visible in the web browser. If the page's size is bigger than
the dimensions of the web browser these hidden or "scrollable" parts
will not get rendered in the above methods.

You could resize the browser to fit the entire page but that is not
feasible in a scenario when a user is using the browser. A second
approach is to load the page into a second hidden browser which, again,
is resized to fit the entire page. The problem with this approach is
that I can't load the document again since it's appearance could
change. I want to render exactly what's in the user's browser. AFAIK
there is know easy way to exactly clone a MSHTML document.

Does anyone (Igor?) have any clues how these "hidden" ares could be
rendered? Any help much appreciated.

Regards,
Christoffer
 
Answer:
    I took a couple of ideas from Code Project and pieced them together to
do just this. I render the client area into a small bitmap, blit it
into a final larger (page size) bitmap and scroll the control to get at
another area. This was simpler than trying to get it to render into
the correct area of the page size bitmap.

This was written for a browser control that was NOT seen by the user so
I didn't care where the final scroll position was.

1. From the IHTMLDocument interface call get_body to get the
IHTMLElement enterface.
2. Get the IHTMLElement2 interface (pBody2 in the code).
3. Call get_scrollHeight and get_scrollWidth, get_clientWidth,
get_clientHeight.
4. Get the IHTMLElementRender interface (pRenderer in the code).
5. Create a bitmap the size of the client area and select it into a
clientDC.
6. Create a bitmap the size of the scroll area and select it into a
pageDC.
7. Use some code like the following to scroll and render the page:

long x = scrollWidth;
long lastX = -1;
bool doneX = false;
while (!doneX)
{
    pBody2->put_scrollLeft(x);
    pBody2->get_scrollLeft(&x);
    if (-1 == lastX)
    lastX = x + clientWidth;
    long y = scrollHeight;
    long lastY = -1;
    bool doneY = false;
    while (!doneY)
    {
        pBody2->put_scrollTop(y);
        pBody2->get_scrollTop(&y);
        if (-1 == lastY)
        lastY = y + clientHeight;
        hr = pRenderer->DrawToDC­(clientDC);
        BitBlt(pageDC,x,y,lastX-x,lastY-y,clientDC,2,2,SRCCOPY);
        doneY = (y==0);
        lastY = y;
        y -= clientHeight-4;
    }
    doneX = (0==x);
    lastX = x;
    x -= clientWidth-4;
}

The pageDC bitmap now holds the full image of the page and you can save
it or do anything else you want. You'll note that what I'm doing is
trying to scroll too far and letting IE scroll appropriately. Also
note that I clip a 2 pixel edge when blitting. This is from actual
testing - needed to not clip the border of the control.

Hope this helps,

David Stidolph
Austin, TX

Ask:
    Thanks for the solution, but it will unfortunately not work in my case
because the control is used by a user and can therefor not be scrolled
programmatically.

My focus now is on trying to clone the MSHTML document and then load
the clone in another hidden browser contol which I can resize to fit
the entire page and then do the rendering. The way I'm currently
cloning the document is saving the HTML to disk and then replacing all
references (images, .js, .css., ...) in the HTML document with local
ones which I have downloaded from the originating server (will do this
as a last resort), the cache or (in the cases where it's possible)
copied directly from the MSHTML document. When that is done I have a
local copy which a can browse to. Does anyone know of a better way to
clone a MSHTML document?

Answer:
    How about using a LockWindowUpdate call before the snapshot and
then unlocking it after? That way, the user never knows the WB
scrolled.


brent 2007-10-11 23:57 发表评论
]]>
note Algorithm book, sql server download, .net context help, activex hotkey/ acceleratorhttp://www.shnenglu.com/aqazero/archive/2007/09/14/32214.htmlbrentbrentFri, 14 Sep 2007 08:13:00 GMThttp://www.shnenglu.com/aqazero/archive/2007/09/14/32214.htmlhttp://www.shnenglu.com/aqazero/comments/32214.htmlhttp://www.shnenglu.com/aqazero/archive/2007/09/14/32214.html#Feedback0http://www.shnenglu.com/aqazero/comments/commentRss/32214.htmlhttp://www.shnenglu.com/aqazero/services/trackbacks/32214.html
a great book about Algorithm  http://www2.toki.or.id/book/AlgDesignManual/INDEX.HTM

sql server developer
http://beta.verycd.com/groups/@g19046/135284.topic
http://beta.verycd.com/groups/@g19046/64613.topic


A great idea about context help:
1)http://www.codeproject.com/csharp/ContextHelpMadeEasy.asp
2)http://netpl.blogspot.com/2007/07/context-help-made-easy-revisited.html


How to deal with hotkey / accelerator keys in activex
http://support.microsoft.com/?scid=kb;EN-US;Q187988

You know how to google ,you know almost every thing.


brent 2007-09-14 16:13 发表评论
]]>
文本替换工具http://www.shnenglu.com/aqazero/archive/2007/03/15/19870.htmlbrentbrentThu, 15 Mar 2007 03:05:00 GMThttp://www.shnenglu.com/aqazero/archive/2007/03/15/19870.htmlhttp://www.shnenglu.com/aqazero/comments/19870.htmlhttp://www.shnenglu.com/aqazero/archive/2007/03/15/19870.html#Feedback0http://www.shnenglu.com/aqazero/comments/commentRss/19870.htmlhttp://www.shnenglu.com/aqazero/services/trackbacks/19870.html    1,Search
    2,在list中选定要替换的文g和行
    3,Replace
    4,双击list可用选定~辑器打开。如果用notepad++可直接定位到行?br />

囄:
batchStrReplace.JPG

源代?br />    http://www.shnenglu.com/Files/aqazero/BatchStrReplace.zip


brent 2007-03-15 11:05 发表评论
]]>
调试ISAPIhttp://www.shnenglu.com/aqazero/archive/2006/12/19/16604.htmlbrentbrentTue, 19 Dec 2006 02:24:00 GMThttp://www.shnenglu.com/aqazero/archive/2006/12/19/16604.htmlhttp://www.shnenglu.com/aqazero/comments/16604.htmlhttp://www.shnenglu.com/aqazero/archive/2006/12/19/16604.html#Feedback0http://www.shnenglu.com/aqazero/comments/commentRss/16604.htmlhttp://www.shnenglu.com/aqazero/services/trackbacks/16604.htmlIUSR_[COMPUTERNAME]和IWAM_[COMPUTERNAME]d到amdministratorsl?br />
理工具-本地安全{略-本地{略-用户权利指派
以操作系l方式操作?d      INTERACTIVE, IUSR_[COMPUTERNAME], IWAM_[COMPUTERNAME]
作ؓ服务d        d      INTERACTIVE, IUSR_[COMPUTERNAME], IWAM_[COMPUTERNAME]
调试E序            d      INTERACTIVE, IUSR_[COMPUTERNAME], IWAM_[COMPUTERNAME]

重新启动计算机,以用户权限讄生效?br />
2Q设|Web服务
服务
IIS Admin Service
Simple Mail Transport Protocol (SMTP)
FTP Publishing Service
World Wide Web Publishing Service
的启动方?>手动?br />
讄 IIS Admin Service  dw䆾设ؓ本地pȝ帐号Qƈ允许与桌面交?br />
打开理工具-Internet 服务理器,讄要允许调试的虚拟目录的属?
执行?>脚本和可执行E序
应用E序保护->?IISq程)

启动默认Web站点(必须Web服务Ȁz,否则调试时虽然运行了inetinfo.exeQ但不会q行Web服务)

3Q配|VC project
Project-setting-Debug
Executable for debug session : C:\WINNT\system32\inetsrv\inetinfo.exe
Program argument : -e w3svc

4Q调?br />执行命o?iisreset /stop

修改注册表信?
REGEDIT4

[HKEY_CLASSES_ROOT\AppID\{61738644-F196-11D0-9953-00C04FD919C1}]
"LocalService"=-
"RunAs"=-

[HKEY_CLASSES_ROOT\AppID\{9F0BD3A0-EC01-11D0-A6A0-00A0C922E752}]
"LocalService"=-
"RunAs"=-

[HKEY_CLASSES_ROOT\AppID\{A9E69610-B80D-11D0-B9B9-00A0C922E750}]
"LocalService"=-
"RunAs"="Interactive User"

以上注册表信息保存?reg文g双击卛_?br />
可以开始在VC中调试了Q按F5..

5,恢复环境
按Shift + F5中断调试?br />
恢复注册表信息:
REGEDIT4

[HKEY_CLASSES_ROOT\AppID\{61738644-F196-11D0-9953-00C04FD919C1}]
"LocalService"="IISADMIN"
"RunAs"=-

[HKEY_CLASSES_ROOT\AppID\{9F0BD3A0-EC01-11D0-A6A0-00A0C922E752}]
"LocalService"="IISADMIN"
"RunAs"=-

[HKEY_CLASSES_ROOT\AppID\{A9E69610-B80D-11D0-B9B9-00A0C922E750}]
"LocalService"="IISADMIN"
"RunAs"=-

执行命o?iisreset /start

可能需要用到的.reg .bat
http://www.shnenglu.com/Files/aqazero/iisIsapiDebug.zip

更详l信?
http://xmlrad.com/DelosBin/Delos.dll/ServePage?URL=Manual/Appendix07/index.htm&WEB_ID=101001015


brent 2006-12-19 10:24 发表评论
]]>
自己实现囑Ş文本~辑?/title><link>http://www.shnenglu.com/aqazero/archive/2006/12/01/15835.html</link><dc:creator>brent</dc:creator><author>brent</author><pubDate>Fri, 01 Dec 2006 02:06:00 GMT</pubDate><guid>http://www.shnenglu.com/aqazero/archive/2006/12/01/15835.html</guid><wfw:comment>http://www.shnenglu.com/aqazero/comments/15835.html</wfw:comment><comments>http://www.shnenglu.com/aqazero/archive/2006/12/01/15835.html#Feedback</comments><slash:comments>9</slash:comments><wfw:commentRss>http://www.shnenglu.com/aqazero/comments/commentRss/15835.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/aqazero/services/trackbacks/15835.html</trackback:ping><description><![CDATA[我说的图形文本编辑器是不用windows控g如editbox,richedit之类实现文~辑Q不是纯文本~辑?br />要实现图形绘Ӟ象visio那样Q要能画表格Q象word那样Q要能导出htmlQ象word那样?br />以后要在此基上实现表单绘制和程l制?br /><br />E序目前完成了一部分:<br /><br /><a class="" title="" href="/Files/aqazero/BrentEditor_demo.zip" target="">http://www.shnenglu.com/Files/aqazero/BrentEditor_demo.zip</a><br /><br />实现的功能有Q?br /><br />1) ~辑文本<br />双击可编辑对象,进入编辑模式。在~辑模式下按ESC或者单M可编辑对象,退出编辑模式。按住鼠标移动可以选择文本Q实C上下左右键的navigationQ实C回R分段?br />没有实现对英语单词整个单词的处理。分行会发生在单词的M部分。主要考虑面对的是中文用户?br /><br />2) l制DIVQ按工具栏上的方框,直接在画布上点击拉动?br /><br />3) 支持无限undo/redoQCtrl+Z Ctrl+Y<br /><br />4) 支持文本的复制粘? Ctrl+C Ctrl+V Q剪切未实现?br /><br />5) 可以导出到html文gQ菜单File - export html<br />导出html后,排版可能和程序不同?br /><br />6) 实现了保存读?br />保存的文件其实是个压~文件?br /><br />7Q实C部分table功能<br />要调整表g前,请先选择定某单元根{?br />“绘制表格”功能目前还未支持undo/redo<br /><br />8) 目前的画布布局?flowQ对象的位置由flow法军_Q所以只能调整大,不能调整位置?br /><br />下一步将实现的是Q?br /><br />1) l制table<br /><br />2) 更改字体<br /><br />3) 更改DIV、cellҎ属性,讄填充颜色<br /><br />4) 实现absolute定位<br /><br />5) 实现折线l制Q以及智能连U?象viso中那栯接两个对象,自己拐弯的折U?<br /><br />...<br /><br />然后是l制workflowQ连接数据库{等了?br /><br />...<br /><img src ="http://www.shnenglu.com/aqazero/aggbug/15835.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/aqazero/" target="_blank">brent</a> 2006-12-01 10:06 <a href="http://www.shnenglu.com/aqazero/archive/2006/12/01/15835.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Excel addin处理学生成Whttp://www.shnenglu.com/aqazero/archive/2006/11/28/15731.htmlbrentbrentTue, 28 Nov 2006 06:40:00 GMThttp://www.shnenglu.com/aqazero/archive/2006/11/28/15731.htmlhttp://www.shnenglu.com/aqazero/comments/15731.htmlhttp://www.shnenglu.com/aqazero/archive/2006/11/28/15731.html#Feedback7http://www.shnenglu.com/aqazero/comments/commentRss/15731.htmlhttp://www.shnenglu.com/aqazero/services/trackbacks/15731.html每次都要重复一些excel插入Q复Ӟ_脓的操作,于是自作聪明地让我帮她写E序?br>Zq么点小事,让我用vc++写程?我对VBA不熟?..)Q实在是大材用啊?br>而且E序写好后还问题多多Qbug多多Q嗯Q您凑合着用吧?br>有问题就在这里留个言Q程序已l有更新功能了,我修改v来你更新h都会很方便的(但愿如此??br>
for user:
安装E序?http://www.shnenglu.com/Files/aqazero/brentExcelAddinSetup_fm.zip
excel文g格式参?http://www.shnenglu.com/Files/aqazero/example_brentAddin.zip

很烂的源码:http://www.shnenglu.com/Files/aqazero/BrentAddin.rar


brent 2006-11-28 14:40 发表评论
]]>
graphical text editor (?(内有帅图)http://www.shnenglu.com/aqazero/archive/2006/11/22/15544.htmlbrentbrentWed, 22 Nov 2006 08:42:00 GMThttp://www.shnenglu.com/aqazero/archive/2006/11/22/15544.htmlhttp://www.shnenglu.com/aqazero/comments/15544.htmlhttp://www.shnenglu.com/aqazero/archive/2006/11/22/15544.html#Feedback0http://www.shnenglu.com/aqazero/comments/commentRss/15544.htmlhttp://www.shnenglu.com/aqazero/services/trackbacks/15544.htmlgt1.jpg

gt1.jpg

gt1.jpg

gt1.jpg

gt1.jpg

gt1.jpg

gt1.jpg

gt1.jpg

gt1.jpg

gt1.jpg

gt1.jpg

gt1.jpg

gt1.jpg



brent 2006-11-22 16:42 发表评论
]]>
graphical text editorQ?/title><link>http://www.shnenglu.com/aqazero/archive/2006/10/08/13458.html</link><dc:creator>brent</dc:creator><author>brent</author><pubDate>Sun, 08 Oct 2006 08:13:00 GMT</pubDate><guid>http://www.shnenglu.com/aqazero/archive/2006/10/08/13458.html</guid><wfw:comment>http://www.shnenglu.com/aqazero/comments/13458.html</wfw:comment><comments>http://www.shnenglu.com/aqazero/archive/2006/10/08/13458.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/aqazero/comments/commentRss/13458.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/aqazero/services/trackbacks/13458.html</trackback:ping><description><![CDATA[ <p align="left">做一个文本编辑器g已经不是很难了?br />|上有很多源代码可以下蝲Q也有具体的一步步的教E?br />如:<a >http://www.catch22.net/tuts/editor01.asp</a><br /><br />但做一个graphical text editor呢?象WORD那样卛_以画表格Q也可以~辑带字体的文本?br /><img height="600" alt="drawer.jpg" src="http://www.shnenglu.com/images/cppblog_com/aqazero/drawer.jpg" width="800" border="0" /><br />图I</p> <p align="left">一开始我弄了q个(图I)用来画表?table是一个对象,包含cell对象Q以及rowInfo和colInfo。cell包含的stringQcharq不作ؓ单独的一个对象?br /><br /><br /><img height="600" alt="brenteditor1.jpg" src="http://www.shnenglu.com/images/cppblog_com/aqazero/brenteditor1.jpg" width="800" border="0" /><br />图II<br /><img height="600" alt="brenteditor2.jpg" src="http://www.shnenglu.com/images/cppblog_com/aqazero/brenteditor2.jpg" width="800" border="0" /><br />图III<br /><br />后来改写Q把每个char当成一个对象,但char对象和其它对象的compose却又成问题。?br />Range的表CZ成问题?br /><br />gtable{对象只能绝对定位,无法实现象word中表格的寚w方式和文字围l效果?/p> <p align="left">写得好篏Q有谁知道有开源的用C++写的graphical text editorQ或者自己有写的Q希望能交流一下啊?/p> <img src ="http://www.shnenglu.com/aqazero/aggbug/13458.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/aqazero/" target="_blank">brent</a> 2006-10-08 16:13 <a href="http://www.shnenglu.com/aqazero/archive/2006/10/08/13458.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>C++ q算W优先列表http://www.shnenglu.com/aqazero/archive/2006/06/08/8284.htmlbrentbrentThu, 08 Jun 2006 01:33:00 GMThttp://www.shnenglu.com/aqazero/archive/2006/06/08/8284.htmlhttp://www.shnenglu.com/aqazero/comments/8284.htmlhttp://www.shnenglu.com/aqazero/archive/2006/06/08/8284.html#Feedback18http://www.shnenglu.com/aqazero/comments/commentRss/8284.htmlhttp://www.shnenglu.com/aqazero/services/trackbacks/8284.htmlhttp://www.cppreference.com/operator_precedence.html
Precedence Operator Description Example Associativity
1 ()
[]
->
.
::
++
--
Grouping operator
Array access
Member access from a pointer
Member access from an object
Scoping operator
Post-increment
Post-decrement
(a + b) / 4;
array[4] = 2;
ptr->age = 34;
obj.age = 34;
Class::age = 2;
for( i = 0; i < 10; i++ ) ...
for( i = 10; i > 0; i-- ) ...
left to right
2 !
~
++
--
-
+
*
&
(type)
sizeof
Logical negation
Bitwise complement
Pre-increment
Pre-decrement
Unary minus
Unary plus
Dereference
Address of
Cast to a given type
Return size in bytes
if( !done ) ...
flags = ~flags;
for( i = 0; i < 10; ++i ) ...
for( i = 10; i > 0; --i ) ...
int i = -1;
int i = +1;
data = *ptr;
address = &obj;
int i = (int) floatNum;
int size = sizeof(floatNum);
right to left
3 ->*
.*
Member pointer selector
Member pointer selector
ptr->*var = 24;
obj.*var = 24;
left to right
4 *
/
%
Multiplication
Division
Modulus
int i = 2 * 4;
float f = 10 / 3;
int rem = 4 % 3;
left to right
5 +
-
Addition
Subtraction
int i = 2 + 3;
int i = 5 - 1;
left to right
6 <<
>>
Bitwise shift left
Bitwise shift right
int flags = 33 << 1;
int flags = 33 >> 1;
left to right
7 <
<=
>
>=
Comparison less-than
Comparison less-than-or-equal-to
Comparison greater-than
Comparison geater-than-or-equal-to
if( i < 42 ) ...
if( i <= 42 ) ...
if( i > 42 ) ...
if( i >= 42 ) ...
left to right
8 ==
!=
Comparison equal-to
Comparison not-equal-to
if( i == 42 ) ...
if( i != 42 ) ...
left to right
9 & Bitwise AND flags = flags & 42; left to right
10 ^ Bitwise exclusive OR flags = flags ^ 42; left to right
11 | Bitwise inclusive (normal) OR flags = flags | 42; left to right
12 && Logical AND if( conditionA && conditionB ) ... left to right
13 || Logical OR if( conditionA || conditionB ) ... left to right
14 ? : Ternary conditional (if-then-else) int i = (a > b) ? a : b; right to left
15 =
+=
-=
*=
/=
%=
&=
^=
|=
<<=
>>=
Assignment operator
Increment and assign
Decrement and assign
Multiply and assign
Divide and assign
Modulo and assign
Bitwise AND and assign
Bitwise exclusive OR and assign
Bitwise inclusive (normal) OR and assign
Bitwise shift left and assign
Bitwise shift right and assign
int a = b;
a += 3;
b -= 4;
a *= 5;
a /= 2;
a %= 3;
flags &= new_flags;
flags ^= new_flags;
flags |= new_flags;
flags <<= 2;
flags >>= 2;
right to left
16 , Sequential evaluation operator for( i = 0, j = 0; i < 10; i++, j++ ) ... left to right


brent 2006-06-08 09:33 发表评论
]]>
关于内存泄漏记录http://www.shnenglu.com/aqazero/archive/2006/06/05/8183.htmlbrentbrentMon, 05 Jun 2006 09:27:00 GMThttp://www.shnenglu.com/aqazero/archive/2006/06/05/8183.htmlhttp://www.shnenglu.com/aqazero/comments/8183.htmlhttp://www.shnenglu.com/aqazero/archive/2006/06/05/8183.html#Feedback0http://www.shnenglu.com/aqazero/comments/commentRss/8183.htmlhttp://www.shnenglu.com/aqazero/services/trackbacks/8183.html文章地址:http://www-128.ibm.com/developerworks/cn/linux/l-mleak2/index.html#main
本地文g地址:http://www.shnenglu.com/Files/aqazero/dbg_new.zip



brent 2006-06-05 17:27 发表评论
]]>
q是关于异常http://www.shnenglu.com/aqazero/archive/2006/05/31/14172.htmlbrentbrentWed, 31 May 2006 03:40:00 GMThttp://www.shnenglu.com/aqazero/archive/2006/05/31/14172.htmlhttp://www.shnenglu.com/aqazero/comments/14172.htmlhttp://www.shnenglu.com/aqazero/archive/2006/05/31/14172.html#Feedback0http://www.shnenglu.com/aqazero/comments/commentRss/14172.htmlhttp://www.shnenglu.com/aqazero/services/trackbacks/14172.htmltry{
   ...
   throw "teststring";//1
}
catch(string & rs){//2
   ...
}
惌?/2处的语句来捕?/1处的异常,当然是不对的.
正确的应该是:
catch(char * ps){ ?catch(const char * ps){

其实因ؓ"teststring"是保存在代码D中?所以应该抛出const指针
try{
   ...
   throw static_cast<const char *>("teststring");
}
catch(char * ps){//?改ؓ=> catch(const char * ps){
   ...
}
天下太^,但如果钻牛角?
try{
   ...
   throw static_cast<const char *>("teststring");//3
}
catch(const char * const& rps){//4
   ...
}
可以?~译正常,?/4无法捕获//3的异?
但ؓ什?br />try{
   ...
   throw static_cast<const string>string("teststring");//5
}
catch(const string & rs){//6
   ...
}
//6处就可以捕获?/5处的异常?br />因ؓ//5处抛出的异常cdҎ׃是const?只是string的类?br />?/3处的异常的类型的是cosnt char *
嘿嘿...

单的说异常的处理需要引入一个全局的对?
throw x;的时候用x来给q个全局对象y赋?当捕L时候在catch( type z)?用ylz赋?
如果x的类型不是指?比如string),不管它有没有帔R?y的类型都是string,而z的类型不是string q是const string都能捕获x.

但是,当x的类型是指针的时?y的类型的帔R性和x是一致的,z的类型也只有和x一致才能捕获x的异?

?/4处就是不能捕?/3的异?
也许是VC++的问?
不知道别的编译器如何.
q好用引用来捕获指针...普通h应该都不会这么做-_-
但尽量用constcd来catch,应该是个好习?

brent 2006-05-31 11:40 发表评论
]]>
Ʒþþþþù| 77777ҹþö| ۺϾþϵ| ޾ƷþרӰҵ| þ㽶97Ʒ| ձþ| 2021ƷþþƷ| þþƷоƷ| ŷþۺϾɫۺ| þþþavרˮ| þþþƷҰ| ɫۺϾþþþר| Ʒþþþ| ҹƷþþþþëƬ| Ʒþþþþþþþ| þþһƷ99þþƷ88| һֻƴƬ99þ| þþƷaĻ| ƷþӰԺ| ަvþþ| ŷ龫Ʒþþþþþþžž | Ʒxxxxˮ޹Ʒþһ | ݺݾþۺ| ɫ8þ97㽶987| þ99Ʒþþþþ| ٸþĻ| þAٸ۲ӰԺ| ݺɫۺþö| 2020˾þþƷ| þù| ƷŷþþþӰ| þ޾ƷƷ| ƷۺϾþþþþ97| þۺɫHEZYO| רþ| ĻƷѾþ| þü޾Ʒ?V| þþþþþۺۺϺݺ| þùƷһ| Ʒ׾þAAAƬ69| һɫþ88ձȡۺ|