C
C#2y ago
Cience

❔ not all code paths return a value

this code im like 99% sure i need a return statement and without Mouse Hook says "not all code paths return a value" but when i add the return statement the error goes away with a new one on the "return;" an object of type convertible to "IntPtr" is required, can someone show me how to fix this? public IntPtr MouseHook(int left, int top) { SetCursorPos(left, top); hookId = Hook(process); return; }
4 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Dropps
Dropps2y ago
you say there you return an IntPtr so you want to return one otherwise replace with Task or void
Cience
CienceOP2y ago
thanks that worked to return Hook(process) i knew it was simple just couldn't figure it out
Accord
Accord17mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server