Couple of quick questions

Started by
2 comments, last by GameDev.net 24 years, 6 months ago
If you are using MFC, it's quite easy. Just create a new dialog, attach a class to it using the ClassWizard, and then in OnButton1, you'd declare an instance of the new dialog (you may want to make it a member variable of the parent dialog), and call its DoModal() method.
Advertisement
I've tried using the following code, which always worked on SDI apps.

CTestDlg dlg;
dlg.DoModal();

but for some reason I get a whole bunch of compiler errors. Do I need to change this code since I'm doing a dialog based app instead of an SDI app now?

I have a couple of quick questions on things I couldn't seem to get to work.

1. What is the code to put in to open another dialog box?
I have a main dialog and a button that I want to open another dialog box, not an AFX message box. I know where to put the code in
::OnButton1
but I don't know what code to put in.

2. How do I get people's IP addresses out of a game? I have seen IP sniffers but I don't know how to do it myself. Then once I have these addresses, I need to know the function calls to send variables to their comp. I've been looking for this one for a long time. All I need is to send variables x and y to the other comp, and then when they are received that persons program reacts based on their values!
THANKS IN ADVANCE!!!!!

Lord_MiL

OOPS, hehe well I figured out what I was doing wrong on the Do.Modal part, I still need help with the winsock functions though, thanks.

PS I forgot to put the "testdlg.h" #include at the top of the code, =)

This topic is closed to new replies.

Advertisement