打印

菜农早上作检讨---论斗私批修

[复制链接]
3075|20
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
hotpower|  楼主 | 2008-7-24 07:57 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
tc, COM, TE, ST, dc
匠人说俺忽悠,实属不是~~~

若俺发布源码,确实是浪费"人才"~~~因为肯定很多人要看"天书".

不信帖几句:
typedef struct
{
    unsigned int CommPort;
    int        Panel;
    int        Control;
    void   *Data;
}HotCommBindCtrlStruct, *HotCommBindCtrlStructPtr;
typedef int  (CVICALLBACK *HotCommBindCtrlCallbackPtr) (int Panel, int Control, int Event, void *BindCtrlPtr, int EventData1, int EventData2);

typedef struct
{
    HotCommBindCtrlStruct BindContrlArray[HotCommSystemBindCtrlMaxCount];
    int     BindCount;//实际绑定个数
    int     BindMaxCount;//最大绑定个数
}HotCommSystemBindCtrl;

typedef interface IHotComm_CtrlBind IHotComm_CtrlBind;
typedef struct IHotComm_CtrlBindVtbl
{
    BEGIN_INTERFACE
        
    HRESULT (CVIFUNC *GetSystemCtrlBindCount)(int Panel, int Control, int * Count, int * MaxCount);
    HRESULT (CVIFUNC *HotComm_SystemCtrlPasswordBindInit) (void);
    
    END_INTERFACE
} IHotComm_CtrlBindVtbl;

interface IHotComm_CtrlBind
{
    CONST_VTBL struct IHotComm_CtrlBindVtbl *lpVtbl;
    HotCommSystemBindCtrl IHotCommSystemBindCtrl;
};

/*---------------------------------------------------------------------------------------------------------------------
    HotComm将采用COM接口技术对HotComm进行再封装
----------------------------------------------------------------------------------------------------------------------*/
HRESULT CVIFUNC HotCommInterfaceInit (void)
{
    HRESULT __result = S_FALSE;
    IHotCommCtrlBind.lpVtbl = (CONST_VTBL struct IHotComm_CtrlBindVtbl *)malloc (sizeof(IHotComm_CtrlBindVtbl));
    if (IHotCommCtrlBind.lpVtbl)
    {
        IHotCommCtrlBind.IHotCommSystemBindCtrl.BindCount = 0;
        IHotCommCtrlBind.IHotCommSystemBindCtrl.BindMaxCount = HotCommSystemBindCtrlMaxCount;
        IHotCommCtrlBind.lpVtbl->GetSystemCtrlBindCount = HotComm_GetSystemCtrlPassword;        
        __result = S_OK;    
    }
    return __result;
}

HRESULT CVIFUNC HotCommInterfaceQuit (void)
{
HRESULT __result = S_FALSE;
    free (IHotCommCtrlBind.lpVtbl); 
    __result = S_OK;    
    return __result;
}


void CVIFUNC SystemInit(void)
{
    HotCommInterfaceInit ();
    TabpanelInit();
//进入后将TAB隐藏并设置密码,前这为TAB,后者是激活密码需要点击的控件,一般用图片之类的控件覆盖.    

    HotComm_BindSystemCtrlPassword (TabpanelHandle4, TABPANEL_4_Password, "250");
    HotComm_BindSystemCtrlPassword (TabpanelHandle5, TABPANEL_5_Password, "250");
//    HotComm_BindSystemTabsPassword (panelHandle, PANEL_MAINTAB, TabpanelHandle5, TABPANEL_5_Password, "250");
    UartInit();
    TaskInit();
    TestInit();
    HotCommInterfaceQuit ();
}

HRESULT CVIFUNC HotComm_BindSystemCtrlPassword (int Panel, int Control, const char *Password)
{
    HRESULT __result;
    int Count;
    int MaxCount;
    __result = IHotCommCtrlBind.lpVtbl->GetSystemCtrlBindCount (Panel, Control, &Count, &MaxCount);
    if (__result == S_OK)//
    {
        IHotCommCtrlBind.IHotCommSystemBindCtrl.BindContrlArray[Count].Panel = Panel; 
        IHotCommCtrlBind.IHotCommSystemBindCtrl.BindContrlArray[Count].Control = Control; 
        SetCtrlAttribute (Panel, Control, ATTR_CALLBACK_FUNCTION_POINTER, (HotCommBindCtrlCallbackPtr)HotComm_SystemCtrlPassword);//
        SetCtrlAttribute (Panel, Control, ATTR_CALLBACK_DATA, (HotCommBindCtrlStructPtr)&IHotCommCtrlBind.IHotCommSystemBindCtrl.BindContrlArray[Count]);//
        IHotCommCtrlBind.IHotCommSystemBindCtrl.BindCount ++; 
        __result = S_OK;//控件被成功绑定
    }
    return  __result;
}

