How can we call mingw WLAN NOTIFICATION CALLBACK



  • Hello Everyone

    i am working WiFi using wlanapi library mingw. i have registered this function WLAN NOTIFICATION
    CALLBACK but i am not getting notification. it just register and then not works. this is the function i have made.

    NOTIFICATION CALLBACK FUNCTION
    WLAN_NOTIFICATION_CALLBACK WINAPI MainWindow::NotificationCallback(PWLAN_NOTIFICATION_DATA pNotifData,void* pContext)
    {
    if (pNotifData != NULL)
    {
    ui->label2->setText(GetAcmNotificationString(pNotifData->NotificationCode));
    }
    }
    Please tell me if the above callback function is correct or not?

    Here is the code how I am regestering the callback function using WlanRegisterNotification

    NotiffData is declared in Header.
    PWLAN_NOTIFICATION_DATA NotifData

    dwResult = WlanRegisterNotification(hClient,NotifData->NotificationSource,FALSE,MainWindow::NotificationCallback(NotifData,context),NULL,NULL,&dwPrevNotifType);

    i want to know my code is right or wrong. why i am not getting notification of wireless lan. if anybody have solution for this task, please reply me.

    Not sure but every time it returns the "Unknown Code"

    Thanks

    Tushar Kachhadiya


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    This question being essentially WINAP related, you should rather ask on a MSDN forum



  • Hi Samuel

    Can Qt have any Similar Function like WLAN_NOTIFICATION_CALLBACK to get WiFi Status. i have QT5.2.1 MingW. so If you have any thought about this issue.Please Help me.

    Thank You


  • Lifetime Qt Champion

    Have a look at the Bearer Management documentation

    Hope it helps



  • Hi Samuel

    Can you tell me how to disable a QTest console output window of Qdebug.
    My Qt Version is 5.2.1.

    Thanks

    Tushar Kachhadiya


  • Lifetime Qt Champion

    Hi,

    What console are you referring to ?



  • Hi,

    I referring the console window which is opens while we run the application. The console window is shows all QDebug messages and warning messages.

    The library I used QTest library and Qttest5.dll after including this two files. I got that console output window with my application. I tried using this configuration t with application.pro file to disable that window but it didn't disable that window. It just disables the Qdebug messages.

    QT += testlib

    DEFINES += QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT

    So, if you have any solution or suggestion related this issue. please let me know.

    Thanks & Regards

    Tushar Kachhadiya


  • Lifetime Qt Champion

    Well, that's the normal behavior for tests, what are you trying to achieve ?



  • Hi,

    I want to disable that console output window. i used qwait method to set some delay in for loop before that I used single shot timer but it hangs all process, so I removed it.

    So, if you have any solution related this, Please help me.

    Thanks & Regards

    Tushar Kachhadiya



  • hii
    if you want to disable console window then write in .pro file
    CONFIG -= console
    hope it helps



  • Hi,
    lamSumit

    Thanks for suggestion. I tried this CONFIG-=console but console window is still there. So, If you have any other idea then share with me.





  • Hi
    lamSumit

    I tried that configuration but still getting same issue with deployed application. when i run myapplication.exe file from deployed directory still debug window starts with application.


  • Lifetime Qt Champion

    qWait is to be used only for tests not in production code. Don't use it in your application.

    Unless you are doing something unclean, QTimer singleShot should not block anything



  • if your console window is still there then
    you have to reconfigure the project means let start fresh.
    just do the following--
    1)CONFIG -=console //in .pro file
    2)Delete debug and release folder
    3)delete from create in directory(source code) the files that generated while previous configuration, like visual studio .pro file .you have to keep only your main files like all .cpp, .h and .pro files only
    4)After doing above open your project in Qt creator and it will ask for configure just hit that button you will get fresh(cleaned) project.
    just do above steps.your problem will be solved.



  • [quote author="SGaist" date="1403212297"]qWait is to be used only for tests not in production code. Don't use it in your application.

    Unless you are doing something unclean, QTimer singleShot should not block anything[/quote]

    Thanks Samuel



  • [quote author="IamSumit" date="1403242351"]if your console window is still there then
    you have to reconfigure the project means let start fresh.
    just do the following--
    1)CONFIG -=console //in .pro file
    2)Delete debug and release folder
    3)delete from create in directory(source code) the files that generated while previous configuration, like visual studio .pro file .you have to keep only your main files like all .cpp, .h and .pro files only
    4)After doing above open your project in Qt creator and it will ask for configure just hit that button you will get fresh(cleaned) project.
    just do above steps.your problem will be solved.

    [/quote]

    Thanks lamSumit
    Still getting same issue. i removed that qtest library.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.