C
C#13mo 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 User13mo ago
Message Not Public
Sign In & Join Server To View
Dropps
Dropps13mo ago
you say there you return an IntPtr so you want to return one otherwise replace with Task or void
Cience
Cience13mo ago
thanks that worked to return Hook(process) i knew it was simple just couldn't figure it out
Accord
Accord13mo 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.