in

AisNote Software

The software can improve your computer work

Great Windows Tool

  • Word 技巧2则-图表目录-章节不同的页眉

     

    Word 图表目录生成办法

    第一步:对图进行自动编号

    自动编号可以通过 Word " 题注 " 功能来实现。

    1、 按文档格式要求,第一章的图编号格式通常为 " 1 ×"

    2、 将图插入文档后,选中新插入的图,在菜单条上选择 插入 ”—“ 引用 ”—“ 题注 新建一个标签 " 1 " ,编号格式为阿拉伯数字(如果不是点击 " 编号 " 修改),位置为所选项目下方,单击 " 确定 " Word 就插入了标签文字和序号,此时可以在序号后键入说明,比如 "XX 功能 " 等。

    3、 再次插入图时题注的添加方法相同,不同的是不用新建标签了,直接选择就可以了。 Word 会自动按图在文档中出现的顺序进行编号

    第二步:生成图表目录

    对图进行编号完毕后,在菜单条上选择 插入 ”—“ 引用 ”—“ 索引和目录 。选择 图表目录选项 ,点击 确定 按钮,图表目录就 OK 自动生成啦。

    转载自http://hi.baidu.com/vself/blog/item/280330c71af81bd8d00060f2.html ,希望对经常进行文档操作的人有帮助:)

    http://soft.yesky.com/office/163/2190663.shtml
    同一篇Word文档设置多个不同的页眉页脚

     

    如果在Word文档中创建了页眉、页脚,那么在默认情况下,一篇文章从头到尾的页眉页脚都是一样的。

    但有时,我们还需要根据不同的章节内容而设定不同的页眉页脚。有的朋友将不同的章节分别保存成不同的文件,然后再分别给每个文件设定不同的页眉页脚,操作起来很麻烦。

    有更简单的方法:在文章中插入不同的分节符来分隔。

    下面笔者以一份网络工程投标计划书为例向大家介绍具体的操作方法。

    在本例中我们准备将首页页眉设为“网络中心机房施工部分”,从第2页开始再按具体的章节内容分别设为“机房装修设计”、“配电系统设计”…… 等不同的页眉内容。具体操作步骤如下:

    1. 用Word打开投标书文件。如图1所示

    2. 此时先不要急着设置页眉,而是将光标分别定位于每个需要使用新页眉的位置,然后执行“插入”菜单→“分隔符”命令,如图2所示。选中“分节符类型”中的“下一页”选框后点击确定按钮,并以此为例对整份文件进行分节处理

    图2

    3. 等整个文章分好节以后,就可以点击“视图”菜单→“页眉与页脚”命令进入页眉编辑模式了。如图3所示,按要求输入好首页页眉

    图3

    【小提示】 请注意图3中红框位置的变化

    4. 然后再从“页眉与页脚”工具栏中点击“显示下一项”按钮,跳转到下一节的页眉处,如图4所示。细心的朋友一定会发现,此时的页眉处已和图3有所不同,不仅节码由第1节变成了第2节,而且右上角也多出了一个“与上一节相同”的字样。

    此时,我们应该点击页眉与页脚工具栏中的“链接到前一个”按钮切断第2节与前一节的页眉内容联系,然后再输入第2节的页眉“机房装修设计”

    图4

    5. 剩下的操作以此类推,每完成一个章节的页眉后就点击一下“显示下一项”和“链接到前一个”按钮,再对下一章节进行设置,直到完成整个文章的编排

    这种方法操作快速,而且所有的页眉均保存在同一个文件中,也方便进行存档。同时,页脚也支持这种多级设定,具体操作方法与页眉相似,本文不再赘述

    【小提示】 在图2中我们看到Word共支持4种分节符,分别是“下一页”、“连续”、“奇数页”和“偶数页”,它们之间有什么区别呢?

    “下一页”:是指插入一个分节符后,新节从下一页开始。如图5所示

    图5

    “连续”:是指插入一个分节符后,新节从同一页开始。如图6所示

    图6

    “奇数页”或“偶数页”:是指插入一个分节符后,新节从下一个奇数页或偶数页开始。如图7所示

    图7

  • DX links

    http://www.alanthorn.net   good site for Dx and Gaming develop with C++.

    Posted Mar 03 2010, 01:47 PM by elliotllb with 1 comment(s)
    Filed under:
  • 2009年5月28日-5月30 端午节 龙舟 西湖音乐节 孤独的人是可耻的 BMW

    听 张楚的《姐姐》,还是在大学。
    听 许巍的,他还没有现在这么有名。
    这个夏初的端午节,杭州西湖音乐节,杭州西溪龙舟。
    带儿子去西溪看龙舟,小子眼睛都快掉出来了。兴奋的不肯回家,回了家还不肯睡觉,第二天还在说龙舟在哪里:)!

    “孤独的人是可耻的……” 我曾也抱着
             _...._
          "         " .__  . " . 
       "     *.__            .  )                       o
    "           ~*          . ~                  o o o |
    |@@\-------:--------=========================|* * * * ` .
    |@@/-------:------===========================|* * * * .'
    "         __.*       . "                     o o o |
    ".      *~       .-  .                             o
        ",.  .____.  "
    (/*www.sogou.com 的输入法还可以输入字符画,不错不错!完全从网民出发啊。sohu 有前途!!!*/)在 宿舍的走廊里挥舞和咆哮(只能这么说,本人五音不能)。
    音乐节我没有去,只在网络上看了几个视频。很多乐队和歌手我都不认识,只有几个年龄大一点还熟悉一点。当然是单向的认识。
    我曾经最喜欢的就那么几首歌,现在依然在我的 小石头(创新mp3)里:同桌的你 那些花儿 岁月 青春 谁在我上铺的兄弟……

    小区旁有个琴行,老板教吉它的,经常带儿子去玩,给他点熏陶,玩玩音乐 对人的性格脾气都很有好处。小子第一次在“反斗成” 打鼓的样子可圈可点,简直像个专业的鼓手,要知道,那会才1周岁多点,准备培养一下。呵呵

    //===================================================================
    30日那天和 初入社会的一帮同事(刚到杭州的第一家公司,老板已经不开公司,专业炒股,后有//注释):
    一个大学师兄,kai了个软件公司,”凯旋”车;
    还有个 在合资公司,senior的系统管理员;
    一个如今是用友的consultant,准爸爸,胖的很糟糕;
    最强的当然是被我们以前称作丫头的,如今是房产商富太太,和我同龄,两个sons的MM。为杭州房价的上升做了不少贡献,BMW5,准备ing换车。
    还有一个是 3岁女孩的MM,依然年轻美貌,说的最多的是“我家里没有钱的”--杭州本地的老公,少说也得有2套房子,200W 不少吧?
    老板的声音依旧,很甜,常在电话的另一头被人误为专业接线员----//如今专业炒股,非得要租个办公室炒?

    // 谈的多的是关于小孩---------------------------------------开个关于小孩的公司,很不错
    (丫头给小孩报了个 什么 天才宝贝:2W多。)
    (在 hz大厦买了套小背心衣服,还是 300 -  120的,也得要200+)
    //
    小孩子好挣钱。英伦 幼儿园的,hz 的,2200 / month
    int nCount;  // should be declare of double.

    double   dCount=0.0;
    while ( )

    nCount += eat;
    nCount += cloth;
    nCount += toy;

    ).nnd.比房价还离谱

    耳机还在响着 杭州西湖音乐节的音乐,一个mm的声音,据说是叫 什么 陈珊妮?我不认识的?

    这个端午很快,很快乐-----------------打球扭了下腰,有点酸,赶紧 post!

  • CString Crash in ~CString.在不通工程之间调用crash的问题

    Recently,I met a question as below:

    One is DLL:

    CString GetString()

    {

    return _T(“test”);

    }

     

    One is application to call this DLL’s api:

    CString strTest = GetString();

    in deconstructor,app will crash.

    inline CString::~CString()

    //  free any attached data

    {

    if (GetData() != _atltmpDataNil)

    {

    if (InterlockedDecrement(&GetData()->nRefs) <= 0)

    delete[] (BYTE*)GetData();

    }

    }

    Root cause: app is /MD,Dll is /M

    Solution: set the code-generaltion to the same type.

    参考://20090527

    CString的一个问题

    CString的Release函数实现如下:

    void CString::Release()
    {
            if (GetData() != _afxDataNil)
            {
                    ASSERT(GetData()->nRefs != 0);
                    if (InterlockedDecrement(&GetData()->nRefs) <= 0)
                            FreeData(GetData());
                    Init();
            }
    }
    其中_afxDataNil定义如下:
      AFX_STATIC_DATA int _afxInitData[] = { -1, 0, 0, 0 };
    AFX_STATIC_DATA CStringData* _afxDataNil = (CStringData*)&_afxInitData;

    sizeof(CString)等于4,它是一个指针。对于空的CString,MFC会让其指向一个静态数据_afxInitData。MFC通过判断CString的值是否等于_afxInitData的地址来判断CSting是否是空的。

    如果在exe和dll之间传递CString对象,而exe和dll都与MFC静态链接,那么在exe和dll中的_afxInitData的地址可能是不同的。exe中的空CString传到dll中会被当成非空CString处理,然后就会发生错误。

    一般而言,如果不是动态链接MFC类库,应尽量避免在exe和dll之间传递MFC的对象。

  • First Blog Exported From AisNote30

    aisnote bug

    bug1:

    sqlite3 的文件路径不支持中文!fixed.20090326

    Bug2:

    notemgr 里的查找 UE improve

    第二次弹出的时候,应该重置tagcombobox

    点击find的时候要判断是否是 tag find

    bug3:

    new note 的回车响应。现在要按ctrl + 回车才能换行。

    20090326:全部改为 ctrl+enter

    bug 4:

    notesMgr Today button need to expand all child notes.fixed 20090326

    UE improvment: checkCombox.Add one icon with cliking to close the comboList.

    New note hotkey for text format.

    HightLight color: Ctrl+H

    Italic : Ctrl + I

    Bold:  Ctrl + D

    UnderLine: Ctrl + U

    shift =================

    Text color:     Shift + C

    icon-notifier: tooltip format should as below:

    aisnote 3.0

    user:elliot

    www.aisnote.com

    new note:ctrl+b         FIXED        

    NotesMgrlistbox上增加Tooltip

    tagaisntoe bug

    day

    timeFIXED

    Bug:

    new note=>tags===>select==>ESC can not close the cmb listbox.

    bug:

    remove the new note select state when initilize.

     

    td:notes mgr select all and expand all button need to initilize when open this dialog again.

    new notes should provide one shotkey to move the tag combobox.

    Can delete one notes.

    td:记录 notes 修改时间

    notes mgrtooltip 显示简要内容

    运用 Aisnote的 休息提醒,让你的眼睛得到彻底的放松,缓解你的用眼疲劳,尤其是MM和青少年。

    打开 菜单--设置---窗口

    在左边选择: 提醒与动漫

    然后在 右边启用 休息提醒,选择一个你喜欢的动漫,设置好间隔时间,比如:45分钟。aisnote会自动在45分钟后提醒你,并播放你选择的动漫。图形并茂,very good!赶紧试试吧!!!

    爱护眼睛,用AisNote

    notes mgr should record the changed history of one note.Add one table in DB.

    bug:Notes mgr-if focus in RE,press ESC,aisntoe crashed.

    bug: new note.1.first to press "Ctrl + TAB"

    2.press "Ctrl+B"

    3.Press "Ctrl+B" again.

    The RE will be disable.

    Td:全局hook windows for topMost or not

     

  • Develop yourself IM based of Xmpp and gloox

    background:

    1.what is Jabber,go to here: http://www.jabber.org
    It is now a part of Cisco.

    2.Xmpp,xmpp client,psi,gtalk,TLS,etc.If you dont know what is it ?please let Google tell you.
    3.Download gloox from http://camaya.net/gloox
      I used the Latest stable version: 0.9.9.7
    4.Use Vc6 + PlatformSDK of windows to build gloox
    5.Open src/examples/ to test your gTalk account.

    image

    please pay attention to the config.h file:

    /**
    * Uncomment whichever lib you have installed.
    */

    /* Uncomment if you have zlib available and want to use it */
    // #define HAVE_ZLIB 1

    /* Comment out if you don't want to use Win's native TLS functions */
    #define HAVE_WINTLS 1

    /* Uncomment if you have GnuTLS available and want to use it */
    // #define HAVE_GNUTLS 1

    /* Uncomment if you have OpenSSL available and want to use it */
    // #define HAVE_OPENSSL 1

    /* Uncomment if you have LibIDN available and want to use it */
    // #define HAVE_LIBIDN 1

    /* Comment out if you don't have windns.h (e.g. if you use an old Platform SDK) */
    #define HAVE_WINDNS_H 1

    /* Comment out if you don't have setsockopt() */
    #define HAVE_SETSOCKOPT 1

    开源界有很多 xmpp的client,我没有仔细去研究过,但用gloox封装好的,然后输入gtalk的账号和密码,就可以和你的gtalk朋友chat了。感觉非常的哈。长时间与code打交道,也悟出不少道理:软件开发分好几层,底层的犹如honeywell的或者DT,做通用的零部件。MS属于通吃,不但做零部件,还做终端。不管在产业链的哪个部位,都可以做好,天下事都如此。但当然做的越核心越好,门槛高,对手少,古曰内功。做方案的也可以做的很好,山寨里也有贫穷富裕。懂得站在巨人肩膀上的人终究会成功,软件更是如此。空了做一个 PSI 自己玩玩。

    reference:

    http://code.google.com/p/icalk/

  • Virtual ListView Control in Windows

    As we know,Windows Common Control: ListView support virtual listView.A good sample you can downloaded here:
    http://www.codeguru.com/cpp/controls/listview/advanced/article.php/c4151
    Now I just noted some tips for how to use this feature in Windows Application or if you want to wrap a customize control by yourself:
    Steps:
    1.Make sure the ListView is owner-data style:

    Virtual List-View Style

    A virtual list view is a list-view control that has the LVS_OWNERDATA style. This style enables the control to handle millions of items because the owner receives the burden of managing item data. This allows you to use the virtual list-view control with large databases of information, where specific methods of data access are already in place.

    A virtual list-view control maintains very little item information itself. Except for the item selection and focus information, the owner of the control must manage all item information. Other processes request item information from the owner by using LVN_GETDISPINFO notification messages.

    Because this type of list control is intended for large data sets, it is recommended that you cache requested item data to improve retrieval performance. The list view provides a cache-hinting mechanism to assist in optimizing the cache. The hint is implemented in the form of an LVN_ODCACHEHINT notification message.

    Creating a Virtual List-View Control

    You create virtual list-view controls using the CreateWindow or CreateWindowEx function, specifying the LVS_OWNERDATA window style as part of the dwStyle function parameter.

    You can use the LVS_OWNERDATA style in combination with most other window styles, except the LVS_SORTASCENDING or LVS_SORTDESCENDING style. All virtual list-view controls default to the LVS_AUTOARRANGE style.

    Note  Dynamically switching to and from the LVS_OWNERDATA style is not supported.

    2.Response some notify msg to cache the data

    Handling Virtual List-View Control Notification Messages

    List-view controls with the LVS_OWNERDATA style send the same notification messages as other list-view controls and two additional ones: LVN_ODCACHEHINT and LVN_ODFINDITEM. The following are the most common notifications that the list-view control with the LVS_OWNERDATA style sends.

    LVN_GETDISPINFO
    A virtual list-view control maintains very little item information on its own. As a result, it often sends the LVN_GETDISPINFO notification message to request item information. This message is handled in much the same way as callback items in a standard list control. Because the number of items supported by the control can be very large, caching item data improves performance. When handling LVN_GETDISPINFO, the owner of the control first attempts to supply requested item information from the cache (for more information, see Cache Management). If the requested item is not cached, the owner must be prepared to supply the information by other means.

    LVN_ODCACHEHINT
    A virtual list view sends the LVN_ODCACHEHINT notification message to assist in optimizing the cache. The notification message provides inclusive index values for a range of items that it recommends be cached. Upon receiving the notification message, the owner must be prepared to load the cache with item information for the requested range so that the information will be readily available when an LVN_GETDISPINFO message is sent.

    LVN_ODFINDITEM
    The LVN_ODFINDITEM notification message is sent by a virtual list-view control when the control needs the owner to find a particular callback item. The notification message is sent when the list-view control receives quick key access or when it receives an LVM_FINDITEM message. Search information is sent in the form of an LVFINDINFO structure, which is a member of the NMLVFINDITEM structure. The owner must be prepared to search for an item that matches the information given by the list-view control. The owner returns the index of the item if successful, or -1 if no matching item is found.

    Cache Management

    A list-view control with the LVS_OWNERDATA style produces a large number of LVN_GETDISPINFO notification messages and, to assist in optimizing the cache, an LVN_ODCACHEHINT message. LVN_ODCACHEHINT messages provide information about the recommended items to include within the cache. These messages are sent as WM_NOTIFY messages, with the lParam value acting as the address of an NMLVCACHEHINT structure.

    The NMLVCACHEHINT structure includes two integer members, iFrom and iTo, that represent the inclusive endpoints of a range of items that most likely will be needed. The owner must be prepared to load the cache with the item information for each of the items within the recommended range.

    The list control often needs item information for the first item (offset 0). The LVN_ODCACHEHINT notification message might not always include item 0, but it must always be included in the cache.

    The last items in the list are accessed often. Therefore, the owner might want to keep a second cache that includes the items at the end of the list. The requested range from LVN_ODCACHEHINT can be checked against the end cache to make it available automatically instead of reloading the same end range each time.

    中文notes:
    一个是style要对,这个style不能动态切换。然后就是响应几个notify消息。当Virtuallist 开始绘制的时候,它会发消息让你告诉它内容。窗口只绘制可见的那一部分。virtual list 只给你维护一些索引值。所以理论上可以支持 M(million)  条数据,这些数据你可以保存在DB里。
    如果你自己想要封装一个没有窗口的控件,可以模仿这样的做饭。MSN的UI就是windowsless UI,包括qq2009 也是类似的做法。不过个人认为,如果你的application 不考虑跨平台的,还是用windows common control方便。毕竟这东西经过了这么多年的发展和n多用户的检验,其性能和稳定性已经非常的好,而且兼容性做的非常棒,并且支持多线程。如果你是完全自己做,估计得花n年时间。如果你不满足于common control那样的土颜色和风格,最好的方式是在 windows common control的基础上进行开发,这样能事半功倍!如果你还想要一些3D的窗口效果,可以考虑结合Dx或者OpenGL,那样的UI会非常棒,尤其适合一款面向个人的软件:比如IM,game UI等。

  • 爱护眼睛,用AisNote

    image

    (上图只有在2.3中有)

    运用 Aisnote的 休息提醒,让你的眼睛得到彻底的放松,缓解你的用眼疲劳,尤其是MM和青少年。
    打开 菜单--设置---窗口
    在左边选择: 提醒与动漫
    然后在 右边启用 休息提醒,选择一个你喜欢的动漫,设置好间隔时间,比如:45分钟。aisnote会自动在45分钟后提醒你,并播放你选择的动漫。图形并茂,very good!赶紧试试吧!!!
    爱护眼睛,用AisNote

    Posted Apr 07 2009, 09:16 AM by elliotllb with 1 comment(s)
    Filed under:
  • aisNote to-do-list

    The latest version of AisNote is V2.2,please use below URL to download.

    http://bbs.aisnote.com/files Now AisNote have Chinese Version and English Version.

    From 2005,aisnote users begin more and more.now the 3.0 version
    will be update soon.In this version,will add more features and fix some bugs.
    improve some user experence.
    The belows are high priority:
    1.support gif as winks.user can do the winks by themselves.
    2.use richedit to recorder note:support Ctrl+ F to serach the content in one note.
    3.support autoupdate.Click the menuitem to chec autoupdate.Detail is TBD.1.Auto restart 2.Just check update.ini then to one URL.Setup by Userself.
    4.export to html.This feature do not useful for user survey.
    5.track user time.
    6.more skins.3.0 will main focus to improve the performance and reduce the resource usage.So will remove the Skin feature just like foobar2000.
    7.Screen specified window to bitmap and auto save.Make aisnote like a lifebits which is from MS research project.So that people can remember what he has done in one day of his life.And can query the screen of one day at one  special time.
    8.Use sqlite database to store the data.
    .......
    9.Integrate new calendar view from:http://www.codeproject.com/KB/applications/TDL_Calendar.aspx
    10.Compatible to the old file(txt) list.RTF editor can open the txt file automaticly.So this is not a big deal.

    Option Lists:

    Integrate with IpMsg.
    Use sqlite database to store the data.move ahead!

    //20080526:
    找了很久,也没有找到可以attach file的论坛,今天总算找到了。google site有这个功能,并且向中国区域开放,而且还free,简直太好了。
    //20081029:google site can not be downloaded the attached in mainland.

    You can download the aisnote version 2.1 in the below URL.
    大家可以通过这里下载 aisnote21:
    http://sites.google.com/site/aisnotesoft/
    Please go to official site www.aisnote.com to download.

     

     aisNote

    To-do-list in detail:
    Task 1:
    1.Use the RichEdit replace old common edit for input notes and notes manager.
    2.Every open txtfile will popup the llyPad editor.
    3.The data will be RTF format and stored to sqlite database which name is "username.db" under the username/data folder.
    4.Fix bugs:
    Add "Today" button in manager notes dlg:go to today notes.Finished!

    AisNote Reference:
    1.Office Export:http://msdn.microsoft.com/en-us/library/aa155776(office.10).aspx
    2.DB is only for sticks and bitmap(JPG,GIF etc.)

    Demo pictures:

    image

    image

    New Find Notes Design:

    image

     

    image 

     

    image

  • RTF file research tips

    1. Convert Chinese to Ansii string

          7 int main(int argc, char* argv[])

          8 {

          9     printf("Hello World!\n");

         10 

         11     char chTest[]="电";

         12     int n1 = (unsigned char)(chTest[0]) << 8;

         13     int n2 = (unsigned char)chTest[1];

         14 

         15     int   i   =   n1+n2;  

         16     char   a[3];  

         17     a[0]   =   (char)((i   &   0xff00)   >>   8);  

         18     a[1]   =   (char)(i   &   0xff);  

         19     a[2]   =   0;  

         20     printf("%s\n",a);

         21 

         22     return 0;

         23 }

    2. Some Links:
      rtflib from www.codeproject.com
      rtfx   you can google it.
      latex2rtf from www.sourceforge.net
      gc1039.exe from www.msdn.com.  It will give you some info about how to read rtf file directly using c++.
      http://msdn.microsoft.com/en-us/library/aa140301.aspx
      abiword http://www.abisource.com/   There are a RTF importer/Exporter plugin source code.But I do not familiar with it.
      I think in Windows Platform,you can use RichEdit control to do the below actions:
      Merge 2+ rtf files to one rtf file just use copy and paste,of course you should use TOM or just create 2 hidden richEdt box to switch the data.That is easy.Also you can find the plain text from RTF use EM_GETTEXTEX and stream out a butter then go to find the string what you want catch.
      http://www.codeproject.com/KB/edit/COleRichEditCtrl.aspx?msg=2915564#xx2915564xx  Good sample for OLE such as insert PPT file etc.

    3. RTF have the advantage and disadvantage.I recommended you to use HTML,XML etc.But RTF is good supported by MS.

    4. Search Text:

        497         kREView* pRE = m_view.GetAt(m_view.Active());

        498         if ( pRE )

        499         {

        500             pRE->Load(_T("d:\\dd.rtf"));

        501 

        502             DWORD dwSize = pRE->GetTextLengthEx(GTL_NUMBYTES | GTL_CLOSE, CP_ACP);

        503 

        504             TCHAR *lpszBuffer = new TCHAR[dwSize+2];

        505             memset(lpszBuffer,0,(dwSize+2)*sizeof(TCHAR));

        506 

        507             GETTEXTEX ex = {0};

        508             ex.cb = dwSize+2;

        509             ex.codepage = CP_ACP ;

        510             ex.flags = GT_DEFAULT;

        511 

        512             pRE->GetTextEx(&ex,lpszBuffer);

        513 

        514             CString str = lpszBuffer ;

        515             int nRet = str.Find(_T("我的"));

        516             delete []lpszBuffer ;

        517         }

    5. Directly Get or Set RTF content to a RTF ediotor.Prototype code is below:
      http://www.codeproject.com/KB/edit/rulerricheditctrl.aspx 

      CString CRulerRichEditCtrl::GetRTF()
      /* ============================================================
          Function :        CRulerRichEditCtrl::GetRTF
          Description :    Returns the contents of the control as RTF.
          Access :        Public
          Return :        CString    -    The RTF-contents of the control.
          Parameters :    none

          Usage :            Call this function to get a char buffer
                          with the contents of the embedded RTF-
                          control.

         ============================================================*/
      {

          CString* str = new CString;
          EDITSTREAM    es;
          es.dwCookie = ( DWORD ) str;
          es.pfnCallback = StreamOut;
          m_rtf.StreamOut( SF_RTF, es );

          CString output( *str );
          delete str;

          return output;

      }

      void CRulerRichEditCtrl::SetRTF( const CString& rtf )
      /* ============================================================
          Function :        CRulerRichEditCtrl::SetRTF
          Description :    Set the contents of the embedded RTF-
                          control from rtf.
          Access :        Public
          Return :        void
          Parameters :    const CString& rtf    -    The rtf-contents to
                                                  set.
          Usage :            Call this function to set the RTF-contents
                          of the control.

         ============================================================*/
      {

          CString* str = new CString( rtf );

          EDITSTREAM    es;
          es.dwCookie = ( DWORD ) str;
          es.pfnCallback = StreamIn;
          m_rtf.StreamIn( SF_RTF, es );

          delete str;

      }


      static DWORD CALLBACK StreamIn( DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb )

      {
            
      CString* str = ( ( CString* ) dwCookie );

      #ifdef _UNICODE
            
      // Unicode is only supported for SF_TEXT, so we need

             // to convert
             LPCTSTR ptr = str->GetBuffer( (*str).GetLength() );
             int
      length = ::WideCharToMultiByte( CP_UTF8, 0, ptr, -1, NULL, 0, NULL, NULL );
             int
      max = min( cb, length );
             if(
      length )
             {
                    char*
      buff = new char[ length ];
                    ::
      WideCharToMultiByte( CP_UTF8, 0, ptr, -1, buff, length + 1, NULL, NULL );
                   
      strncpy( (LPSTR) pbBuff, buff, max );
                    delete[]
      buff;
             }
            
      str->ReleaseBuffer();

      #else

             int
      max = min( cb, (*str).GetLength() );
            
      strncpy( ( LPSTR ) pbBuff, (*str) , max  );

      #endif

             (*
      str) = (*str).Right( (*str).GetLength() - max );
             *
      pcb = max;
             return 0;
      }



       

  • Great&Free Tools for Your Computer Work

    20081011 add new tools I got from WWW or other friendes recommend.All can be Googled.

    1.Coolplayer:a light-weight MP3 player in Windows.It's opensource.
    2.CDex:
    CDex is a CD-Ripper, extracting digital audio data from an Audio CD. The application supports many Audio encoders, like MPEG (MP2,MP3), VQF, AAC encoders. It can be used to sound recorder.Open source tool.
    3.Paint.Net: MS participated open-source image edit tool which is used to replace mspaint.exe.It wrote in c#.The UE is very good.I like it very much.
    4.PicPick: This tool is closed-source free tool wrote by KO man.I like it too.I often used it to capture the screen and windows bitmap.
    5.isee: 国产的照片管理与电子相册合成application,我用它做了很多电子相册。
    6.flphoto: 也是一个照片管理与相册工具。this is opensource and cross-platform which built in FLTK,这个软件在windows需要自己编译,如果你不会,可以联系我哦。我只喜欢它的slideshow exporter,空了给它加到 llyPiczoomer上。demo is here:http://www.aisnote.com/rhf_wedding/index.html
    不过它对中文支持不好。
    7.llyDict: 在线查词,不说了,直接google吧。
    8.IpMsg: please google it or "飞鸽传书"。非常好的局域网文件传输工具。速度快
    9.FastCopy:这个和ipmsg 同一个作者的。很有名气,不知道,google。
    10.OpenProject: I often got some *.mpp file  for project manage,but I need not to modified it.So I don not want to install the large MS Project applicaton.I just want to view the file.So the openProject is prefered to.
    The main hits are from http://xbeta.info/irfanview-interview.htm 
    11.Winks: Wink is a Tutorial and Presentation creation software, primarily aimed at creating tutorials on how to use software (like a tutor for MS-Word/Excel etc). Using Wink you can capture screenshots, add explanations boxes, buttons, titles etc and generate a highly effective tutorial for your users.录制屏幕的软件很多,但能转为flash的又是免费的就少了。Wink 很棒。最为关键的是它又 鼠标和键盘驱动录制,自由录制,时间录制的功能。真的很棒。

     

    //=====================================

    1.WhereIsIt:a tool for manage your files.

    www.whereisit-soft.com.
    I do want a tool as this.

    Sean( olivi ): 1. 可以导入一个目录
    Sean( olivi ): 2. 可以给单个目录或者文件添加tag
    Sean( olivi ): 3. 可以给单个文件加笔记,就是要有一个txt文件和那个文件可以关联起来
    Sean( olivi ): 4. 可以按照tag进行分类
    liu elliot: 3. tc 可以做到
    支持 unicode

    whereisit可以”离线生成索引“,
    Sean( olivi ): 这个比较赞,这样我可以把我移动硬盘里的资料整理成一个文件
    Sean( olivi ): 不需要连上移动硬盘就能查看有哪些文件

    And I need it to manage my so many e-books which I collected from WWW.

    Today I used this tool in detail.Although the feature is enough to meet my requirement.
    But the user experience is so complex.I do not need all the features.So I decided to
    write a new tool based of this tool by myself if I have spare time.

    //20080522:NND,尽然不是free的,而且功能过于强大,用户体验不怎么好。
    /*  20080523
    * 今天仔细用了一下,发现功能是相当的强大,光导出index report就可以设置很多选项和格式,这个功能对我最需要了。
    */

    2.Locate32:instant access to your file which you want to find
    另外推荐一个open source的文件finder:www.locate32.net very fast to find your disk file because it will create one dabase for your disk and just find the db replace the real disk.So the speed is very fast.
    REF to the site:
    Locate32 is a file finder which works by indexing all your files on your hard disk drive and thus is able to provide almost instant access to them.  For more information, see  the
    About Locate32 page.

    3.BlockNote.net:
    Extremely easy to use Web page editor. Honestly!
    Designed for people who create content for the Web, BlockNote is compact, fast and is as easy to use as a word processor. Its’ simple, user-friendly interface enables even the most novice computer user to import, edit and format web pages—without having to learn any HTML!More detail...
    [aisnote]:Now this tool have a great feature which is can export to PDF.
    //20080912:the "export to PDF" can not support Chinese,so I discarded this tool.


     

  • bind binary data

    v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);}

           try

           {

                  CppSQLite3DB db;

                  db.open(szDBFile);

     

                  db.execDML(CREATE_TABLE_NOTES);

     

                  int nFileLen = 0;

                  BYTE* pData = llySqlite_FileToBlob(lpszFileRtf,nFileLen);

     

                  CppSQLite3Statement stmt ;

            stmt = db.compileStatement("insert into tNotes values(NULL,'TEST','test',?);");

                  //stmt.bind(3, bin, sizeof bin);

                  stmt.bind(1, pData, nFileLen);  // begin from ? ‘s index.Here ? is in the first.So 1

                  stmt.execDML();

     

                  if ( pData )

                         delete []pData;

                  pData = NULL;

           }

           catch (CppSQLite3Exception& e)

        {

            //cerr << e.errorCode() << ":" << e.errorMessage() << endl;

        }

    Posted Jan 13 2009, 04:34 PM by elliotllb with 1 comment(s)
    Filed under:
  • VC 6 Setup failing when "Searching installed components..."

    Today I have to re-setup my PC.And when I finished the setup.I setup the office2007 first.Then go to setup VC6.To my supprise that VC 6 setup processing stopped in the "Searching the instatlled component".
    在“安装程序正在搜索已安装的组件”处就不动了
    I googled some URLS such as :
    http://topic.csdn.net/t/20060731/11/4916432.html
    But did not get the answer.I tried once ag.Still fail in that steps.

    So I have to uninstall the office2007,then go to setup VC6.This time,Setup successful!!!  I dont know why?Maybe Office2007 changed some registries that is confict with VC6,I think.

  • AisNote winks can not play.

    Problem:winks can not be playing,llyFlash.exe is crashed.Aisnote is still work normally.

    Now the issue reported by aisnote user.

    When update to the latest Adobe Flash Player,the aisnote winks will not be playing normally.

    I will investigate this issue and the solution will be coming soon.

    In the aisnote3.0,to avoid confliction with flash player,aisnote will build itself winks player just using gif resource and mp3.

    please waiting......

    Posted Nov 11 2008, 08:42 AM by elliotllb with no comments
    Filed under:
  • WTL Groupbox blackground issue

    I just used WTL to wrap a groupbox class.The prototype is below:
    class CMyRadioButton  : public CWindowImpl<CMyRadioButton,CButton,
    CControlWinTraits > // groupbox is a type of button.

    { //the message handler is below:

        BEGIN_MSG_MAP(CMyRadioButton  )
            MESSAGE_HANDLER(WM_CREATE,OnCreate)
            MESSAGE_HANDLER(WM_PAINT,OnPaint)
            MESSAGE_HANDLER(WM_LBUTTONDOWN,OnLButtonDown)
            MESSAGE_HANDLER(WM_LBUTTONUP,OnLButtonUp)
            MESSAGE_HANDLER(WM_MOUSEMOVE ,OnMouseMove)
            MESSAGE_HANDLER(WM_MOUSELEAVE ,OnMouseLeave)
            MESSAGE_HANDLER(WM_KILLFOCUS, OnRefresh)
            MESSAGE_HANDLER(WM_SETFOCUS, OnRefresh)
            MESSAGE_HANDLER(BM_SETCHECK, OnStateChange)
            MESSAGE_HANDLER(BM_SETSTATE, OnStateChange)
            MESSAGE_HANDLER(WM_ENABLE, OnRefresh)
             MESSAGE_HANDLER(WM_UPDATEUISTATE,OnRefresh)
        END_MSG_MAP()

    }

    In OnPaint,I just used the below to draw the bitmap:
    1.Frist to create a stretched bitmap according to the button's client RECT in memory.
    2.Draw the bitmap transparent to client RECT.Just call the api TransparentBlt.

    Notes: the issue only duplicate sometimes.Not 100%.XP Sp3 is easily to duplicate.

    image

More Posts Next page »
aisnote software
Powered by Community Server (Non-Commercial Edition), by Telligent Systems