Hi Majjek,
The answer can be really boring if you are not interested with inner object structure of Windows. We have multiple differences on these two functions and I will write the things I can remember. If there is any missing one, community can complete the rest.
First, GetObject function is on VB library. It does not means we can't use it in another languages but we have to reach VB6 library to use it on C# for example. (As soon as we are in .NET Framework)
GetActiveObject method is on System.Runtime.InteropServices Library. It's also usable for all .NET products.
GetObject method returns an object which provided by an ActiveX component.
GetActiveObject gets the object from ROT(Running object table).
Inventor files and object are perfectly working with these two system but for other programs, in theory you can not get their object with GetObject method if they are not okay to reach with ActiveX, and also you can not get the object with GetActiveObject if programs session is not on the Running Object Table.
With Marshall class we can get active objects (Marshal.GetActiveObject) and create objects. With GetObject method we can also specify the object we desire to get. For example for a drawing document:
Dim CADObject As Object
Set CADObject = GetObject("C:\CAD\SCHEMA.CAD")
in this scenario we will get the object itself and activate the file also. Windows will look at extension of the file and decide which object it needs to use.
Dim CADObject As Object
Set LayerObject = GetObject("C:\CAD\SCHEMA.CAD!Layer3")
In this example as you see we are reaching one of the specific layers of the object. For use it like that you can write ("FILE_PATH!SPECIFICATION")
Dim MyObject As Object
Set MyObject = GetObject("C:\DRAWINGS\SAMPLE.DRW", "FIGMENT.DRAWING")
In this last scenario, we are also specifying the object type as imaginary drawing viewer app Figment.
At the end there is no differences on performance as soon as we collect garbage. Specially for Marshall Object, its better to collect garbage at the end of the process.
I hope these answers will be helpful.
Devrim
If my answer is solved your problem, please mark it as Solution
Freundliche Grüße / Kind Regards