发信人: mendy.bbs@bbs.nju.edu.cn (孟迪), 信区: cnprogram
标  题: vc技巧-1
发信站: nju_bbs (Sun Apr 19 13:43:45 1998)
转信站: Lilac!ustcnews!nju_bbs

发信人: njhe (he要破产), 信区: RAD
标  题: vc技巧-1
发信站: '3m紫金飞鸿m' (Fri Apr  3 13:52:14 1998) , 站内信件

标  题: VC 小技巧 (转载)                                                        
【 以下文字转载自 program 讨论区 】                                             
【 原文由 lqwx 所发表 】                                                        
                                                                                
--------------------------------------------------------------------------      
1. 怎样让MFC的TOOLBAR上的按钮上象WORD 6.0那样出小旗子?                         
2. 如何使用GDI绘制的Bitmap?                                                    
3. VC如何去掉mainframe菜单?                                                    
4. 如何在FORMVIEW中生成CBitmpButton 按钮?                                      
5. 有关多线程?                                                                 
6. 如何通过窗口的Title得到其Handle?                                            
7. 用VC制作多文档界面时如何使文档一生成就最大化?                              
--------------------------------------------------------------------------      
在 CMyWinApp::OnIdle() 中 判断鼠标位置, 在ToolBar上时显示一个 Popup 窗口        
VC++ 2.0 以后的类库已经实现,但VC++2.0 只能用于 32Bit 程序开发。                
2. 如何使用GDI绘制的Bitmap?                                                     
用GDI函数绘制了一幅大图画,使用CScrolView显示,想加快速度避免重绘,使用         
        用兼容设备上下文试一试.                                                 
        1) 创建一个与CScrolView设备上下文兼容的设备上下文                       
        2) 创建一个ScrolSize大小的兼容位图                                      
        3) 将兼容位图选入兼容设备上下文                                         
        4) 用GDI函数在兼容设备上下文绘制                                        
        5) 需重绘时用BITBLT函数将兼容设备上下文的位图映射到CScrolView所在的     
        5) 需重绘时用BITBLT函数将兼容设备上下文的位图映射到CScrolView所在的     
3.  WINDOWS位图颠倒存储和显示是出于什么目的?                                    
        是出于用户坐标系的原因.                                                 
5. 我想在用VC++1.5编程时,new一个[512][512]的大数组,却总是不行.               
        这样的做法并不十分好,要分配如此大的内存最好用全局的内存分配函数.        
--------------------------------------------------------------------------      
跳过MFC的一套东西,在InitInstance()成员函数里直接调用                           
CMydialog dlg;                                                                  
dlg.DoModal ;                                                                   
CMydialog dlg;                                                                  
dlg.DoModal ;                                                                   
--------------------------------------------------------------------------    . 
6. 我用VC1.0 ,需以FormView 中生成CBitmapButton 按钮,通常CBitmaoButton         
是在CDialog 中在InitDialog()中用CBitmapButton.AutoLoad()装入,但CBipmapButto.   
没有类次成员,我在构造函数中调用CBitmapButton.AutoLoad()会死机,按CBitmapBut    
的提示使用Create()+LoadBitmaps()却不成功。                                      
希望各位能帮帮忙。                                                              
  在CFormView 中产生CBitmapButtom:                                              
          class CMainWindow : public CFrameWnd                                  
          {                                                                     
                private:                                                        
                                                                                
                private:                                                        
                    CBitmapButtom m_OpenButtom;                                 
                    CBitmapButtom m_SaveButtom;                                 
                    CBitmapButtom m_SaveButtom;                                 
                public:                                                         
                        ......                                                  
          int CMainWindow : OnCreate(LPREATESTRUCT)                             
          {                                                                     
                CRect rect;                                                     
                rect.SetRect(4,4,36.36);                                        
                m_OpenButtom.Create(NULL, WS_CHILD | WS_VISIBLE |               
BS_OWNERDRAW,                                                                   
                               rect, this, IDB_OPEN);                           
                。。。。。。。                                                  
                return 0;                                                       
9. 请问: 用VC制作多文档界面时如何使文档一生成就最大化?                        
                                                                                
    如果你用的是VC4.0,那么只要在CREATE时在ADVANCE中选择MDI->MAXIMIZED.          
    如果你用的是VC1.5,那么就在视类重载的OnInitUpdate成员函数中加上:             
                                                                                
        CMDIChildWnd *pWnd=(CMDIChildWnd *)GetParentFrame();                    
        pWnd->MDIMaximize();                                                    
                                                                                
------------------------------------------------------------------------------. 
                                                                                
10. Windows编程中,能否截获应用程序对DLL中函数的调用?如果能,如何办?          
                                                                                
得到DLL中函数的指针后,修改代码段代码,跳向你自己的函数,不就可以吗             
                                                                                
                                                                                
------------------------------------------------------------------------------. 

--
不惜一切代价,达到修炼的真义。
遇神阻则弑神,遇佛阻则弑佛。

m;36m※ 来源:·紫金飞鸿 bbs.njupt.edu.cn·[FROM: 202.119.236.104]m

--
※ 来源:.南大小百合信息交换站 bbs.nju.edu.cn.[FROM: a507yjh.nju.edu]
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:204.843毫秒