Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using DLLs
Message
From
22/02/2004 06:42:45
 
 
To
19/02/2004 06:53:50
Metin Emre
Ozcom Bilgisayar Ltd.
Istanbul, Turkey
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00877592
Message ID:
00879712
Views:
19
Hi Metin,

Hm, you are right. I thought that the IMPLEMENTS keyword was supposed to make the interfaces available. But nothing seems to happen when I call them.

How about a different (and easier approach) using CREATEOBJECTEX. It seems to work OK for me, but I haven't got a Nokia phone (mine is a Sony <g>) nor a connecting cable. The only test I could carry out was to check for the phone being connected and it returns the correct value.

Perhaps you could try out some of the other options the code below makes available and see if they work.
#DEFINE ATTACHED     0
#DEFINE DISCONNECTED 2
#DEFINE REMOVED      1
#DEFINE UNKNOWN     -1

* Create references to Nokia interfaces
oBearerItem   = CREATEOBJECTEX('NokiaCL.BearerItem.4','','')
oBookmarkItem = CREATEOBJECTEX('NokiaCL.BookmarkItem.4','','')
oNetwork      = CREATEOBJECTEX('NokiaCL.Network.1','','')
oPhoneControl = CREATEOBJECTEX('NokiaCL.PhoneControl.1','','')
oPhoneInfo    = CREATEOBJECTEX('NokiaCL.PhoneInfo.1','','')
oRingTone     = CREATEOBJECTEX('NokiaCL.RingTone.1','','')
oSecurity     = CREATEOBJECTEX('NokiaCL.Security.1','','')
oSetGroupItem = CREATEOBJECTEX('NokiaCL.SettingGroupItem.4','','')
oWAPSetting   = CREATEOBJECTEX('NokiaCL.WAPSettings.4','','')
oGMSPicture   = CREATEOBJECTEX('Nokia.GMSPicture.1','','')
oSCMaS        = CREATEOBJECTEX('Nokia.SCMaS.1','','')
oShortMess    = CREATEOBJECTEX('Nokia.ShortMessage.1','','')

* Start listening to Info Events
oPhoneInfo.StartListeningPhoneInfoEvents()

* Check on phone status
z = UNKNOWN
oPhoneInfo.get_DeviceStatus(@z)

DO CASE
CASE z = -1
	lcMess = 'Unknown'
CASE z =  0
	lcMess = 'Attached'
CASE z =  1
	lcMess = 'Removed'
CASE z =  2
	lcMess = 'Disconnected'
ENDCASE
MESSAGEBOX('Phone status is '+lcMess)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform