How to solve "Object reference not set to an instance of an object?

How do you get DirectX 7 for VB to give you access to the object behind that 'unknown' interface?

  • Is There a way to use the DirectX7 object provided by VB without creating a reference to the DirectX7 for VB Library in your project. I am a huge fan of COM Automation and scripting and I'd prefer not to reference ANYTHING in any of my VB projects. When I use CreateObject to get an instance of the DirectX7 class, I get an object of type 'unknown'. From what I know, the IUnknown interface isn't documented much and isn't really supported in VB! Help! Again!

  • Answer:

    Let's resolve this overdue question by bringing it to a vote.

egblackknight at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

Let's resolve this overdue question by bringing it to a vote.

Roscoe01...

IUnknown is the generic Com interface for all Com objects. In genreal you do a QueryInterface on the object and get the interface you need. You can't do anything with the IUnknown interface. Unfotunally you will probably have to reference the DirectX7 Lib to get the needed interfaces, after all that is what it is there for. You may want to check out Managed DirectX in VB.NET

neo2600

IUnknown is the generic Com interface for all Com objects. In genreal you do a QueryInterface on the object and get the interface you need. You can't do anything with the IUnknown interface. Unfotunally you will probably have to reference the DirectX7 Lib to get the needed interfaces, after all that is what it is there for. You may want to check out Managed DirectX in VB.NET

neo2600

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.