CDialogTemplate
-
Hi, when im trying to use... CDialogTemplate dlt; LPCTSTR ID=_T("IDD_TESTDLG_DIALOG"); if (!dlt.Load(ID)) return -1; the issue is eventhough the ID is correct but the above if statement returns -1 but if i use if (!dlt.Load(MAKEINTRESOURCE(CTestDlg::IDD))) return -1; the above statement doesn"t return -1.. Please help me regarding the same...
-
Hi, when im trying to use... CDialogTemplate dlt; LPCTSTR ID=_T("IDD_TESTDLG_DIALOG"); if (!dlt.Load(ID)) return -1; the issue is eventhough the ID is correct but the above if statement returns -1 but if i use if (!dlt.Load(MAKEINTRESOURCE(CTestDlg::IDD))) return -1; the above statement doesn"t return -1.. Please help me regarding the same...
p_1960 wrote:
if (!dlt.Load(MAKEINTRESOURCE(CTestDlg::IDD))) return -1;
You might change this to:
LPTSTR ID2 = MAKEINTRESOURCE(CTestDlg::IDD);
if (! dlt.Load(ID2)) return -1;and use the preprocessor's output to see if
ID2
contains a different value thatID
."Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
p_1960 wrote:
if (!dlt.Load(MAKEINTRESOURCE(CTestDlg::IDD))) return -1;
You might change this to:
LPTSTR ID2 = MAKEINTRESOURCE(CTestDlg::IDD);
if (! dlt.Load(ID2)) return -1;and use the preprocessor's output to see if
ID2
contains a different value thatID
."Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
Thanks for ur Reply David .... but the issue is with the below lines.. CDialogTemplate dlt; LPCTSTR ID=_T("IDD_TESTDLG_DIALOG"); if (!dlt.Load(ID)) return -1; the above code is returning -1 which is undesirable because ID is correct... the issue is i have id as String like _T("IDD_TESTDLG_DIALOG")(ie im getting the ID of the resource as a String instead of CTestDlg::IDD) ... Please correct me if im wrong....
-
Thanks for ur Reply David .... but the issue is with the below lines.. CDialogTemplate dlt; LPCTSTR ID=_T("IDD_TESTDLG_DIALOG"); if (!dlt.Load(ID)) return -1; the above code is returning -1 which is undesirable because ID is correct... the issue is i have id as String like _T("IDD_TESTDLG_DIALOG")(ie im getting the ID of the resource as a String instead of CTestDlg::IDD) ... Please correct me if im wrong....
The point of the exercise was to compare the two (i.e.,
ID
vs.ID2
).MAKEINTRESOURCE()
is a macro that the preprocessor will expand, which is why I suggested a temporary variable."Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
The point of the exercise was to compare the two (i.e.,
ID
vs.ID2
).MAKEINTRESOURCE()
is a macro that the preprocessor will expand, which is why I suggested a temporary variable."Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
ya..but MAKEINTRESOURECE converts an integer value to a resource type ... but in the case of CDialogTemplate dlt; LPCTSTR ID=_T("IDD_TESTDLG_DIALOG"); if (!dlt.Load(ID)) return -1; i need to pass id as String instead of integer...the doubt it is not working is i send id as string... Sorry for inconvenience caused ....
-
ya..but MAKEINTRESOURECE converts an integer value to a resource type ... but in the case of CDialogTemplate dlt; LPCTSTR ID=_T("IDD_TESTDLG_DIALOG"); if (!dlt.Load(ID)) return -1; i need to pass id as String instead of integer...the doubt it is not working is i send id as string... Sorry for inconvenience caused ....
p_1960 wrote:
ya..but MAKEINTRESOURECE converts an integer value to a resource type ...
It returns a
LPTSTR
.p_1960 wrote:
i need to pass id as String instead of integer...the doubt it is not working is i send id as string...
Did you look at the preprocessor's output?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
p_1960 wrote:
ya..but MAKEINTRESOURECE converts an integer value to a resource type ...
It returns a
LPTSTR
.p_1960 wrote:
i need to pass id as String instead of integer...the doubt it is not working is i send id as string...
Did you look at the preprocessor's output?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
ya it"s not recognising the ID which sent as string but it is working fine if i pass ID AS integer.. Pls let me know...
p_1960 wrote:
ya...
So what is its output?
p_1960 wrote:
...it"s not recognising the ID which sent as string but it is working fine if i pass ID AS integer.. Pls let me know...
You may want to re-read this thread to understand exactly what it is that I am asking of you.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
Hi, when im trying to use... CDialogTemplate dlt; LPCTSTR ID=_T("IDD_TESTDLG_DIALOG"); if (!dlt.Load(ID)) return -1; the issue is eventhough the ID is correct but the above if statement returns -1 but if i use if (!dlt.Load(MAKEINTRESOURCE(CTestDlg::IDD))) return -1; the above statement doesn"t return -1.. Please help me regarding the same...
Dialog name IDs should be either a string or a 16-bit unsigned integer. If you remove dialog id definition (#define IDD_TESTDLG_DIALOG number) from the file named "resource.h", it will work. Or you should enter that name with double quotes (like "IDD_TESTDLG_DIALOG") as dialog ID of dialog properties.