Convert multiple meshes to single one retaining animation?

I want to use blender to make some simple animated models and export them in .x format to use in a program I wrote.

The .x file needs to contain a single mesh.

I decided to model a box with a lid that opens as an example of a really simple thing to animate. I made a box, then as a separate object in blender made a lid. I then added an armature and parented it to the lid. I then made keyframe with the lid rotating so that it animates the lid opening.

So far so good, it all works fine in blender.

When I export it to a .x file though I get two separate meshes which breaks my program. So I thought I would combine the two meshes in blender which I did by selecting both objects and doing ctrl-j to join them.

However when I do it breaks the animation. Is there some way to combine the two objects into a single mesh but retain the bone weights etc? Or some better way to achieve what I want to do?

did you try re-parenting the mesh to the armature? I made a person with different parts, parented & rigged up the separate parts to the armature, then joined the parts together & didn’t have any it make any new groups/names. It worked fine.