Einzelnen Beitrag anzeigen

nitschchedu

Registriert seit: 24. Mär 2006
300 Beiträge
 
Delphi 7 Professional
 
#23

Re: WLanManager WLanAPI

  Alt 4. Dez 2007, 07:52
So jetzt gehts ^^

Delphi-Quellcode:
if ergebnis=ERROR_SUCCESS then
    begin
       WaitForSingleObject(hScanCompleteEvent, INFINITE);
       //ShowMessage('Scan complete.');
    end;
Deine Zahlen durch INFINITE getauscht, wie lange woltest du da eigentlich warten ?

Delphi-Quellcode:
//=========== Prozedur NotifiCallback ==========================================
procedure NotifiCallback(pNotifData:PWLAN_NOTIFICATION_DATA; pContext:PVOID); stdcall;
var
   Source:DWord;
begin
   if pNotifData^.NotificationSource = WLAN_NOTIFICATION_SOURCE_ACM then
   begin
      Source:=pNotifData.NotificationSource;
      if (Source and WLAN_NOTIFICATION_SOURCE_ALL) > 0 then
      begin
         case pNotifData^.NotificationCode of
            wlan_notification_acm_scan_complete:
               begin
                  SetEvent(THandle(pContext^)); // hier Pointer !!!
               end;
         end; // case pNotifData^.NotificationCode of
      end; // if pNotifData^.NotificationSource of
         SetEvent(THandle(pContext^)); // hier Pointer !!!
   end // if pNotifData<>nil
end; // function NotifiCallback
Oben im if musste prüfen ob es sich wirklich im ein Notification handelt.
Und musste mit SetEvent auf jeden fall raus gehen .... sonst Hängt die Anwendung .... für immer (naja gut wenn du wirklich da mit deiner Zeit gewartet hätte stimmt das hier nicht) !!
Miniaturansicht angehängter Grafiken
unbenannt-2_676.jpg  
Programmieren ..... .
  Mit Zitat antworten Zitat