|
OnInitDialog is an override, why don't you add this to the autoscan class.
Use can use Class View to add this override, class view -> autoscan class property->overrides: OnInitDialog.
or manually override the function
header file
class autoscan: public CDialog
{
...
public:
virtual BOOL OnInitDialog();
};
cpp file
BOOL autoscan::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
|
|
|
|
|
Project RAJA wrote: ...newly created dialogs,they don't have a OnInitDialog...
They all do. Why would you think otherwise?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
I am developing an application which hooks the common dialog WIndow. I wanted to send a message to the common dialog to make a force redraw of the window. I used PostMessage API to post a message to the queue but it does not work for Child Window. How can i send a message to a child Window without using the SendMessage API.
thanks
Nitheesh
|
|
|
|
|
|
Yes SendMessage Works fine. But i want to Post Message to the Queue.
|
|
|
|
|
Nitheesh George wrote: I used PostMessage API to post a message to the queue but it does not work for Child Window. How can i send a message to a child Window without using the SendMessage API.
if sendmessage work, post message ought to work. try putting breakpoint in MessageHandller function to check when it recv the postmessage request
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
Hello,
I have made client server communication and I am sending and recieving Files.
I am using file pointer and fread and fwrire commands to read and write file.
I am able to read and write .txt,.GIF files.but I could not write .doc file.
I am opening file in binary mode only.
I am reciveing file with same size as I sent. but after opening .doc file I got an error that "word was unable to read the file".
can any one tell me what might be the reason behind that?
do I need any special code to read and write .doc file?
Thank You...
vijay.
|
|
|
|
|
have you tried with file compare tools like windiff.
|
|
|
|
|
vijay_k wrote: can any one tell me what might be the reason behind that?
Only CP members with superpowers and the CPMRU (Code Project Mind Reader Unit) turned ON.
vijay_k wrote: do I need any special code to read and write .doc file?
No. But you have to make sure that the transferred file is identical to the original one. You may use a tool such a Windiff to verify it.
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
|
|
|
|
|
I tested it with windiff.
I am getting message that created file is more recent.
I am not getting what can be done next?
Here I am giving You code for writing that file.
if( nFile != NULL )
{
numwritten = fwrite( recvbuf, sizeof(char),length, nFile );
fclose(nFile)
}
else
MessageBox(NULL,"Problem opening file",NULL,NULL);
Do I need to use feof or any other commands?
Thank You...
Vijay.
|
|
|
|
|
vijay_k wrote: I am getting message that created file is more recent.
That's ok.
Now, what about the differences? Can you see any difference (using Windiff, select the first item and then click the expand button)?
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
|
|
|
|
|
I expanded it and I got some Encrypted language contents.
but on clicking on edit right file and left file I got .txt file version of both files.
There is a differeence in both files.The half of the file is same and I am getting "ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ" charachters for rest of file(in created file).
I am not getting why there is such difference.
Thank You....
Vijay.
|
|
|
|
|
Probably the buffer you're writing to the output file does not contain the whole info. I think you have to check how many bytes are actually transferred between the client and the server.
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
|
|
|
|
|
Before I sent contents of file I am sending the length or size of file.
And I am recieving lenght of file.
I am using that length in recv() function.
It is working fine for .gif file.
Thank You...
Vijay.
|
|
|
|
|
You may check the received buffer content with the debugger.
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
|
|
|
|
|
I need to create a progress bar for my application and i added the progress control to my dialogbox,and added the following code,while i run the project i can see only a empty progress bar,and no progress is shown,i don't know how to work with the progress bar,and i need to add a status bar to it also.How is that done???pls help me as iam new to MFC concepts.
void CmobtvapplicationDlg::OnNMCustomdrawProgress1(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMCUSTOMDRAW pNMCD = reinterpret_cast<LPNMCUSTOMDRAW>(pNMHDR);
CProgressCtrl *Progress = new CProgressCtrl;
Progress->Create(WS_CHILD | WS_VISIBLE, CRect(10, 10, 288, 35), this,0x16);
Progress->SetRange(0, 100);
Progress->SetPos(0);
if (Progress->GetPos()!=100)
{
Progress->StepIt();
}
else
{
Progress->SetPos(10);
}
*pResult = 0;
}
RAJA
modified on Sunday, May 4, 2008 11:46 PM
|
|
|
|
|
I suspect you need to run your main code in a seperate thread so that your progress bar is responsive.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Please, reply here, I don't respond to emails b/c I don't give out my address.
I'm sorry, but you'll need to read up on multithreading, if you don't understand what I meant. Yes, you can put it in your status bar, I'm sure there are articles on how to do that.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
Why you put the code inside the custom draw function (OnNMCustomdrawProgress1) of the progress bar itself. This function is called only if the Progreesbar is having OWner draw style.Whether you want to show another progress control when the custom draw function of the progress1 is called???.
thanks,
Nitheesh
|
|
|
|
|
no,i need to draw a progress bar dynamically when i press a button and the progress should be shown untill a listbox is filled,what should i do for that???shouldn't i create a progresscontrol on dialog box????what else should i do???
RAJA
|
|
|
|
|
Why you dont use of ToolBox for make progressbar and also I told you you must remove declare of this control of a function.
|
|
|
|
|
i have used a toolbar to draw the progress abr only...but,I need the display of the progressbar when i click a button and the progress should be shown untill a operation is completed,and so,where should i add the progress bar???what coding has to be done??i don't get the progress shown if the above shown coding is put!!!!!!
RAJA
|
|
|
|
|
Hi,
Place your ProgressBar Creation code in OnInitDialog (override it) and make control hidden. Then in your button click event handler make it visible and set its bar position's.
Or
you can place a progress control bar and make it visible false. then do in button click event handler as said above.
And increment the bar position in the list fill function.
thanks
Nitheesh
|
|
|
|
|
Project RAJA wrote: ...while i run the project i can see only a empty progress bar,and no progress is shown...
So which is it, empty or invisible?
Did you mean to create the control at run time rather than at dsign time?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello
I Need A Simple MFC Project With Use DataBase In That and Programming Via Microsoft Visual Studio 2003 Like This Image :
http://i28.tinypic.com/n4b04g.jpg
My Project's Source Code Too Is Here :
http://uploadbazar.com/748PVD.zip
Please Help Me
How I Can Use Database In My Project ?
Thanks
Regards
Mohsen.Alipour@Hotmail.com
|
|
|
|