I have some code that uses a WebRequest/Response. Since i need to check the thread is the same then perform the correct action i have to write code similar to (on the main application)
If <control>.Dispatcher.CheckAccess Then
<control>.Dispatch.BeginInvoke(New DelegateDoSomething(AddressOf DoSomething))
This works, however i would like to use a dll to hold the WebRequest/Response at the same time i need to address the code posted (so i could pass in the control i.e. control.dispatcher.checkaccess).
Therefore the above code in a dll, gives me the error Reference to a non-shared member requires an object reference. I create an instance but then it has a null reference.
How should i be doing this?