QuickFIX fills in the fields from the QuickFIX settings / config file. So things like TargetCompID, SenderCompID, Host are all filled in automatically when QuickFIX handles the connection. see the config guide for more details of which fields can be filled in here. Though you can add fields to this file they will not be automatically filled in by the quickFIX engine. You will need to override the toAdmin
method in order to add additional fields to the message.
When you override the toAdmin
method you will need to check the message type. If the message object works the same as it does in Java you will need to get the message header and check the message type field in the message header, as it is not in the message body.