• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            道。道。道

            安全特性不等于安全的特性

               :: 首頁 :: 聯系 :: 聚合  :: 管理

            常用鏈接

            搜索

            •  

            最新評論

            ??? When using WTL 7.0 with ActiveX controls under ATL 7.1, the framework will ASSERT inside atlcom.h on the following line:
            ??? ATLASSERT(!InlineIsEqualGUID(*m_plibid,GUID_NULL) && "Did you forget to pass the LIBID to CComModule::Init?");

            ??? This can be solved one of two ways:
            ??? 1) Change your "Use of ATL" setting to "Dynamic Link to ATL" in your project properties.
            ??? 2) Change your "Use of ATL" setting to "Static Link to ATL" and instead of using
            ??? ??
            hRes = _Module.Init(NULL, hInstance);
            ??? ?? line in your _tWinMain, use this instead:
            ???? GUID guid;
            ??? ?? hRes = _Module.Init(NULL, hInstance, &guid);

            ??? The ATLASSERT is apparently a bug in ATL 7.0/7.1 because everything works right if you pass a non-null GUID to _Module.Init(). Note that some people prefer to pass the actual LIBID instead of a garbage GUID, but this has no effect on whether the framework works correctly or not.



            ??? I was unsure whether to post this under GDI or WTL, but WTL won out since I was using CScrollImpl when I encountered this problem. On one of the views in my WTL program, I was creating controls dynamically on the output screen. This worked fine until the controls I was creating extended beyond the range of the viewport. When I kept using the same RECT coordinates for the created controls in the scrolled view, I started having all sorts of positioning and resizing problems.

            ??? Turns out that Create assumes that the RECT coordinates you specify in the call are from the top of the viewport, not the top of the window. This was not at all intuitive to me. Consequently, if you want to keep a common coordinate system when creating controls on a scrolling view, you must either 1) factor in the scroll bar offset yourself, or 2) scroll back to the top left of the window (without updating), place your controls and then scroll back to the proper position.

            ??? By default, the COM Server code that the WTL AppWizard adds does not have the _Module.RegisterServer function set to TRUE by default. As a result, the type library information never showed up in the registry. A message in the ATL Archives relayed the answer to this problem.

            ??? After trying to use extended combo boxes within a WTL app and not getting them to load, I knew I must be doing something wrong. I was initializing them with ::InitCommonControlsEx() in OnInitDialog(), which was a little too late. I moved them to DllMain, and that solved the problem. (The Microsoft ATL mailing list archives saved the day ...)

            ??? I was trying to modify a WTL frame window by using ModifyStyle in OnCreate(). WTL doesn't like this very well. Instead I discovered that I got the results I was looking for by modifying CFrameWindowImpl to take a customized version of CWinTraits by adding it to the template definition. By the way, this also works for CWindowImpl, which is where I found this trick in the MSDN docs and ATL Internals. Also, this link shows another tricky portion of the whole process.

            ??? Steps to use CDialogResize (from WTL 3.1):
            ??? 1) #include <atlframe.h> in your view/dialog class
            ??? 2) derive your view/dialog from CDialogResize:
            ??????? class CMyClass: public CDialogImpl<CMyClass>, ....
            ????????????????????????????? public CDialogResize<CMyClass>
            ??? 3) Add a DLGRESIZE_MAP to your view as follows:
            ???????? BEGIN_DLGRESIZE_MAP(CMyClass)
            ????????????? DLGRESIZE_CONTROL(IDOK, DLSZ_MOVE_X | DLSZ_SIZE_Y)
            ??????? END_DLGRESIZE_MAP()
            ??????? The first parameter in the DLGRESIZE_CONTROL macro is the resource ID of your control. The second parameter(s) is the way that you want that control to be resized; valid values are DLSZ_MOVE_X, DLSZ_MOVE_Y, DLSZ_SIZE_X, DLSZ_SIZE_Y. (Note that you can OR these together with a |). You can also resize controls as a group by enclosing a number of DLGRESIZE_CONTROL macros with BEGIN_DLGRESIZE_GROUP() and END_DLGRESIZE_GROUP(). More on grouping in the next tip.
            ??? 4) Chain your message map to CDialogResize, i.e.
            ??????????? BEGIN_MSG_MAP(CMyClass)
            ??????????????? ....
            ??????????????? CHAIN_MSG_MAP(CDialogResize<CMyClass>)
            ??????????? END_MSG_MAP()
            ??? 5) Initialize the resizing for your view with DlgResize_Init(false, true, WS_CLIPCHILDREN) in OnInitDialog. Normally (for standard dialogs) you would just use DlgResize_Init() and accept the default parameters, but for a view you have to supply the extra settings since the view doesn't need a gripper or a frame like a dialog would.

            ? Some things I've noticed about grouping controls with CDialogResize:
            ?? 1) You can group controls in one direction and leave them ungrouped in another direction to achieve good effects.
            ??????? For instance, if you had Save, Print and Close buttons running along the bottom of your dialog, centered and spaced evenly apart, you'd probably want to do this grouping:
            ?????? BEGIN_DLGRESIZE_MAP(CMyClass)
            ??????????? BEGIN_DLGRESIZE_GROUP()
            ??????????????? DLGRESIZE_CONTROL(IDC_BTN_SAVE, DLSZ_MOVE_X )
            ??????????????? DLGRESIZE_CONTROL(IDC_BTN_PRINT, DLSZ_MOVE_X )
            ??????????????? DLGRESIZE_CONTROL(IDC_BTN_CLOSE, DLSZ_MOVE_X)
            ??????????? END_DLGRESIZE_GROUP()
            ??????????? DLGRESIZE_CONTROL(IDC_BTN_SAVE, DLSZ_MOVE_Y)
            ??????????? DLGRESIZE_CONTROL(IDC_BTN_PRINT, DLSZ_MOVE_Y)
            ??????????? DLGRESIZE_CONTROL(IDC_BTN_CLOSE, DLSZ_MOVE_Y)
            ?????? END_DLGRESIZE_MAP()

            ?????? This would keep all of them centered and spaced evenly as you moved them, while also moving them up and down independently.

            ??? 2) As soon as you noticed this little trick, however, you might start to take notice that your buttons don't exactly line up with the other controls on screen. You'd see this as the dialog was sized larger and larger. What's happening is that the leftmost button in the resource (this doesn't mean the top one in the DLGRESIZE_GROUP -- it's unrelated) is acting as an anchor for all the other buttons in the group. So when you resize the dialog, the leftmost button isn't moving ... it's just staying in place.
            ??? There may be better ways to solve this problem, but what I did is insert a new invisible button on the resource in the leftmost position to act as the anchor. I then included the button in the DLGRESIZE_GROUP with a DLSZ_MOVE_X command as well so it would make all the other three buttons move together correctly. Like I said -- it works. If you stumble on something better

            posted on 2007-01-18 16:23 獨孤九劍 閱讀(1340) 評論(0)  編輯 收藏 引用 所屬分類: C/C++/STL/ATL/WTL
            日韩精品久久久久久久电影蜜臀| 亚洲国产高清精品线久久| 日韩精品久久无码人妻中文字幕| 国内精品伊人久久久久| 亚洲国产日韩欧美久久| 久久精品中文闷骚内射| 久久强奷乱码老熟女网站| 久久精品国产亚洲av水果派| 久久精品国产欧美日韩99热| 久久久国产精品福利免费| 久久精品国产99久久久古代 | 精品久久久久久无码国产| 无码国内精品久久人妻蜜桃| 久久久久久亚洲精品不卡 | 久久天天日天天操综合伊人av| 久久精品一区二区国产| 久久精品国内一区二区三区| 欧美亚洲国产精品久久蜜芽| 亚洲国产精品婷婷久久| 99久久免费国产精精品| 国产日韩久久久精品影院首页| 国产一久久香蕉国产线看观看| 少妇久久久久久久久久| 久久99国产精品久久99| 国产精品无码久久综合网| 久久久久久国产a免费观看不卡| 99久久精品免费看国产一区二区三区| 久久久久国色AV免费看图片 | 久久青青草原综合伊人| 国产精品乱码久久久久久软件| 7777精品久久久大香线蕉| 18岁日韩内射颜射午夜久久成人| 模特私拍国产精品久久| 好久久免费视频高清| 99久久无色码中文字幕人妻| 国产精品欧美久久久久天天影视| 久久99精品免费一区二区| 久久青草国产手机看片福利盒子| 亚洲精品乱码久久久久久蜜桃图片 | 99久久伊人精品综合观看| 色妞色综合久久夜夜|