⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rfid_int.cpp

📁 可捕捉到硬體的三軸的值
💻 CPP
字号:
// RFID_Int.cpp : Defines the entry point for the DLL application.
//

#include "stdafx.h"
#include "RFID_Int.h"
#include "resource.h"

ChannelType channelType;
	
extern "C" __declspec( dllexport ) ChannelType* __cdecl GetType() {
	channelType.guid		= RFID_GUID;				// GUID of the channel
	channelType.miversion	= QUEST3D_ENGINEVERSION;	// Core engine version, do not change

	StringCbCopy(channelType.name, 80, "RFID_Int");				// Name of the interface

	return &channelType;
}

RFID_INTDLL_EXPORTS

//////////////////////////////////////////////////////
// DlgProc - Dialog message processing
// Routes windows messages to the Dialog OnWndMessage method
//
BOOL CALLBACK    
RFID_IntDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{    
	// Create a pointer to the dialog class from the user data
	RFID_Int*		channelDialog=NULL;
	channelDialog = reinterpret_cast<RFID_Int*>(GetWindowLong(hwnd, GWL_USERDATA));

	if( ! channelDialog)
		return FALSE;

	return channelDialog->OnWndMessage(hwnd, message, wParam, lParam);
}

RFID_Int::RFID_Int() {
	dialogHwnd_=NULL;
}

RFID_Int::~RFID_Int() {
	SetWindowLong(dialogHwnd_, GWL_USERDATA, (DWORD)NULL);
	EndDialog(dialogHwnd_, 0);
	dialogHwnd_=NULL;
}

void RFID_Int::InitDialog()
{
	//TODO: Add further initialization code here
}

//////////////////////////////////////////////////////
// Release of the dialog
//
void RFID_Int::Release() {
	// Change our user data pointer into NULL to make sure it is cleared
	SetWindowLong(dialogHwnd_, GWL_USERDATA, (DWORD)NULL);
	// Destroy our window
	DestroyWindow(dialogHwnd_);
	// Clear our HWND
	dialogHwnd_=NULL;
	Quest3DReleaseDialog();
}

//////////////////////////////////////////////////////
// Refresh of the dialog
//
void RFID_Int::Refresh() {

}

BOOL RFID_Int::OnWndMessage(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {


	switch (message) {   
        case WM_COMMAND:						// Notification from a control
 			return OnCommandMessage (hwnd, (int)LOWORD(wParam), (HWND)(lParam), (UINT)HIWORD(wParam));
        case WM_INITDIALOG:
            return TRUE;
		case WM_HSCROLL:
			break;
	}

    return FALSE;
}

BOOL RFID_Int::OnCommandMessage(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify) {
	switch (id) {
		case 0:
		default:
			return FALSE;
	}

	return TRUE;
}


bool RFID_Int::GetChannelDialog(bool modeLess) {
	HWND hwnd = CreateDockingInterface();

	if(hwnd!=NULL) {
		return true;
	}
	return false;
}

bool RFID_Int::CreateDockedChannelDialog(HWND parentHwnd) {

	if(dialogHwnd_!=NULL) {
		ShowWindow(dialogHwnd_, SW_SHOW);
		return true;
	}


	dialogHwnd_ =  CreateDialog(dllInstance_, "IDD_RFID_INT", parentHwnd, (DLGPROC) RFID_IntDlgProc);
	if(dialogHwnd_==NULL) {
		eMsg("The RFID_Int dialog could not be created");
		return false;
	}

	SetWindowLong(dialogHwnd_, GWL_USERDATA, (DWORD)this);

	ourChannel_ = static_cast<RFID*>(channel_);

	ShowWindow(dialogHwnd_, SW_SHOW);

	InitDialog();

	Refresh();

	return true;
}


RECT RFID_Int::GetStandardDialogRect() {
	// Overload this function for a different window opening
	RECT dockingRect;

	dockingRect.left = 300;
	dockingRect.right = 450;
	dockingRect.top = 300;
	dockingRect.bottom = 550;

	return dockingRect;
}

void RFID_Int::SetTabWindowSize(int X, int Y, int newWidth, int newHeight) {
	MoveWindow(dialogHwnd_, X, Y, newWidth, newHeight, TRUE);
}

void RFID_Int::HideMainWindow(bool hide) {
	if(dialogHwnd_!=NULL) {
		if(hide)
			ShowWindow(dialogHwnd_, SW_HIDE);
		else
			ShowWindow(dialogHwnd_, SW_SHOW);
	}
}

bool RFID_Int::GetIfSupportForCancel() {
	//Note: If you return false, no Cancel button will be available
	return true;
}

void RFID_Int::ClickedOk() {
	//TODO: Add your handler logic here
}

void RFID_Int::ClickedCancel() {
	//TODO: Add your handler logic here
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -