Some ActiveX/COM classes have fucntions with optional parameters. But when you import the type library into Delphi, the type library wizard doesn’t know that the parameters are optional and doesn’t give you the option of omitting them in your code. The solution is to use EmptyParam where you would normally omit the parameter:
NewMessage := CreateComObject(CLASS_MSMQMessage) as IMSMQMessage2;
NewMessage.Label_ := ALabel;
NewMessage.Body := ABody;
NewMessage.Send(FSendQueue, EmptyParam);
EmptyParam is declared in the Variants unit.
Post a Comment