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

📄 geopad.h

📁 GeoPAD SDK C# vb.net Mobile phone地图编程控件 可开发poket pc及smart phone 上的地图应用程序!
💻 H
📖 第 1 页 / 共 2 页
字号:
/************************************************************
//
//		Copyright (C) 2002-2006, Geo Soft 
//		All Rights Reserved
//		mail: sales@geopad.net
//		web:  http://www.geopad.net
//		Developer : Khunti Popat
//
************************************************************/

#include "stdafx.h"

class CGeoPADCtrl
{
	HINSTANCE hInstasnce;

public:
	CGeoPADCtrl(){
		hInstasnce = LoadLibrary(TEXT("GeoPAD.dll"));
	}
	~CGeoPADCtrl(){
		RemoveAll();
		FreeLibrary(hInstasnce);
	}
	
	bool License(char *licenseKey) 
	{
		bool (PASCAL *funLicense)(char *licenseKey);
		(FARPROC&)funLicense = GetProcAddress(hInstasnce,_T("GeoPAD_License"));
		if(funLicense)
			return funLicense(licenseKey);
		return false;
	}

	bool AddLayer(char *LayerPath) 
	{
		bool (PASCAL *funAddLayer)(char *LayerPath);
		(FARPROC&)funAddLayer = GetProcAddress(hInstasnce,_T("GeoPAD_AddLayer"));
		if(funAddLayer)
			return funAddLayer(LayerPath);
		return false;
	}
	bool OpenProject(char *ProjectPath) 
	{
		bool (PASCAL *funOpenProject)(char *ProjectPath);
		(FARPROC&)funOpenProject = GetProcAddress(hInstasnce,_T("GeoPAD_OpenProject"));
		if(funOpenProject)
			return funOpenProject(ProjectPath);
		return false;
	}
	bool SaveProject(char *ProjectPath) 
	{
		bool (PASCAL *funSaveProject)(char *ProjectPath);
		(FARPROC&)funSaveProject = GetProcAddress(hInstasnce,_T("GeoPAD_SaveProject"));
		if(funSaveProject)
			return funSaveProject(ProjectPath);
		return false;
	}
	bool SaveLegend() 
	{
		bool (PASCAL *funSaveLegend)();
		(FARPROC&)funSaveLegend = GetProcAddress(hInstasnce,_T("GeoPAD_SaveLegend"));
		if(funSaveLegend)
			return funSaveLegend();
		return false;
	}

	void RemoveAll() 
	{
		void (PASCAL *funRemoveAll)();
		(FARPROC&)funRemoveAll = GetProcAddress(hInstasnce,_T("GeoPAD_RemoveAll"));
		if(funRemoveAll)
			funRemoveAll();
	}
	bool RemoveLayer() 
	{
		bool (PASCAL *funRemoveLayer)();
		(FARPROC&)funRemoveLayer = GetProcAddress(hInstasnce,_T("GeoPAD_RemoveLayer"));
		if(funRemoveLayer)
			return funRemoveLayer();
		return false;
	}
	int GetTotalLayer() 
	{
		int (PASCAL *funGetTotalLayer)();
		(FARPROC&)funGetTotalLayer = GetProcAddress(hInstasnce,_T("GeoPAD_GetTotalLayer"));
		if(funGetTotalLayer)
			return funGetTotalLayer();
		return 0;
	}
	int GetTotalObj() 
	{
		int (PASCAL *funGetTotalObj)();
		(FARPROC&)funGetTotalObj = GetProcAddress(hInstasnce,_T("GeoPAD_GetTotalObj"));
		if(funGetTotalObj)
			return funGetTotalObj();
		return 0;
	}
	
