A moulding machine (10) contains a mould (11), which comprises a lower mould section (12) and an upper mould section (14). In the lower mould section there is formed a depression (16) for receiving a guide frame (18) or other objects. The guide frame is fitted between the upper mould section and the lower mould section. In the lower mould section there is underneath the depression a mould cavity (20) for receiving a thermocurable resin or encapsulating agent. A sealing groove (30) for receiving a seal (32) is arranged adjacent to the mould cavity. The seal undergoes a plastic deformation when subjected to a force. An oil chamber (40), containing hydraulic oil (44) is connected to the sealing groove. The hydraulic oil is pressurised in order to press the seal against the guide frame. As a consequence of this, the seal is deformed in such a way that it is in close contact with the surface of the guide frame and seals off the mould cavity. The hydraulic oil is preferably mixed with thermoplastic resin in powder form. <IMAGE>