Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing Parameters DWORD PTR using API conundrum
Message
From
10/10/2006 13:33:22
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
01160919
Message ID:
01160950
Views:
11
Ok, now THAT was REALLY Embarrassing! :o)

Given that I NOW check for <> 0 (SILLY ME) instead of .T. it is NOW not throwing an error, but it IS returning 0 no matter how I seem to set m.lcDeviceInterfaceData beforehand:

m.lcDeviceInterfaceData = Padr(BinToC(28, [4RS]), 4, Chr(0)) + Replicate(Chr(0), 24)
m.lcDeviceInterfaceData = CHR(32)+CHR(0)+CHR(0)+CHR(0)
m.lcDeviceInterfaceData = long2str(32)+REPLICATE(CHR(0),28)
m.lcDeviceInterfaceData = num2dword(32)+num2dword(0)+num2dword(0)+num2dword(0)+num2dword(0)

Yet, I am sure the other parameters I pass are all good. Can you easily determine what is wrong with the manner(s) in which I attempted to set m.lcDeviceInterfaceData? None of the above return anything other than 0 so I am missing something obvious is setting m.lcDeviceInterfaceData...


And this works:
	m.lnRetVal = SetupDiEnumDeviceInfo( ;
		m.lnDeviceInfoSet, ;
		m.lnx, ;
		@m.lcDeviceInfoData)

but I cannot get a result <> 0 from SetupDiEnumDeviceInterfaces()


By the way, I should have caught that immediately:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/setupdienumdeviceinterfaces.asp
Return Values
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform