LearnHouse

Archive for 三月, 2010

頭痛~總是被派去解很難解決的問題

我念研究所到底是來研究的還是來挑戰不可能的
打從進實驗室就被定位一直產出超出我能力的事
我好想做我想學的東西,可是永遠沒時間
哀~~~~~永遠的loop
while(1)
{
挑戰不可能的coding.......
}

我的論文呢?????從沒思考過,根本沒時間思考
我真的念資管嗎???我想學東西阿~"~
我到底學到什麼?????東跳西跳沒有一個邏輯

2010/4/14
每當debug不出來的時候 不想拿這文憑的感覺就越強烈 ~"~
這三年大概只學到怎麼兜程式了吧!!
碩士生該有的thinking,該有的analysis ability,我有嗎???
我的reserch總是不在paper上,只有在網路上serch可以套到我系統的source code
想把reserch做好,但卻一定要解決根research沒有直接關係的議題上
然後又是同樣的loop.....解決很困難的coding
是我的問題嗎? 是我沒仔細思考過我想要學什麼嗎? 還是我根本不知道我想學什麼?
也許我已經離"成功"這兩個字越來越遠了,一個成功的人不會花時間在這裡抱怨
他只會思考該怎麼解決現在的難題,一步一步的去完成

posted by yuchin in 生活日記 and have No Comments

大嘴巴『永遠在身邊』,原唱青山テルマ 『そばにいるね』

大嘴巴『永遠在身邊』

[原唱]青山黛瑪 青山テルマ- 留我在身邊そばにいるね

posted by yuchin in 影視娛樂 and have No Comments

終於也到做介面的階段了..............

這兩天都在用MFC的東西,原來寫介面也是一個大學問
通常玩程式的人都是從介面開始慢慢深下去
我卻是反其道而行,從socket、thread、timer一路玩上來
一路走來很多東西都想寫篇文章介紹一下,但卻都是心有餘而力不足
以後有機會在慢慢補上了
今天做了幾個PC版暫定版的介面,到時候還有Client WinCE版的!!

Server端

Client端

posted by yuchin in 生活日記 and have No Comments

[C/C++]MFC ComboBox 使用方法

Step1 首先當然是要在工具箱拉Combo Box出來
在Data屬性中可以放入你想要放的值或資料,只要用分號『;』隔開,例如:10;20;30;40

Step2 再來設定變數
CComboBox *m_sTimeout;  //宣告Combo Box物件位址變數
CString strCBTimeout; //宣告所選的值或資料變數
int SetTimeout = 0;    //宣告轉換字串成整數值變數

Step3取得Combo Box物件資料
m_sTimeout = (CComboBox *)GetDlgItem(IDC_COMBOTIMEOUT);

if(m_sTimeout->GetCurSel() >=0)  //當有取到值的時候執行會回傳選取的編號
{
m_sTimeout->GetLBText(m_sTimeout->GetCurSel(), strCBTimeout); //剛選取的編號值放入字串
SetTimeout = atoi(strCBTimeout); //將選取的字串值轉成整數值
}
else
SetTimeout = 8000;

可參考下面解說http://www.codersource.net/mfc/mfc-tutorials/ccombobox-example.aspx

CComboBox Example

Minimize

Combo box controls are space savers. Wherever there is no need for a multi-select from a list of items, combo box is a good choice in such places. This article " CComboBox Example" explains how to use the MFC CComboBox class for manipulation of a list of strings.

CComboBox Example - Initializing a Combo Box:

It is assumed that the readers of the sample have already created a dialog box (either in a dialog based application or SDI/MDI application) and placed a combo box control from the controls toolbox on the Resource Editor.

After placing the combo box control on the dialog box, open the class wizard by pressing Ctrl + W keys or Menu --> View --> ClassWizard. In the Member Variables tab, Add a Variable for the CComboBox class. This CComboBox example assumes that the variable name is,

CComboBox  m_cbExample;

This m_cbExample will be used further in our CComboBox example MFC code.

CComboBox Example - Adding Items to a Combo Box:

The function AddString is used for adding items to a combo box. If there is a constant set of data, these values can also be added in the Resource Editor itself. The Combo Box control properties dialog has a tab for adding data. Otherwise the data can be added as follows.

m_cbExample.AddString("StringData1");
m_cbExample.AddString("StringData2");
m_cbExample.AddString("StringData3");

CComboBox Example - Retrieving Items from a Combo Box:

Usually a requirement for retrieving items from the combo box will arise from selecting the data. This article also assumes the same. Now the data selected in a combo box needs to be retrieved.

To do this, the first step is to find out the index of the selected item inside the combo box control. Then the item at the corresponding position needs to be pulled out as follows.

int nIndex = m_cbExample.GetCurSel();
CString strCBText;
m_cbExample.GetLBText( nIndex, strCBText);

In the above CComboBox example code, the value will be retrieved and stored in strCBText variable. There is another overloaded version for GetLBText. But the version which uses CString is the easiest one.

CComboBox Example - Finding Items inside a Combo Box:

This kind of Find operations on a Combo box will most probably be useful in programs that dynamically modify the values in a combo box. The function FindStringExact is used to find the exact string match inside a combo box.

int nIndex = m_cbExample.FindStringExact(0, "Value to be found");

The string position inside the combo box control is the return value. It returns CB_ERR if it was unsuccessful in finding the string.

CComboBox Example - Deleting Items from a Combo Box:

This operation can be done by using the CCombobox member function DeleteString. This function needs the index of the item inside the combo box.

m_cbExample.DeleteString(nIndex);

posted by yuchin in 程式&軟體 and have No Comments

受保護的文章:當一個人孤單的時候

本文受密碼保護,須填寫您的密碼才能閱讀。


posted by yuchin in 生活日記 and have 輸入密碼方能觀看迴響。