Quotando quello che scrive Mitlay, se ti riferisci a MFC prova a googlare:
mfc programmatically create controls