|
I want to saving a drawing in client area to a bitmap file,I have refered to an article "saving a drawing to a bitmap file" in our website,but I don't know how it works.I appreciate more examples and explainations.Thanks.
|
|
|
|
|
I saw some functions such as WriteWindowToDIB,DDBToDIB(),WriteDIB() in some articles,but I can't find them in MSDN~why?~~
|
|
|
|
|
Chen-XuNuo wrote: but I don't know how it works
You're a programmer, right?
Try doing a search on CP. I'm certainly not going to do it (the search) for you.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi all.
I am trying to customize a List box to load the jpg preview images in it.
I have managed to load all the jpg files in a list box; one below the other from the selected location.
But by default the preview height is 16 pixels. I tried to change it to 200 by following way…
void CListBoxEx::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct)
{
lpMeasureItemStruct->itemHeight = 200;
}
but the height is remaining the same (16 pixels).
How can I set the height to the desired pixel amount?
Thanks
Sameer Thakur
|
|
|
|
|
Did you create your ListBox with Owner-draw style (LBS_OWNERDRAWVARIABLE)? If not try creating with the style.
|
|
|
|
|
Yes I have set the property of "Owner Draw" to "variablr" under style tab.
Also checked the option of "Has String" under it.
Sameer Thakur
|
|
|
|
|
In WM_DRAWITEM handler, did you set the property CtlType of DRAWITEMSTRUCT to ODT_LISTBOX?
|
|
|
|
|
No initialy I did not.
But I have added it now but still the item size is not getting changed.
Sameer Thakur
|
|
|
|
|
Hello all,
I have made a worker thread and its running when a particular event occur.
Before stopping the thread i want to check whether it is running or not.
How can i find this???
thanks in advance
|
|
|
|
|
You can use GetExitCodeThread[^]. If the value returned by the thread is STILL_ACTIVE, then your thread is still running.
|
|
|
|
|
i have made a sdi application in that i have made a listctrl.
Now i have made ui thread, for checking out that particular thread is running or not i have written this code
std::map<int, CPingThread*> assocsping;
void CHttp::StopThread(int key)
{
std::map<int, CPingThread*>::iterator pos = assocsping.find(pingkey);
if(pos != assocsping.end())
{
pos->second
CPingThread* pThread = pos->second;
pThread->PostThreadMessage(WM_QUIT,NULL,NULL);
}
}
now how can i do this thing when using worker thread
please help me
|
|
|
|
|
I suppose (but it was not clear) that CPingThread is a class that inherits from CWinThread and that it implements the thread function ?
CWinThread has a public member m_hThread (see here[^] ). You can pass this handle to the function (as explained in my previous post)
|
|
|
|
|
This is not a good way to check if a thread has exited. Here’s what MSDN has to say on this issue:
Warning: If a thread happens to return STILL_ACTIVE (259) as an error code, applications that test for this value could end up in an infinite loop.
Here's how you do it without such dangers:
if (WaitForSingleObject(hThread, 0)==WAIT_OBJECT_0)
{
}
Don't forget to close the thread handle when you're done with it.
Steve
|
|
|
|
|
i need some information about programing for usb port
|
|
|
|
|
Ok see here[^] for some info and also wikipedia has some good info here[^]
|
|
|
|
|
mahieh wrote: i need some information about programing for usb port
Open the driver associated with the USB device withe the CreateFile function and then you can use ReadFile or WriteFile to read or write data. You can also use DeviceIOControl to exchange driver specific commands.
|
|
|
|
|
I want to calculate the mode(statistics) of the data items stored in vector
|
|
|
|
|
PREETIGUPTA wrote: the mode(statistics)
What do you mean by mode exactly ? (I don't remember having learned something like that in statistic...)
PREETIGUPTA wrote: data items
What kind of data ?
PREETIGUPTA wrote: in vector
A std::vector ? Or a plain C++ array ?
Also, try to use a relevant title. I don't really see how your question is related to Visual C++ (or, yes, I see but in that case ALL questions could have the same title).
|
|
|
|
|
Cedric Moonen wrote: PREETIGUPTA wrote:
the mode(statistics)
What do you mean by mode exactly ? (I don't remember having learned something like that in statistic...)
He means this:
Mode (statistics)[^]
If the vector contains discrete values (integers), then the problem is just to find the most commonly occurring value.
|
|
|
|
|
|
|
|
|
Hello all,
When I tried to compile my program, I am having following error. If you know how to resolve please help me.
Linking...
mfcs42d.lib(stdafx.obj) : error : Internal error during Pass2
ExceptionCode = C0000005
ExceptionFlags = 00000000
ExceptionAddress = 1030C9DE
NumberParameters = 00000002
ExceptionInformation[ 0] = 00000000
ExceptionInformation[ 1] = 00000014
CONTEXT:
Eax = 00000000 Esp = 0012F0B0
Ebx = 00377DD0 Ebp = 0012F0C0
Ecx = 00000000 Esi = 00377DD0
Edx = 00001003 Edi = 00001003
Eip = 1030C9DE EFlags = 00010256
SegCs = 0000001B SegDs = 00000023
SegSs = 00000023 SegEs = 00000023
SegFs = 0000003B SegGs = 00000000
Dr0 = 0012F0B0 Dr3 = 00377DD0
Dr1 = 0012F0C0 Dr6 = 00000000
Dr2 = 00000000 Dr7 = 00000000
Error executing link.exe.
Tool execution canceled by user.
Thanks for ur prompt reply.
Regards,
Nikhs
Nikhil Trivedi
|
|
|
|
|