COM object variable is not initialized or has invalid type

The ibc.IsConnected() function is presenting this error. Any clues. Yes, I have searched the forum and Google...but can't get any info.

You can't just call

ibc.IsConnected(); // wrong if used alone 

You have to first create object, check if it is OK and then you can use it

ibc = GetTradingInterface();
if( ibc ) // check if object is valid !
{
   if ibc.IsConnected() )
   {
   }
}

By they way: this answer is based on guessing what you really wanted and what you actually did. You did not provide such necessary information that is required to answer. And you really need to use this advice next time : How to ask a good question

3 Likes