//HotComm系统内部回调函数!!!(不对外)
int CVICALLBACK HotComm_SystemCtrlPassword (int Panel, int Control, int Event,
        HotCommBindCtrlStruct *BindCtrlPtr, int EventData1, int EventData2)
{
    switch (Event)
    {
        case EVENT_LEFT_CLICK:
            if ((Panel == BindCtrlPtr->Panel) && (Control == BindCtrlPtr->Control))//已绑定
            {
                SetCtrlAttribute (Panel, Control, ATTR_VISIBLE, 0);//不可视
            }
            break;
    }
    return 0;
}

相关下载

相关帖子

沙发
hotpower|  楼主 | 2008-7-24 07:58 | 只看该作者

先上班占沙发~~~

使用特权

评论回复
板凳
| | 2008-7-24 08:05 | 只看该作者

板凳...其实把软件做好,不公布源码也不错啊.

把使用说明写详细就好...
辛苦啊....

使用特权

评论回复
地板
zjh006| | 2008-7-24 08:31 | 只看该作者

公布了也看不懂

使用特权

评论回复
5
huangqi412| | 2008-7-24 08:42 | 只看该作者

老hot还是发布一个体验版,让大家尝尝新鲜蔬菜吧.

你这东西没几个人看的懂哇.

蔬菜大家都吃的懂

使用特权

评论回复
6
hbicecream| | 2008-7-24 08:52 | 只看该作者

要是做平台的都这么写程序,那就。。。。

使用特权

评论回复
7
sz_kd| | 2008-7-24 09:22 | 只看该作者

呵呵,我看不懂~~~~~~~~~~~~~~~~~~

使用特权

评论回复
8
djyos| | 2008-7-24 09:42 | 只看该作者

先准备好再下锅好点

洗干净,切好,备油盐酱醋,再检查一下,都齐了,再点火、下锅,这叫炒菜。
若没准备好就点火,就不是炒菜而是炒作了。

使用特权

评论回复
9
djyos| | 2008-7-24 09:50 | 只看该作者

本来想做螃蟹的

    我以前写过一个需要用串口的小程序,现在想用,却不知所踪,估计是不小心删掉了。不得不重编,看到老菜大作,本来想做一回螃蟹,可怎么也看不懂,到老菜的blog里找也看不懂,只好做了罢。
    在我眼里,高质量的软件,在业内人士眼里肯定是看得懂的。

使用特权

评论回复
10
程序匠人| | 2008-7-24 10:01 | 只看该作者

哈哈,一石头激起三尺浪,一浪更比一浪浪!

使用特权

评论回复
11
huangqi412| | 2008-7-24 10:35 | 只看该作者

老hot就先给个体验版,大家评一下吧.

使用特权

评论回复
12
sodwell| | 2008-7-24 10:54 | 只看该作者

re

要是HOT大叔能已这样的写法写10W行的C程序(非C++),那就厉害了

使用特权

评论回复
13
gyt| | 2008-7-24 12:13 | 只看该作者

谢谢分享

使用特权

评论回复
14
icecut| | 2008-7-24 12:28 | 只看该作者

强悍

typedef
我都晕了
再添加一个自动发送的正则表达式解析吧.
哈哈,到时候发协议就直接设定就ok了

使用特权

评论回复
15
hotpower|  楼主 | 2008-7-24 13:25 | 只看该作者

实际代码早有所公开~~~

使用特权

评论回复
16
hotpower|  楼主 | 2008-7-24 13:30 | 只看该作者

回14楼:最终在命令窗口嵌入C编译器,像VB一样运行

哈哈~~~只要俺还有力气~~~

迷糊一下,2点给地主干活~~~

使用特权

评论回复
17
walnutcy| | 2008-7-24 19:56 | 只看该作者

先出个1.0版本体验下,再炒作吧,

使用特权

评论回复
18
huangqi412| | 2008-7-24 20:03 | 只看该作者

找到老hot错别字两个,嘿嘿.

使用特权

评论回复
19
开发过程| | 2008-7-25 08:30 | 只看该作者

看到毛主席,俺心里发毛,

使用特权

评论回复
20
hotpower|  楼主 | 2008-8-1 02:21 | 只看该作者

俺先对付阶级敌人后再搞个体验版的接受攻击~~~

1.加入了串口自动识别:


2.注册要回邮件:


3.**串口状态:


4.托盘更正规方便(双击图标显示和隐藏):



5.多实例运行提示:



因为这次要和阶级敌人战斗,所以要搞正规战~~~

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1538

主题

21697

帖子

506

粉丝