|
-
May 9th, 2001, 09:37 PM
#1
Thread Starter
PowerPoster
Problem with the dialog!
I have created a dialog procedure, the actuall dialog.
--The name of the dialog is MYDIALOG
--The name of the dialog procedure DLGPROC
--The name of my window's hwnd is WINHWND
--The name of the Instance is hInstance
How do I show a dialog box when the window is clicked?
If you still need more informations then please reply!
-
May 10th, 2001, 03:04 AM
#2
Frenzied Member
Maybe something like this:
Code:
//in the main window procedure
switch (message)
{
case WM_LBUTTONDOWN:
DialogBox(hInstance(LPCTSTR)IDD_DIALOG1, NULL, (DLGPROC)DLGPROC);
break;
}
-
May 10th, 2001, 05:08 PM
#3
Thread Starter
PowerPoster
I get these errors.
The dialog name is: IDD_MYDLG
The dialog's procedure is: DlgProc
When I put this text in the "Move" event:
Code:
CreateDialog(hInstance(LPCTSTR)IDD_MYDLG, NULL, (DlgProc)DlgProc);
It gives me these error in vc++ 6.0:
Deleting intermediate files and output files for project 'winprog - Win32 Debug'.
--------------------Configuration: winprog - Win32 Debug--------------------
Compiling...
file1.cpp
c:\program files\microsoft visual studio\myprojects\winprog\file1.cpp(48) : warning C4003: not enough actual parameters for macro 'CreateDialogA'
c:\program files\microsoft visual studio\myprojects\winprog\file1.cpp(48) : error C2065: 'hInstance' : undeclared identifier
c:\program files\microsoft visual studio\myprojects\winprog\file1.cpp(48) : error C2275: 'LPCTSTR' : illegal use of this type as an expression
c:\program files\microsoft visual studio\vc98\include\winnt.h(196) : see declaration of 'LPCTSTR'
c:\program files\microsoft visual studio\myprojects\winprog\file1.cpp(48) : error C2146: syntax error : missing ')' before identifier 'IDD_MYDLG'
c:\program files\microsoft visual studio\myprojects\winprog\file1.cpp(48) : error C2059: syntax error : ')'
Error executing cl.exe.
winprog.exe - 4 error(s), 1 warning(s)
What is the problem?
-
May 10th, 2001, 05:12 PM
#4
Frenzied Member
The name of the dialog is MYDIALOG
whad do you mean now your dialog name is IDD_MYDLG ???
Anyway in the code above
You forgot a comma
Code:
CreateDialog(hInstance,(LPCTSTR)IDD_MYDLG, NULL, (DlgProc)DlgProc);
-
May 10th, 2001, 08:02 PM
#5
Thread Starter
PowerPoster
Sorry both times!
I was rong both times.
Now this is the information
--The name of the dialog is IDD_MAINDLG
oooh
I used this code:
Code:
CreateDialog(hInstance,(LPCTSTR)IDD_MAINDLG, NULL, (DlgProc)DlgProc);
and I got the following errors:
C:\Program Files\Microsoft Visual Studio\MyProjects\winprog\file1.cpp(48) : error C2065: 'hInstance' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\winprog\file1.cpp(48) : error C2146: syntax error : missing ')' before identifier 'DlgProc'
C:\Program Files\Microsoft Visual Studio\MyProjects\winprog\file1.cpp(48) : error C2059: syntax error : ')'
I think that It has some problem with the hInstance. I have declared it in the window procedure.
What is the problem again?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|