Basically what you need to do is instantiate an object from CDialog and then attach your resource dialog to your newly created object. (I assume you are using the resouce editor to make the dialog)
Then after it has been instantiated and resource is attached you would call DoModal() and do your thing what have you. Also I''ll point out this potential pitfall, when you instantiate the dialog, make sure it isn''t from a local function that goes out of scope before you can do anything with it.
BTW, I am assuming this is a dynamic dialog box judging from your post, if not then the same basic rules apply only not.