Using COM Objects from Max

BlitzMax Forums/BlitzMax Programming/Using COM Objects from Max

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Yes, absolutely. You are pretty much spot on.

It would require using all late bound calls, since we wouldn't want to rebuild the C++ module anytime we wanted to add a new COM object. No a big deal though

The only problem is handling the variety of parameter lists for the method calls. My thinking would be to provide some way to add the parameters to a list or array. I'd hate to have to deal with poking / peeking bytes.. We can be smarter than that.

Something like:

Extern
  Function COMCreateArgList:Int()  ' returns handle to arg list

  Function COMAddArg(value:Byte Ptr, ArgType:Int) 
  ' value would be a pointer to the variable containing the data.  Variable would be any type
  ' ArgType would be a constant, indicating the type of pointer.  Somewhat similar in principal to a variant type.  e.g. ARG_INT, ARG_STRING, ARG_FLOAT...

  Function COMCallMethod(Handle:Int, MethodName:Byte Ptr, ArgList:Int) ' ArgList could be Null.

End Extern