❔ 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•2y ago
Message Not Public
Sign In & Join Server To View
you say there you return an IntPtr so you want to return one otherwise replace with Task or void
thanks that worked to return Hook(process)
i knew it was simple just couldn't figure it out
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.