Pulsmesser .dll integrieren
Übersicht

BlitzjockeyBetreff: Pulsmesser .dll integrieren |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Hallo erstmal!
Bevor ich loslege erst mal was kurzes über mich. Ich lese schon seit eine weile hier im Forum mit. Da ich allerdings bis jetzt noch nichts gefragt habe und - auf Grund fehlender Erfahrung - auch keine sinnvolle Beiträge erstellen könnte, habe ich mich zurück gehalten. Ich wohne in Berlin, bin aber Niederländer. (Bitte im Voraus um verzeihung irendwelche Grammatik-fehler.) Ich arbeite zur Zeit an ein kleines Programm um das Sport treiben im Winter etwas angenehmer zu gestalten. Dazu möchte ich ein Pulsmesser von Suunto über ein so genanntes "PC POD" benutzen um mein Puls auf dem Bildschirm anzeigen zu können. Es handelt sich um einen kleinen USB-Empfänger, welche als COM-port integriert wird. Dieses PC POD wird mit SDK geliefert, allerdings nicht für Blitz3D! (Tatsächlich, ja! Unverschämtheit..) Nun, ich habe dadurch aber den Header für C und C++ bekommen, plus den .dll. Da ich aber null erfahrung mit Decls und Dll's habe, würde ich Euch bitte mir ein wenig zu helfen. Hier habe ich erst mal den Header-datei eingefügt: Code: [AUSKLAPPEN] #ifndef SUUNTOPOD_H
#define SUUNTOPOD_H //////////////////////////////// // // SuuntoPod.h // // Copyright 2005 by Suunto Oy. // //////////////////////////////// /** @file SuuntoPod.h Type and function declarations for Suunto Pod dll. */ #define WIN32_LEAN_AND_MEAN #include <windows.h> // For VB support. #define PODAPI __stdcall #ifdef __cplusplus extern "C" { #endif /** @var typedef SPodMonitor * HPODMONITOR Pod monitor handle. */ struct SPodMonitor; typedef struct SPodMonitor * HPODMONITOR; /** @var typedef struct SHrBelt * HHRBELT Hr belt handle. */ struct SHrBelt; typedef struct SHrBelt * HHRBELT; /** @var typedef void (PODAPI *fnPODMONITOR_ProgressCallback)(int, void *) Function type for progress callback. Progress callback is called when pod ponitor is opening a Team Pod or a PC Pod to show that something is really happening. This is because opening a pod device can take over five seconds. The input parameter is a counter that shows a call sequence number and have no other special meaning. The second pointer is to support C++ this-pointer. */ typedef void (PODAPI *fnPODMONITOR_ProgressCallback)(int, void *); ////////////////////////// // Query version string /** @fn void PODAPI PODMONITOR_GetVersion(void); Return version string. @return version info as string. */ const char * PODAPI PODMONITOR_GetVersion(void); /** @var typedef void (PODAPI * fnPODMONITOR_GetVersion)(void) A function pointer type for PODMONITOR_GetVersion. */ typedef const char * (PODAPI * fnPODMONITOR_GetVersion)(void); /** @def FN_PODMONITOR_GetVersion(hDll) A macro to get PODMONITOR_GetVersion function pointer. @param hDll Library instance. */ #define FN_PODMONITOR_GetVersion(hDll) (fnPODMONITOR_GetVersion)GetProcAddress(hDll, "PODMONITOR_GetVersion") ////////////////////// // Configurate ports /** @fn void PODAPI PODMONITOR_ConfiguratePorts(const int * ports); Configurate the serial ports the Pod device monitor will open. This overrides the automatic search for Suunto USB Serial Pods. This call has to be made before PODMONITOR_Open() is called. @param ports Zero terminated array of integers for example {1, 2, 13, 0}. */ void PODAPI PODMONITOR_ConfiguratePorts(const int * ports); /** @var typedef void (PODAPI * fnPODMONITOR_ConfiguratePorts)(const int *) A function pointer type for PODMONITOR_ConfiguratePorts. */ typedef void (PODAPI * fnPODMONITOR_ConfiguratePorts)(const int *); /** @def FN_PODMONITOR_ConfiguratePorts(hDll) A macro to get PODMONITOR_ConfiguratePorts function pointer. @param hDll Library instance. */ #define FN_PODMONITOR_ConfiguratePorts(hDll) (fnPODMONITOR_ConfiguratePorts)GetProcAddress(hDll, "PODMONITOR_ConfiguratePorts") ///////////////// // Open monitor /** @fn HPODMONITOR PODAPI PODMONITOR_Open(fnPODMONITOR_ProgressCallback callBack, void * context) Open Suunto Pod device monitor. A Pod device monitor listens team pod or pc pod messages and creates pod devices when a message from a new device is found. There can be one and only one pod monitor at a time. @param callBack Progress callbac function. May be NULL. @param context Parameter for callback function. @return a handle to pod device monitor. */ HPODMONITOR PODAPI PODMONITOR_Open(fnPODMONITOR_ProgressCallback callBack, void * context); /** @var typedef HPODMONITOR (PODDLLAPI *fnPODMONITOR_Open)() A function pointer type for PODMONITOR_Open. */ typedef HPODMONITOR (PODAPI *fnPODMONITOR_Open)(fnPODMONITOR_ProgressCallback, void *); /** @def FN_PODMONITOR_Open(hDll) A macro to get PODMONITOR_Open function pointer. @param hDll Library instance. */ #define FN_PODMONITOR_Open(hDll) (fnPODMONITOR_Open)GetProcAddress(hDll, "PODMONITOR_Open") ///////////////// // Close monitor /** @fn void PODAPI PODMONITOR_Close(HPODMONITOR hPodTracker) Close Suunto Pod device monitor. @param hPodTracker A pod monitor handle. */ void PODAPI PODMONITOR_Close(HPODMONITOR hPodTracker); /** @var typedef void (PODAPI * fnPODMONITOR_Close)(HPODMONITOR) A function pointer type for PODMONITOR_Close. */ typedef void (PODAPI * fnPODMONITOR_Close)(HPODMONITOR); /** @def FN_PODMONITOR_Close(hDll) A macro to get PODMONITOR_Close function pointer. @param hDll Library instance. */ #define FN_PODMONITOR_Close(hDll) (fnPODMONITOR_Close)GetProcAddress(hDll, "PODMONITOR_Close") // <<<<<< Deprecated start >>>>>> ////////////////////////////////// // Update monitored serial ports /** @fn int PODAPI PODMONITOR_Update(HPODMONITOR hPodTracker, unsigned int param1, unsigned int param2) Update serial ports as response to OS device change message. For Win32 message WM_DEVICECHANGE param1 is the message wParam and param2 is the message lParam. @param hPodTracker A pod monitor handle. @param param1 1st parameter. @param param2 2nd parameter, */ void PODAPI PODMONITOR_Update(HPODMONITOR hPodTracker, unsigned int param1, unsigned int param2); /** @var typedef void (PODAPI * fnPODMONITOR_Update)(HPODMONITOR, unsigned int, unsigned int) A function pointer type for PODMONITOR_Close. */ typedef int (PODAPI * fnPODMONITOR_Update)(HPODMONITOR, unsigned int, unsigned int); /** @def FN_PODMONITOR_Update(hDll) A macro to get PODMONITOR_Update function pointer. @param hDll Library instance. */ #define FN_PODMONITOR_Update(hDll) \ (fnPODMONITOR_Update)GetProcAddress(hDll, "PODMONITOR_Update") // <<<<<< Deprecated end >>>>>> /////////////////////// // Get number of pods. /** @fn int PODAPI PODMONITOR_GetNumberOfPods(HPODMONITOR hPodTracker) Get number of pods opened. @param hPodTracker A pod monitor handle. @return number of pod devices found. */ int PODAPI PODMONITOR_GetNumberOfPods(HPODMONITOR hPodTracker); /** @var typedef int (PODAPI * fnPODMONITOR_GetNumberOfPods)(HPODMONITOR) A function pointer type for PODMONITOR_Close. */ typedef int (PODAPI * fnPODMONITOR_GetNumberOfPods)(HPODMONITOR); /** @def FN_PODMONITOR_GetNumberOfPods(hDll) A macro to get PODMONITOR_GetNumberOfPods function pointer. @param hDll Library instance. */ #define FN_PODMONITOR_GetNumberOfPods(hDll) \ (fnPODMONITOR_GetNumberOfPods)GetProcAddress(hDll, "PODMONITOR_GetNumberOfPods") //////////////// // Get hr belt /** @fn HHRBELT PODAPI PODMONITOR_GetHrBelt(HPODMONITOR hPodTracker) Get a new hr belt from pod device monitor if any. Returns 0 when no new belts available. @param hPodTracker A pod monitor handle. @return handle to a hr belt or 0. */ HHRBELT PODAPI PODMONITOR_GetHrBelt(HPODMONITOR hPodTracker); /** @var typedef HHRBELT (PODAPI *fnPODMONITOR_GetHrBelt)(HPODMONITOR) Function pointer type for PODMONITOR_GetHrBelt. */ typedef HHRBELT (PODAPI *fnPODMONITOR_GetHrBelt)(HPODMONITOR); /** @def FN_PODMONITOR_GetHrBelt(hDll) A macro to get PODMONITOR_GetHrBelt function pointer. @param hDll Library instance. */ #define FN_PODMONITOR_GetHrBelt(hDll) (fnPODMONITOR_GetHrBelt)GetProcAddress(hDll, "PODMONITOR_GetHrBelt") /////////////////////////////// // Get hrbelt id /** @fn int PODAPI HRBELT_GetId(HHRBELT hBelt) Get hr belt id. @param hBelt Belt handle. @return belt id as integer. */ int PODAPI HRBELT_GetId(HHRBELT hBelt); /** @var typedef int (PODAPI *fnHRBELT_GetId)(HHRBELT) Function pointer type for HRBELT_GetId. */ typedef int (PODAPI *fnHRBELT_GetId)(HHRBELT); /** @def FN_HRBELT_GetId(hDll) A macro to get HRBELT_GetId function pointer. @param hDll Library instance. */ #define FN_HRBELT_GetId(hDll) (fnHRBELT_GetId)GetProcAddress(hDll, "HRBELT_GetId") ///////////////// // Get hr value /** @fn int PODAPI HRBELT_GetHr(HHRBELT hBelt) Get current hr value. @param hBelt Belt handle. @return current hr value or -1 if hr available. */ int PODAPI HRBELT_GetHr(HHRBELT hBelt); /** @var typedef int (PODAPI *fnHRBELT_GetHr)(HHRBELT) Function pointer type for HRBELT_GetHr. */ typedef int (PODAPI *fnHRBELT_GetHr)(HHRBELT); /** @def FN_HRBELT_GetHr(hDll) A macro to get HRBELT_GetHr function pointer. @param hDll Library instance. */ #define FN_HRBELT_GetHr(hDll) (fnHRBELT_GetHr)GetProcAddress(hDll, "HRBELT_GetHr") ////////////////// // Get ibi value /** @fn int PODAPI HRBELT_GetIbi(HHRBELT hBelt) Get one collected ibi value if available. If function returns 0 there is no ibi values available, while non-zero means that there might be more values. To collect ibi values function HRBELT_StartCollecting has to be called. Ibi values can be polled periodically or the values can be read all at once just before ending monitoring. In this case it is advisable to stop ibi value collecting by calling HRBELT_StopCollecting. @param hBelt Belt handle. @return ibi value or 0. */ int PODAPI HRBELT_GetIbi(HHRBELT hBelt); /** @var typedef int (PODAPI *fnHRBELT_GetIbi)(HHRBELT) Function pointer type for HRBELT_GetIbi. */ typedef int (PODAPI *fnHRBELT_GetIbi)(HHRBELT); /** @def FN_HRBELT_GetIbi(hDll) A macro to get HRBELT_GetIbi function pointer. @param hDll Library instance. */ #define FN_HRBELT_GetIbi(hDll) (fnHRBELT_GetIbi)GetProcAddress(hDll, "HRBELT_GetIbi") ///////////////////////////////// // Start collecting ibi values /** @fn void PODAPI HRBELT_StartCollecting(HHRBELT hBelt) Activate ibi value collecting. Initally hr belt does not collect data. All previously stored data is cleared. @param hBelt Belt handle. */ void PODAPI HRBELT_StartCollecting(HHRBELT hBelt); /** @var typedef void (PODAPI *fnHRBELT_StartCollecting)(HHRBELT) Function pointer type for HRBELT_StartCollecting. */ typedef void (PODAPI *fnHRBELT_StartCollecting)(HHRBELT); /** @def FN_HRBELT_StartCollecting(hDll) A macro to get HRBELT_StartCollecting function pointer. @param hDll Library instance. */ #define FN_HRBELT_StartCollecting(hDll) \ (fnHRBELT_StartCollecting)GetProcAddress(hDll, "HRBELT_StartCollecting") /////////////////////////////// // Stop collecting ibi values /** @fn void PODAPI HRBELT_StopCollecting(HHRBELT hBelt) Stop collecting ibi values. Does NOT clear previously collected values. @param hBelt Belt handle. */ void PODAPI HRBELT_StopCollecting(HHRBELT hBelt); /** @var typedef void (PODAPI *fnHRBELT_StopCollecting)(HHRBELT) Function pointer type for HRBELT_StopCollecting. */ typedef void (PODAPI *fnHRBELT_StopCollecting)(HHRBELT); /** @def FN_HRBELT_StopCollecting(hDll) A macro to get HRBELT_StopCollecting function pointer. @param hDll Library instance. */ #define FN_HRBELT_StopCollecting(hDll) \ (fnHRBELT_StopCollecting)GetProcAddress(hDll, "HRBELT_StopCollecting") #ifdef __cplusplus } // extern "C" { #endif #endif // #ifndef SUUNTOPODDLL_H Würde das reichen um für B3D ein .Decl zu schreiben, oder braucht man dafür mehr Daten? Und geht es überhaupt, oder ist es ein sinnloses Unternehmen, und kann ich besser ein anderen Ansatz versuchen? Vielen Dank im Voraus, Grüßen, BJ |
||
![]() |
hazumu-kun |
![]() Antworten mit Zitat ![]() |
---|---|---|
Die einzelne Header Datei in einer Decls zu formulieren ist unmöglich, du bist gezwungen das über eine zweite DLL zu machen die praktisch Vermittler spielt, sowas nennt man dann wrappen. | ||
Warum kann es keine omnipotente Macht geben?
Weil diese omnipotente Macht in der Lage sein müsste, einen so schweren Stein zu schaffen, dass sie ihn nicht heben kann -> nicht omnipotent |
Blitzjockey |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Ok..
Ist das weil BB3D keine Pointer verarbeiten kann? In principe kann man doch über den Userlib den Declarations eingeben - abgesehen von der pointers und structures? Die Wrapper-DLL's werden auch in C/C++ geschrieben? Oder gibt's da andere möglichkeiten? Gibt's irgendwo eine Einführung in diesem Thema, womöglich online? Oder hat jemand eine riesen Menge Freizeit, und kann mich irgendwie helfen das hinzukriegen? Vielen Dank, BJ. |
||
![]() |
Starwar |
![]() Antworten mit Zitat ![]() |
---|---|---|
Ich klatsch dir mal nen Link an den Kopf ![]() BlitzBasic.com Oben bei UserLib Format. Ist auch ein VC++ Beispiel dabei. MFG |
||
Blitzjockey |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
![]() ![]() ![]() Dass läßt sich dann wohl nicht ganz vermeiden. -Update- Es geht auch ohne Wrapper-DLL und C++. ![]() Auch wenn der Userlib-link etwas unklar war, mittlerweile läuft's |
||
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group