Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 00:23

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[SOLVED] WINAPI/BluetoothAPIs.dll - call BluetoothGATTRegisterEvent - refer args?

Discussion on [SOLVED] WINAPI/BluetoothAPIs.dll - call BluetoothGATTRegisterEvent - refer args? within the C/C++ forum part of the Coders Den category.

Reply
 
Old   #1



 
IceTrailer's Avatar
 
elite*gold: 150
Join Date: Sep 2010
Posts: 2,070
Received Thanks: 821
[SOLVED] WINAPI/BluetoothAPIs.dll - call BluetoothGATTRegisterEvent - refer args?

Hello guys,

I have the task to communicate with a bluetooth low energy (BLE) device using the PC.
Apart from my bad UWP knowledge, I would appreciate using C++ /WINAPI in this case (although I did not really work with WINAPI before).

I picked some code and tried to fix all syntax errors using the Visual Studio IDE.

.

Unfortunately there is one error I don't know how to fix it:
Quote:
C2664 (HRESULT BluetoothGATTRegisterEvent(HANDLE,BTH_LE_GATT_EVEN T_TYPE,PVOID,PFNBLUETOOTH_GATT_EVENT_CALLBACK,PVOI D,BLUETOOTH_GATT_EVENT_HANDLE *,ULONG)" : Cannot convert argument 4 from "void (__cdecl *)(BTH_LE_GATT_EVENT_TYPE,PVOID,PVOID)" to "PFNBLUETOOTH_GATT_EVENT_CALLBACK".


Do you have any approaches to help me?

Best regards

Solved.
After multiple approaches using trial and error, I found the solution.
A simple cast fixed the error.

From this
Code:
                hr = BluetoothGATTRegisterEvent(
                hLEDevice,
                EventType,
                &EventParameterIn,
                SomethingHappened,
                NULL,
                &EventHandle,
                BLUETOOTH_GATT_FLAG_NONE);
to this
Code:
                hr = BluetoothGATTRegisterEvent(
                hLEDevice,
                EventType,
                &EventParameterIn,
               (PFNBLUETOOTH_GATT_EVENT_CALLBACK)SomethingHappened,
                NULL,
                &EventHandle,
                BLUETOOTH_GATT_FLAG_NONE);
did it.

Can get closed.
IceTrailer is offline  
Reply

Tags
bluetooth, c++, compiler, error, winapi


Similar Threads Similar Threads
[HOW TO] MSVCR110.dll fehlt BEHEBEN | [MSVCR120.dll MSVCP110.dll MSVCP100.dll etc]
03/25/2014 - Tutorials - 2 Replies
Hier ist ein Youtube Video: MSVCR100.dll feht BEHEBEN / MSVCR110.dll fehlt MSVCR120.dll MSVCP110.dll MSVCP100.dll MSVCP120.dll - YouTube Aber den ganzen Kram könnt ihr auch als Text haben: Viele von euch kennen bestimmt das Problem das ne dll auf dem PC fehlt und das Programme dann nicht laufen. Hier ist die Lösung: Schaut erstmal nach, welche Microsoft Redistributables auf eurem PC installiert sind. Geht hierzu auf Start > Sytemsteuerung > Programme > Programme und Funktionen und...
QuestButtonClick-Event Args?
01/27/2014 - Metin2 Private Server - 2 Replies
Hey Leute, sitze grade an ner Quest welche die Quest-Client Verbindung nutzt durch "event.QuestButtonClick". Wenn ich mir den Source ansehe, sind anscheinend auch noch Argumente möglich? Kann jemand verraten wie ich auf diese inner halb der Quest zugreife? Oder gibt es eine andere Möglichkeit Daten an eine Quest zu senden?
[Java] Bukkit Plugin -> [args] Problem
08/18/2012 - General Coding - 6 Replies
Naja , ich habe einen Kick-Befehl programmiert , und wenn man ihn dann ausführt , soll eine Broadcast-Message gesendet werden , wo auch der Grund des Kicks steht. Das Problem ist jetzt: Er nimmt nur 1 Wort als Grund an. Wie kann ich das erweitern, das ich mehrere Wörter als Grund angeben kann? http://i.epvpimg.com/tXnth.png
[Quest Zeugs] Server Timer Args
05/09/2012 - Metin2 PServer Guides & Strategies - 14 Replies
Heyho, Da die frage immer wieder auftaucht hier eine kurze Erklärung. Aufbau: server_timer(name, time, arg) server_loop_timer(name, time, arg) Ein Server Timer ist nicht Map gebunden viele denken es wäre Map gebunden
REDO'ing quests. I would love to get more args!
03/22/2008 - Dekaron - 3 Replies
I was wondering if there was any way to get a quest done over again... For example... all the gate bosses in Parca.



All times are GMT +1. The time now is 00:24.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.