Dealing with ComObject types can be pretty annoying. This is one out of many reasons to prefer AF SDK upon PI SDK with new .NET development projects.
Reading through the code you pasted, it doesn't appear to do anything meaningful. Looks as if ~50% have disappeared during copy-paste operation e.g. I am not seeing any 'using' within the using section.
Please also allow me to repeat my question: What are the reasons to prefer PI SDK upon AF SDK?
Because this doesn't appear to be a wise choice, we may be able to assist you with some arguments in favor of AF SDK.
The code show doesn't look like complete code. It looks quite garbled with lots of stuff missing.
I would expect this:
Anthony, could you post your code again but without truncating portions that would constitute a complete line of code. We understand if you must obfuscate some server names, etc.