|
First of all, in your piece of code you have instantiated a CStatic object but have not created a static control (see CStatic::Create).
And BTW: where/why do you want to put a static control in the MDI child frame window?
Ovidiu Cucu
Microsoft MVP - Visual C++
Cofounder CODEXPERT.RO
|
|
|
|
|
thanks
Yes I do have the Create function.
How do I use WM_CTLCOLORSTATIC ?
Should I call the OnCtlColor() ?
Thanks
Pritha
|
|
|
|
|
No.
It will be called by the system while initializing the controls.
You simply have to return the appropriate brush from the message handler.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
You need to declare this event.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Thank you
It helped me a lot.
|
|
|
|
|
Hello,
There was a query on the same lines.I am many a times confused which are the fucntions that are called by the system automatically which are not.
Now in this case why the creation of CStatic calls OnCtlColor().
Thanks,
Pritha
|
|
|
|
|
Again you dont need to call OnCtlColor.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hello,
I wanted to understand the functions that are directly called by the system and the reason behind it.
Prithaa
|
|
|
|
|
We suppose you made a program Windows send messges to your program if you need to these messages you can declare events for them like WM_MOUSE* or WM_PAINT and etc.You dont need to call windows events because windows sends them to your program for exmaple you need to change color of a static control so you tell to Windows that I need to this event with declare this event.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hello,
Thanks for the reply.
but how do I know exactly which functions are called by the system an which ones I am suppose to call. is there any article which makes this clear.
Prithaa
|
|
|
|
|
You can see them on the MSDN for example if you enter WM_COPYDATA on the MSDN you will be see "This message is sent when an application passes data to another application" or WM_INPUT "The WM_INPUT message is sent to the window that is getting raw input."
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I want to read the file while downloading through the ftp client before download complete I got the error (The file is already in use. Close other programs that might be using the file, or stop playing the file, and then try again).
when I download the same file throught the window explorer by ftp I am able to read the file before download complete. My project requirement is to read some file content before download complete .How can I achieve that .
|
|
|
|
|
That is a big question. You should give more details i believe. Did you write the FTP downloader part yourself? How did you create/open the file for writing (the one you are downloading)?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Yes I write the FTP downloader part myself. I am uing CInternetSession ,CFtpConnection class to download the file and use the function FTPConnection->GetFile(LPCTSTR pstrRemoteFile,
LPCTSTR pstrLocalFile, BOOL bFailIfExists = TRUE,
DWORD dwAttributes = FILE_ATTRIBUTE_NORMAL,
DWORD dwFlags = FTP_TRANSFER_TYPE_BINARY,
DWORD_PTR dwContext = 1
).
I am downloading wmv file and while downloading I want to play on windows mediaplayer.
|
|
|
|
|
As you can see here[^], looking at the flags (especially CFile::shareDenyRead) you can guess that CFtpConnection::GetFile probably creates the target file denying read (and also probably write) access to it, so if you try to play the file in the player, the OS won't allow it to open the file. I have currently no idea how you could change the sharing-mode CFtpConnection uses to create the file.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Is there another API to download the file from the FTP to solve my above problem.
|
|
|
|
|
Well, am not sure about that, but This[^] looks promising, and you get source code with it too so you can shape it the way you want.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Thanks dear but problem is not solve there is same problem.
|
|
|
|
|
Well, looking at the code of the FTP client i'd say it should work, maybe there is something i do not know about... could you show me how your code looks like now?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi all:
I have encountered a strange and difficult problem when running application on multi-user mode.
User A and User B are running the same appclication which is using the same database(SQL2000)with remotely log in.User A is doing a operation which might take a long time to query the data from databse on the GUI of the application,at the same time,the Interface of application on user B will bolck when User B is clicking,editing the GUI of the application,Exactly I have found why this problem occurs:the requery() function is timeout when user B is querying,ODBC S1T00 query time out expired.
what I did to fix this problem is that ignore this CDBException when catched this exception,and let the application keep running anyway.but there might be any error when operating the application again.
so what is the proper way to fix this problem,setting the value of timeout should never be a good idea,I think.
Could anyone help me ,thank you in advance.
regards
Keshin
|
|
|
|
|
|
You possibly may get better help at the General Database forum [^].
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]
|
|
|
|
|
You can ask the same here instead :
DB Forum[^]
But I don't understand why it should wait for the other application to finish it's query. Both should run independently. In general, If you find the queries are taking too long, you make opt for a worker thread.
OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus
Best wishes to Rexx[^]
|
|
|
|
|
I'm using a remote execution tool called 'PsExec' from sysinternals.
I use it this way in my command prompt :
D:\Tools\Testing>psexec netsh firewall show opmode>D:\Log.txt
This generates the output for 'netsh firewall show opmode' and redirects to D:\Log.txt
Now, I implement the same logic/code in my application like this :
CString csCmdLineParams = "netsh firewall show opmode>D:\\TestdwLog.txt";
STARTUPINFO StartUpInfo;
PROCESS_INFORMATION ProcInfo;
DWORD ExitCode = -1;
memset(&StartUpInfo, 0, sizeof(StartUpInfo));
memset(&ProcInfo, 0, sizeof(ProcInfo));
StartUpInfo.dwFlags = STARTF_USESHOWWINDOW;
StartUpInfo.wShowWindow = SW_SHOW;
CreateProcess( "C:\\windows\\system32\\cmd.exe", csCmdLineParams.GetBuffer(csCmdLineParams.GetLength() + ONE), NULL, NULL, NULL, CREATE_DEFAULT_ERROR_MODE, NULL, NULL, &StartUpInfo, &ProcInfo);
WaitForSingleObject(ProcInfo.hProcess, INFINITE);
GetExitCodeProcess(ProcInfo.hProcess, &ExitCode );
if (ExitCode) {
csCmdLineParams.ReleaseBuffer();
CloseHandle(ProcInfo.hProcess);
}
csCmdLineParams.ReleaseBuffer();
CloseHandle(ProcInfo.hProcess);
But, I'm not able to redirect the output to D:\TestdwLog.txt. In fact the file is not created itself.
Note : I do have administrator rights for my system. [required for PsExec]
What am I doing wrongly ?
I also tried
StartUpInfo_IDI.dwFlags = STARTF_USESTDHANDLES; instead of StartUpInfo.dwFlags = STARTF_USESHOWWINDOW;
Replies would be appreciated
Thanks in advance.
|
|
|
|
|