최대 1 분 소요

OCPP 전문 보내기 예시

    request = call.DataTransferPayload(vendor_id = "aa",message_id ="str",data = "str")
    print(request)
    test = await cp.call(request)

    list_message = [2,test.unique_id,test.action,test.payload]
            
    send_message=json.dumps(list_message)
    print(send_message)    
    await manager.send_personal_message(send_message, websocket)
    print("메세지 보냈는지 확인")

MFC 에서 메인 호출시 발생하는 문제

https://stackoverflow.com/questions/68551851/mfc-debug-assertation-failed-wincore-cpp-line-972

MFC 팝업 메뉴 샘플

	CMenu mnuPopupSubmit;
	mnuPopupSubmit.LoadMenu(IDR_MENU1);

	// Get a pointer to the button
	CButton* pButton;
	pButton = reinterpret_cast<CButton*>(GetDlgItem(IDC_BTN_START));

	// Find the rectangle around the button
	CRect Button1;
	pButton->GetWindowRect(&Button1);

	// Get a pointer to the first item of the menu
	CMenu* mnuPopupMenu = mnuPopupSubmit.GetSubMenu(0);
	ASSERT(mnuPopupMenu);

	// Find out if the user right-clicked the button
	// because we are interested only in the button
	POINT ptOld;                // previous cursor location 
	::GetCursorPos(&ptOld);
	mnuPopupMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON, ptOld.x, ptOld.y, this);



MFC 글자 변경 관련 설정

https://aucd29.tistory.com/2083

// 타이틀을 출력 해주자.
CFont font;
LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT));
lf.lfHeight = 13;
lf.lfWeight = FW_BOLD;
wsprintf(lf.lfFaceName, L"Tahoma");
font.CreateFontIndirect(&lf);
CFont* def_font = mDC.SelectObject(&font);
mDC.SetBkMode(TRANSPARENT);
mDC.SetTextColor(RGB(0, 0, 0));
mDC.TextOut(26, 5, L"SMS WIZARD - THURAYA");
mDC.SetTextColor(RGB(255, 255, 255));
mDC.TextOut(25, 4, L"SMS WIZARD - THURAYA");
mDC.SelectObject(def_font);
font.DeleteObject();

#test

태그:

카테고리:

업데이트:

댓글남기기