|
Ok. I will try. One more question. with WM_PRINT i am able to capture the content of the grid. But not able to print the grid. Is it not possible to print the grid with WM_PRINT?
Regards
|
|
|
|
|
ops. there is a pblm. I tried like
void ListEx::OnPaint()
{
CPaintDC dc(this);
SendMessage(WM_PRINTCLIENT, (WPARAM)dc.m_hDC, (LPARAM) PRF_CLIENT);
}
In the above code, the grid is also painting. then I tried to paint it to the desktop like
void ListEx::OnPaint()
{
CListCtrl::OnPaint()
CWindowDC dc2(0);
SendMessage(WM_PRINTCLIENT, (WPARAM)dc2.m_hDC, (LPARAM) PRF_CLIENT);
}
But in this case only the text came...
|
|
|
|
|
First let me thank you for your kind support.
I wrote the code like this it is printing but no grid line not the entire client screen. it is capturing the area where the data is there
So what should i do
<div class="ForumMod">modified on Friday, June 27, 2008 3:07 AM</div>
|
|
|
|
|
subramanyeswari wrote: memDC.Attach(hDC);
why is this attach? And is this all code in the paint function? Because, the CPainDC should be used only in the OnPaint() function.
Actaully what is your purpose? To customise the list control, there are another standard method likes, Custom Draw( NM_CUSTOMDRAW ) and Owner draw . It better to use those functions for customizing especially using Custom Draw is simple and you can find many samples in code project itself.
Good Luck
|
|
|
|
|
I want to capture the image on the screen which is a custom control. I am not able to capture it with WM_PRINT. BitBlt is failing since the target window is invisible. (refer the site http://www.gamedev.net/community/forums/topic.asp?topic_id=327506[^]
And the code that i have shown like attach is not in the OnPaint(). It is in my own function.
Regards, Eswari
|
|
|
|
|
Naveen wrote: Sorry, I coudn't understand the diifference...What do you mean by "content of the contol" and "screen shot of the control".
The difference is having Notepad running with a large text file and doing a screen-shot using <alt+printscrn></alt+printscrn> as opposed to using File-Print .
The first one gets you the "screen shot of the control" (plus the application window itself), the other gets you the "content of the control."
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
I don't know how to attach files. So that you can see the difference
Regards
|
|
|
|
|
Hi all,
I m working on VC++ 2005 MFC application,
here i m using a DateTimeControl.
Please tell me how can get the Moth and year value from the selected date of DateTimeCtrl.
Please help me for this.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
|
i m already try this but this gives total value of date like"06/07/2008"
but i want seprate values of Mont and year of Selected Value.
Please help me for this.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
If you get a COleDateTime you can retrieve the month with GetMonth. So, what is your problem exactly ??
|
|
|
|
|
i m also using this but gives Janury for month always.
i want when i m selected any date in DatetimeCtrl,then get selected month and year value.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
ThatsMe. wrote: i m also using this but gives Janury for month always.
Please post the relevant code (using the "code block" tag): I would like to see how you extract the date from the CDateTimeCtrl and how you verify that it's January.
|
|
|
|
|
thanks now it is resolved.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
ThatsMe. wrote: i m also using this but gives Janury for month always.
Because it's a long, long, long winter.
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
|
|
|
|
|
Can you tell us why you didnt try to do and we must do it?
Thanks
|
|
|
|
|
He's a repeat offender. He doesn't use Google or actually attempt to try to code. If you look at past questions I don't think he's ever posted code.
|
|
|
|
|
Maybe,but how can you understand this guy is man?
|
|
|
|
|
Can you paste your code snippet.
Regards,
Sandip.
|
|
|
|
|
What about reading the documentation
Greetings from Germany
|
|
|
|
|
I've placed the following code into a thread in order to receive data
from a socket.
do
{
// Initializes structures which are updated by the select() call
FD_ZERO(l_aFdSetSockets);
FD_SET(l_pScktReceiver->m_scktReceiver, l_aFdSetSockets);
// Makes a blocking select
if(select(FD_SETSIZE, l_aFdSetSockets, NULL, NULL, NULL) > 0)
{
// Checks whether the listening socket is selected.
// May be redundant.
if(FD_ISSET(l_pScktReceiver->m_scktReceiver, l_aFdSetSockets))
{
l_pScktReceiver->HandleReceivedData();
}
}
else
{
// Error on waiting for connection:
// could be caused by user request
return l_pScktReceiver->SetThreadSynchroStatus(SCKT_RECEIVER_ERR_SELECT);
}
} while(1);
So.. the thread is suspended until the socket is signaled, and when data
are received by the socket, select call is unblocked and I can manage data.
My problem is the following:
how can I let the select call to be unblocked in order to let the thread
to be closed when my application need to stop receiving ? I'de like to let
the select call to be unblocked bu another event that is not related to
the socket status (data reception).
Thanks a lot!
|
|
|
|
|
ilgale wrote: how can I let the select call to be unblocked
You've answered your own question. You have to switch to non-blocking sockets and implement your own loop to get all the expected data. A socket can't be both blocking (for normal operation) and nonblocking (for program termination) - you must choose one.
Judy
|
|
|
|
|
Hi,
I am creating Explorer like application, how can I open file with corresponing application e.g open a msword file in msword, paint in mspaint etc...
|
|
|
|
|
Use ShellExecute See here[^]
Regards,
Sandip.
|
|
|
|
|
Use ShellExecute() with "open". Any file will open with its associated program automatically.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|