titian, the simplest, and by far the most courteous thing to do when invited round by friends is ring them up, explain how strictly you stick to vegetarian standards and discuss the meal they plan so that you can explain any problems you may have.
It is what anyone with an allergy does and it causes no ill feeling. I would be very irritated by anyone who turned up at my house with their food in a bag. My instant reaction would be:'How ill-mannered, why didn't he/she ring me beforehand and explain the issues.
Several members of my family have quite extensive allergies and other friends have been on strict diets for a range of reasons. They have always rung me up explained the problem and I have sorted it.
We celebrated our 50th wedding anniversary last year with a house party for 15, including a celebratory meal. Our party included three vegetarians, one person allergic to nuts and salmon, another, with an auto-immune disease and allergic to nuts, soya and fresh fruit, plus someone with IBS. I worked with my caterer and, except for separate main courses for the vegetarians, the starter and dessert could be eaten by everybody. Every night we had a buffet cold meal and that too provided food for everybody.
It can be done if the person concerned enables it by talking to their host/ess