본문 바로가기

sample

mfc, List Control Cell값 수정 edit, 변경 하기 - sample source win 11, visual studio 2010 에서 했읍니다. mfc 에서 제공 되는 List control 은 수정 이 안된다.지금 소개 하는 방법은 편법 이다.List control 의 한 Cell 을 선택 하면 Edit control 을 선택하고, 그 값을 수정 하게 하여 다시 list 에 저장하는 방법 이다.구차 하게,,   다 만들면 이용 방법은list cell DOUBLE CLICK -> EDIT -> [Enter]또는 list cell one CLICK ->  [F2] -> EDIT -> [Enter]이다.즉 둘다 되는데, 사실 더블클릭만 쓰는게 편하니 이거만 해도 된다.  실행 창 입니다. 어째든 간단히 한다고 하는데, 나름 동작은 그럴싸 합니다. 순서.1. list 와 edit 를 만든.. 더보기
c 로 trim ( white space 빈칸, 공백 등 삭제 ) 만들기, sample source 그냥 소스 올립니다. //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// define White Space// ' ' (0x20) space (SPC)//'\t' (0x09) horizontal tab (TAB)//'\n' (0x0a) newline (LF)//'\v' (0x0b) vertical tab (VT)//'\f' (0x0c) feed (FF)//'\r' (0x0d) carriage return (CR)// Check if WhiteSpaceunsigned.. 더보기
nuvoton, va_list 로 printf 만들기 , sample source 뭐... 각설 하고,, 걍 소스 올립니다. #include #include // memset, strncmp 때문에 추가.#include void TX1_char(unsigned char c) { UART_WRITE(UART1,c); while(!(UART1->FIFOSTS & UART_FIFOSTS_TXEMPTYF_Msk));}void TX1_string(char *s){ while(*s != '\0'){ TX1_char(*s); s++; }}void print1f(const char* format, ...){ char buf[1000]; va_list args; memset(buf, 0, sizeof(buf)); .. 더보기
mfc button 에 image 올리기, sample source mfc  button 에 이미지 올려기 순서1. button 만들기2. 이미지 추가 ===========================1. button 만들기> View -> Toolbox -> button -> 다이알로그에서 그린다> 버튼 특성 Property 창 (혹시 안뜨면 만들어진 버튼에서 마우스 오른쪽 버튼 -> property) 에서  - ID 가 IDC_BUTTON1 로 되어 있는데 적당한것으로 바꾼다 안바꿔도 되지만 여기서는 IDC_m_BUT_st1 로 한다.  - Bitmap 을 True 로 바꾸고, Owner Draw 도 True 로 바꾼다. ( Owner Draw 를 먼저 True 바꾸면 Bitmap 특성을 못바꾸니,  Bitmap 값을 먼저 바꿔야 한다)  2. 이미지 추가 > Res.. 더보기
mfc, image 보이기, sample source Mfc 에서 이미지 보이기 ( VS 2010 ) 여기서는 static 을 만들어 이미지를 보인다..   근데 써보니 button 을 만들어 이미지 하는게 더 좋을듯 순서1. Toolbox 에서 Pictire Control 추가2. 특성 ( Property ) 설정3. 이미지 추가4. 이미지 연동 하기  ================================1. Toolbox 에서 Pictire Control 추가>  View-Toolbax ( Ctrl-Alt-X) - [Picture Control] 선택 - 다이알 로그 창에 적당한 크기로 그리기> 2. 특성 ( Property ) 설정> 그린 Pic Control 에서 마우스 오른쪽 버튼 -> Property> ID 가 IDC_STATIC 인데 적당.. 더보기
MFC, CDialog 창 크기 변화에 따라 내부 control 크기 자동 변경, sample source 퍼왔읍니다. // This OnSize function resizes one large control in a dialog. // The one control grows horizontally and vertically to fill the dialog. It's position remains unchanged.// Other controls (buttons etc) would typically be above the one resizable control.// How to add OnSize:// [1] add to .h: afx_msg void OnSize(UINT nType, int cW, int cH);// [2] add to message map in .cpp.. 더보기
mfc serial port 열기, sample source 설명은 나중에 하고.. 소스 참고 하셔요VS2010 소스 입니다. 더보기
[mfc] ping , icmp 이거 저거, sample source ping 을 하기 위한 코드들 이거 저거 입니다. pingi - vs2010 에서 컴파일 ok,, 간단함... 이거 먼저 보셔요https://laguna.tistory.com/2657086ping - vs2010 에서 컴파일 ok, 복잡함.https://github.com/microsoft/Windows-classic-samples/tree/main/Samples/Win7Samples/netds/winsock/pingCPing_src.zip - vs2010 에서 컴파일 안됨 https://www.codeproject.com/Articles/378/CPing-v1-22V1.22 (1st March 2000) Fixed a problem where I was incorrectly overwritting me.. 더보기