First, tomatoes are self-fruitful, but to efficiently transfer pollen, shake the plants every day they have flowers. But they do fine in pots. Fertilize them regularly with a complete fertilizer, which includes micronutrients as well as nitrogen, phosphorus and potassium. Finally, tomato plants must be supported as they grow. Any trellis system works well, from simple string to more elaborate wire mesh or wooden frames.
Cucumbers grow well in greenhouses, too.
The pickling and slicing cucumbers normally grown outside aren't usually grown in greenhouses, though. They require insects for pollination. European cucumbers grown in greenhouses are bred to produce parthenocarpic fruits, which develop spontaneously without pollination and are seedless. Your seed supplier can tell you more on ordering these types of cucumbers. Vegetables requiring pollination aren't often grown in greenhouses.