	long GetObjFillColor(int ShapeIndex) 
	{
		long (PASCAL *funGetObjFillColor)(int ShapeIndex);
		(FARPROC&)funGetObjFillColor = GetProcAddress(hInstasnce,_T("GeoPAD_GetObjFillColor"));
		if(funGetObjFillColor)
			return funGetObjFillColor(ShapeIndex);
		return 0;
	}
	bool SetObjFillColor(int ShapeIndex,long fColor) 
	{
		bool (PASCAL *funSetObjFillColor)(int ShapeIndex,long fColor);
		(FARPROC&)funSetObjFillColor = GetProcAddress(hInstasnce,_T("GeoPAD_SetObjFillColor"));
		if(funSetObjFillColor)
			return funSetObjFillColor(ShapeIndex,fColor);
		return false;
	}
	long GetObjLineColor(int ShapeIndex) 
	{
		long (PASCAL *funGetObjLineColor)(int ShapeIndex);
		(FARPROC&)funGetObjLineColor = GetProcAddress(hInstasnce,_T("GeoPAD_GetObjLineColor"));
		if(funGetObjLineColor)
			return funGetObjLineColor(ShapeIndex);
		return 0;
	}
	bool SetObjLineColor(int ShapeIndex,long fColor) 
	{
		bool (PASCAL *funSetObjLineColor)(int ShapeIndex,long fColor);
		(FARPROC&)funSetObjLineColor= GetProcAddress(hInstasnce,_T("GeoPAD_SetObjLineColor"));
		if(funSetObjLineColor)
			return funSetObjLineColor(ShapeIndex,fColor);
		return false;
	}
	bool DeleteShpIndex() 
	{
		bool (PASCAL *funDeleteShpIndex)();
		(FARPROC&)funDeleteShpIndex= GetProcAddress(hInstasnce,_T("GeoPAD_DeleteShpIndex"));
		if(funDeleteShpIndex)
			return funDeleteShpIndex();
		return false;
	}
	bool SetLayerOrder(int num,int seq) 
	{
		bool (PASCAL *funSetLayerOrder)(int num,int seq);
		(FARPROC&)funSetLayerOrder = GetProcAddress(hInstasnce,_T("GeoPAD_SetLayerOrder"));
		if(funSetLayerOrder)
			return funSetLayerOrder(num,seq);
		return false;
	}
	int GetLayerOrder(int num) 
	{
		int (PASCAL *funGetLayerOrder)(int num);
		(FARPROC&)funGetLayerOrder = GetProcAddress(hInstasnce,_T("GeoPAD_GetLayerOrder"));
		if(funGetLayerOrder)
			return funGetLayerOrder(num);
		return -1;
	}
	int GetLayerType() 
	{
		int (PASCAL *funGetLayerType)();
		(FARPROC&)funGetLayerType = GetProcAddress(hInstasnce,_T("GeoPAD_GetLayerType"));
		if(funGetLayerType)
			return funGetLayerType();
		return -1;
	}
	char * GetLayerPath() 
	{
		char * (PASCAL *funGetLayerPath)();
		(FARPROC&)funGetLayerPath = GetProcAddress(hInstasnce,_T("GeoPAD_GetLayerPath"));
		if(funGetLayerPath)
			return funGetLayerPath();
		return NULL;
	}
	bool GetLayerFill() 
	{
		bool (PASCAL *funGetLayerFill)();
		(FARPROC&)funGetLayerFill = GetProcAddress(hInstasnce,_T("GeoPAD_GetLayerFill"));
		if(funGetLayerFill)
			return funGetLayerFill();
		return false;
	}
	bool SetLayerFill(bool onoff) 
	{
		bool (PASCAL *funSetLayerFill)(bool onoff);
		(FARPROC&)funSetLayerFill = GetProcAddress(hInstasnce,_T("GeoPAD_SetLayerFill"));
		if(funSetLayerFill)
			return funSetLayerFill(onoff);
		return false;
	}
	bool GetLayerOnOff() 
	{
		bool (PASCAL *funGetLayerOnOff)();
		(FARPROC&)funGetLayerOnOff = GetProcAddress(hInstasnce,_T("GeoPAD_GetLayerOnOff"));
		if(funGetLayerOnOff)
			return funGetLayerOnOff();
		return false;
	}
	bool SetLayerOnOff(bool onoff) 
	{
		bool (PASCAL *funSetLayerOnOff)(bool onoff);
		(FARPROC&)funSetLayerOnOff = GetProcAddress(hInstasnce,_T("GeoPAD_SetLayerOnOff"));
		if(funSetLayerOnOff)
			return funSetLayerOnOff(onoff);
		return false;
	}
	bool DrawLayer(HDC hDC) 
	{
		bool (PASCAL *funDrawLayer)(HDC hDC);
		(FARPROC&)funDrawLayer = GetProcAddress(hInstasnce,_T("GeoPAD_DrawLayer"));
		if(funDrawLayer)
			return funDrawLayer(hDC);
		return false;
	}
	bool AutoRedraw(HDC hDC) 
	{
		bool (PASCAL *funAutoRedraw)(HDC hDC);
		(FARPROC&)funAutoRedraw = GetProcAddress(hInstasnce,_T("GeoPAD_AutoRedraw"));
		if(funAutoRedraw)
			return funAutoRedraw(hDC);
		return false;
	}
	bool GSTools(HDC hDC,int buttonNum,int type,int x,int y) 
	{
		bool (PASCAL *funGSTools)(HDC hDC,int buttonNum,int type,int x,int y);
		(FARPROC&)funGSTools = GetProcAddress(hInstasnce,_T("GeoPAD_GSTools"));
		if(funGSTools)
			return funGSTools(hDC,buttonNum,type,x,y);
		return false;
	}
	bool ZoomExt(int xMin,int yMin,int xMax,int yMax) 
	{
		bool (PASCAL *funZoomExt)(int xMin,int yMin,int xMax,int yMax);
		(FARPROC&)funZoomExt = GetProcAddress(hInstasnce,_T("GeoPAD_ZoomExt"));
		if(funZoomExt)
			return funZoomExt(xMin,yMin,xMax,yMax);
		return false;
	}
	bool ZoomDraw(float zoom) 
	{
		bool (PASCAL *funZoomDraw)(float zoom);
		(FARPROC&)funZoomDraw = GetProcAddress(hInstasnce,_T("GeoPAD_ZoomDraw"));
		if(funZoomDraw)
			return funZoomDraw(zoom);
		return false;
	}
	bool ZoomWindowIn(int xMin,int yMin,int xMax,int yMax) 
	{
		bool (PASCAL *funZoomWindowIn)(int xMin,int yMin,int xMax,int yMax);
		(FARPROC&)funZoomWindowIn = GetProcAddress(hInstasnce,_T("GeoPAD_ZoomWindowIn"));
		if(funZoomWindowIn)
			return funZoomWindowIn(xMin,yMin,xMax,yMax);
		return false;
	}
	bool ZoomWindowOut(int xMin,int yMin,int xMax,int yMax) 
	{
		bool (PASCAL *funZoomWindowOut)(int xMin,int yMin,int xMax,int yMax);
		(FARPROC&)funZoomWindowOut = GetProcAddress(hInstasnce,_T("GeoPAD_ZoomWindowOut"));
		if(funZoomWindowOut)
			return funZoomWindowOut(xMin,yMin,xMax,yMax);
		return false;
	}
	bool ZoomCurrentLayer() 
	{
		bool (PASCAL *funZoomCurrentLayer)();
		(FARPROC&)funZoomCurrentLayer = GetProcAddress(hInstasnce,_T("GeoPAD_ZoomCurrentLayer"));
		if(funZoomCurrentLayer)
			return funZoomCurrentLayer();
		return false;
	}
	bool ZoomLayer(int layerNo) 
	{
		bool (PASCAL *funZoomLayer)(int layerNo);
		(FARPROC&)funZoomLayer = GetProcAddress(hInstasnce,_T("GeoPAD_ZoomLayer"));
		if(funZoomLayer)
			return funZoomLayer(layerNo);
		return false;
	}
	bool ZoomShapeId(int shpId) 
	{
		bool (PASCAL *funZoomShapeId)(int shpId);
		(FARPROC&)funZoomShapeId = GetProcAddress(hInstasnce,_T("GeoPAD_ZoomShapeId"));
		if(funZoomShapeId)
			return funZoomShapeId(shpId);
		return false;
	}
	bool ZoomSelected() 
	{
		bool (PASCAL *funZoomSelected)();
		(FARPROC&)funZoomSelected = GetProcAddress(hInstasnce,_T("GeoPAD_ZoomSelected"));
		if(funZoomSelected)
			return funZoomSelected();
		return false;
	}
	bool RemoveSelection() 
	{
		bool (PASCAL *funRemoveSelection)();
		(FARPROC&)funRemoveSelection = GetProcAddress(hInstasnce,_T("GeoPAD_RemoveSelection"));
		if(funRemoveSelection)
			return funRemoveSelection();
		return false;
	}
	bool CenterSelected() 
	{
		bool (PASCAL *funCenterSelected)();
		(FARPROC&)funCenterSelected = GetProcAddress(hInstasnce,_T("GeoPAD_CenterSelected"));
		if(funCenterSelected)
			return funCenterSelected();
		return false;
	}
	bool Pan(int x,int y) 
	{
		bool (PASCAL *funPan)(int x,int y);
		(FARPROC&)funPan = GetProcAddress(hInstasnce,_T("GeoPAD_Pan"));
		if(funPan)
			return funPan(x,y);
		return false;
	}
	bool Recenter(int x,int y) 
	{
		bool (PASCAL *funRecenter)(int x,int y);
		(FARPROC&)funRecenter = GetProcAddress(hInstasnce,_T("GeoPAD_Recenter"));
		if(funRecenter)
			return funRecenter(x,y);
		return false;
	}
	bool RecenterGPS(double x,double y) 
	{
		bool (PASCAL *funRecenterGPS)(double x,double y);
		(FARPROC&)funRecenterGPS = GetProcAddress(hInstasnce,_T("GeoPAD_RecenterGPS"));
		if(funRecenterGPS)
			return funRecenterGPS(x,y);
		return false;
	}
	int GetX(double x) 
	{
		int (PASCAL *funGetX)(double x);
		(FARPROC&)funGetX = GetProcAddress(hInstasnce,_T("GeoPAD_GetX"));
		if(funGetX)
			return funGetX(x);
		return 0;
	}
	int GetY(double y) 
	{
		int (PASCAL *funGetY)(double y);
		(FARPROC&)funGetY = GetProcAddress(hInstasnce,_T("GeoPAD_GetY"));
		if(funGetY)
			return funGetY(y);
		return 0;
	}
	double GetMapX(int x) 
	{
		double (PASCAL *funGetMapX)(int x);
		(FARPROC&)funGetMapX = GetProcAddress(hInstasnce,_T("GeoPAD_GetMapX"));
		if(funGetMapX)
			return funGetMapX(x);
		return 0.0;
	}
	double GetMapY(int y) 
	{
		double (PASCAL *funGetMapY)(int y);
		(FARPROC&)funGetMapY = GetProcAddress(hInstasnce,_T("GeoPAD_GetMapY"));
		if(funGetMapY)
			return funGetMapY(y);
		return 0.0;
	}
	char* GetLatitude(int x) 
	{
		char* (PASCAL *funGetLatitude)(int x);
		(FARPROC&)funGetLatitude = GetProcAddress(hInstasnce,_T("GeoPAD_GetLatitude"));
		if(funGetLatitude)
			return funGetLatitude(x);
		return NULL;
	}
	char* GetLongitude(int y) 
	{
		char* (PASCAL *funGetLongitude)(int y);
		(FARPROC&)funGetLongitude = GetProcAddress(hInstasnce,_T("GeoPAD_GetLongitude"));
		if(funGetLongitude)
			return funGetLongitude(y);
		return NULL;
	}
	int SetCurrentLayer(int curLayer) 
	{
		int (PASCAL *funSetCurrentLayer)(int curLayer);
		(FARPROC&)funSetCurrentLayer = GetProcAddress(hInstasnce,_T("GeoPAD_SetCurrentLayer"));
		if(funSetCurrentLayer)
			return funSetCurrentLayer(curLayer);
		return -1;
	}
	int GetCurrentLayer() 
	{
		int (PASCAL *funGetCurrentLayer)();
		(FARPROC&)funGetCurrentLayer = GetProcAddress(hInstasnce,_T("GeoPAD_GetCurrentLayer"));
		if(funGetCurrentLayer)
			return funGetCurrentLayer();
		return -1;
	}
	int GetShpIdx(int x,int y) 
	{
		int (PASCAL *funGetShpIdx)(int x,int y);
		(FARPROC&)funGetShpIdx = GetProcAddress(hInstasnce,_T("GeoPAD_GetShpIdx"));
		if(funGetShpIdx)
			return funGetShpIdx(x,y);
		return -1;
	}
	double GetDistance(int x1, int y1, int x2, int y2) 
	{
		double (PASCAL *funGetDistance)(int x1, int y1, int x2, int y2);
		(FARPROC&)funGetDistance = GetProcAddress(hInstasnce,_T("GeoPAD_GetDistance"));
		if(funGetDistance)
			return funGetDistance(x1,y1,x2,y2);
		return 0.0;
	}
	/**************************************************************
	DBF Query functions
	***************************************************************/
	bool SetQFieldValue(char* field,char* fieldValue) 
	{
		bool (PASCAL *funSetQFieldValue)(char* field,char* fieldValue);
		(FARPROC&)funSetQFieldValue = GetProcAddress(hInstasnce,_T("GeoPAD_SetQFieldValue"));
		if(funSetQFieldValue)
			return funSetQFieldValue(field,fieldValue);
		return false;
	}
	char* GetFieldValue(char* field) 
	{
		char* (PASCAL *funGetFieldValue)(char* field);
		(FARPROC&)funGetFieldValue = GetProcAddress(hInstasnce,_T("GeoPAD_GetFieldValue"));
		if(funGetFieldValue)
			return funGetFieldValue(field);
		return NULL;
	}
	char* GetFieldNoValue(int field) 
	{
		char* (PASCAL *funGetFieldNoValue)(int field);
		(FARPROC&)funGetFieldNoValue = GetProcAddress(hInstasnce,_T("GeoPAD_GetFieldNoValue"));
		if(funGetFieldNoValue)
			return funGetFieldNoValue(field);
		return NULL;
	}
	bool Query(char* Qstr) 
	{
		bool (PASCAL *funQuery)(char* Qstr);
		(FARPROC&)funQuery = GetProcAddress(hInstasnce,_T("GeoPAD_Query"));
		if(funQuery)
			return funQuery(Qstr);
		return false;
	}
	int GetFieldCount() 
	{
		bool (PASCAL *funGetFieldCount)();
		(FARPROC&)funGetFieldCount = GetProcAddress(hInstasnce,_T("GeoPAD_GetFieldCount"));
		if(funGetFieldCount)
			return funGetFieldCount();
		return 0;
	}
	int GetRecordCount() 
	{
		int (PASCAL *funGetRecordCount)();
		(FARPROC&)funGetRecordCount = GetProcAddress(hInstasnce,_T("GeoPAD_GetRecordCount"));
		if(funGetRecordCount)
			return funGetRecordCount();
		return 0;
	}
	char* GetFieldName(int field) 
	{
		char * (PASCAL *funGetFieldName)(int field);
		(FARPROC&)funGetFieldName = GetProcAddress(hInstasnce,_T("GeoPAD_GetFieldName"));
		if(funGetFieldName)
			return funGetFieldName(field);
		return NULL;
	}
	int GetFieldType(int field) 
	{
		int (PASCAL *funGetFieldType)(int field);
		(FARPROC&)funGetFieldType = GetProcAddress(hInstasnce,_T("GeoPAD_GetFieldType"));
		if(funGetFieldType)
			return funGetFieldType(field);

⌨️ 快捷键说明

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