|
define a public string member in your dialog class which get set between ctor and oninit and will do setwindowtext()in your OnInitDialog()
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hi,
As I mentioned I am not having any Dialog class where I can use the OnInitDialog() function. I want to do it without using it. What I am trying for is the without using separate dialog class for it.
Thanks
Mike
|
|
|
|
|
if you had an own dialog class you wont need this discussions
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
I assume from your comments that this is a Win32 dialog rather than MFC. If that is the case you can still trap the WM_INITDIALOG[^] message and change the title there.
It's time for a new signature.
|
|
|
|
|
Nah, inheritance is not an option in Win32 .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
I am aware of the InItDialog functionality. But I am not having Dialog derived for it. I am trying to avoid the creation of seperate class for this purpose. Is it possible to change the dialog header without using InItDialog??
Thanks:-
Mike
|
|
|
|
|
Richard MacCutchan wrote: I assume from your comments that this is a Win32 dialog rather than MFC.
Even though he mentions DoModal() ?
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
OK, guys I misread it, I shall perform a suitable act of self-humiliation in penance!
It's time for a new signature.
|
|
|
|
|
Richard MacCutchan wrote: ...I shall perform a suitable act of self-humiliation in penance!
No, I do not wish to see you dancing on a table wearing a sombrero.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
I've been told my maracas are a sight to behold.
It's time for a new signature.
|
|
|
|
|
You did NOT just say that while I was eating.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
I think that you may do it, using the CDialog::InitModalIndirect route (see [^]), but it would be "full of pain", because you have to create and fill properly the DLGTEMPLATE struct ([^] read carefully the "Remarks" section).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
It's for creating Modal dialog box indirectly. But I already have the dialog box.
Thanks:-
Mike
|
|
|
|
|
That's the only way, IMO.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
mikert_2008 wrote: ...the project I am working doesn't have class derived from it.
So what object are you calling DoModal() from?
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
CDialog dlgAbout(IDD_ABOUTBOX);
dlgAbout.DoModal();
|
|
|
|
|
Just an idea to research further. Before you instantiate the dialog, would it not be possible to modify the IDD_ABOUTBOX dialog resource to change the caption property? I don't know how to do that, but that is one thing I would investigate.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
|
|
|
|
|
I *think* this is what InitModalIndirect() was suggested for. Like you, however, I've not personally tried it.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
mikert_2008 wrote: ...the project I am working doesn't have class derived from it. And doesn't look proper to genrate the class just for this purpose.
Other than looks, what reservations do you have to this approach? Read here for Paul's response to using a CDialog object directly.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
I had a quick scan through the answers below and you didn't seem that enamoured of any of them as you weren't using/couldn't use MFC.
Having said that you've already answered your own question...
mikert_2008 wrote: One way I know to change the title of Modal Dialog Box is to use OnInitDialog() function of the class derived from the DialgBox and then call setwindowtext() function inside it.
If you look at the MFC documentation or read the source code you'll see that CDialog::OnInitDialog is called in response to a WM_INITDIALOG message being sent to the dialog box. All you have to do in your code is handle WM_INITDIALOG and call SetWindowText at that point.
Cheers,
Ash
|
|
|
|
|
Hi,
I am asking your help instaed I am using 3rd party library as I know I will not get help from them..
I have third party tools which is having almost 7 (dll and .dll.a) files and 10 source .h and .c files.
I need to add only source and .dll.a files and keep along with this file.
But I am getting run time error "Unhandled exception at 0x00018740 in Sample.exe: 0xC0000005: Access violation reading location 0x00018740"
I think I application is not able to read code from dll file. Or else what might be the cause?
|
|
|
|
|
john5632 wrote: I think I application is not able to read code from dll file.
This doesn't make any sense.
john5632 wrote: Or else what might be the cause?
Use your debugger to locate the problem more precisely and inspect the different variables. Once you have more information and are still stuck, post the details here.
Basically, the error message means that you are trying to read at a memory location to which you are not allowed to (it could be by trying to access a NULL pointer, or an unitialized pointer for instance, but it could be from a lot of other reasons). The only way to fix it, is to inspect your code with a debugger to find the problem.
|
|
|
|
|
How can I make sure that I am able to use all dll files?
|
|
|
|
|
Hello,
I have an application that allows you to import contacts from outlook,
when you click on import it open that outlook 'folder select menu' and you select the folder you want to import the contacts from.
so far it's all good,
what I want to do now is to make this automatic,
I need to find a way to save the selected folder, so next time the user will load the application it will know from which folder to take the contacts from.
This is the code I'm using now:
_ApplicationPtr pApp;
_ItemsPtr pItems;
MAPIFolderPtr pFolder;
HRESULT hr;
hr=pApp.CreateInstance(__uuidof(Application));
pFolder = pApp->GetNamespace(_bstr_t("MAPI"))->PickFolder(); //here the user select folder
pItems=pFolder->GetItems();
.....and so on
basically I need to save the selected MAPIFolderPtr pFolder to the registry as a string
and then convert it back to MAPIFolderPtr pFolder from the string.
Thank you!
|
|
|
|
|
OK after breaking my head with that for over a day I found a solution:
1. pFolder = pApp->GetNamespace(_bstr_t("MAPI"))->PickFolder();
2. char *folder_id = _com_util::ConvertBSTRToString(pFolder->EntryID);
3. _bstr_t new_folder_id = _com_util::ConvertStringToBSTR(folder_id);
4. pFolder = pApp->GetNamespace(_bstr_t("MAPI"))->GetFolderFromID(new_folder_id);
save folder id:
1. select folder
2. save the folder id to char
... write to registry or whatever
read folder id:
.... read from registry or whatever
3. convert it to bstr
4. get your selected folder by its id.
hope this will help some one.
|
|
|
|