|
hi Raju,
in this api convert single tiff page only......
in multiple pages it's not support, thanks for any way your suggestion
|
|
|
|
|
Hi All
A few qureies regardign ListControl
I m using List Control in report view.
Hence my list control is having around 5 columns
Say for if user selects a particular row i need to collect all data from the columns..
Kindly help me
Thanks in advance!!!
Regards
Gany
|
|
|
|
|
Well, handle the LVN_ITEMCHANGED[^] notification sent by the list control and use CListCtrl::GetItemText[^] (the subitem parameter is the index of your column) to collect the texts in the columns.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Hi. Well.. another time when i need help. I am trying to create a map (made of MPictureBox(my class derived from CButton)) in a thread. I am creating modal window and clicking "ok" button and creating map on my main window (CDialog). When i did it without threads all worked just fine. But when i put the creation in a thread it make it all very well... BUT! created buttons don't show up in the main window! (they exists in the memory but didn't show). I was thinking that probably it's some kind of problem related to using main window with different threads so i wrote this
CRITICAL_SECTION m_cs;
BOOL result2;
if (theApp.m_hThread!=NULL)
{
::InitializeCriticalSection(&m_cs);
::EnterCriticalSection(&m_cs);
result2 = this->FieldBox.Create(FieldState,fieldid,nIDResourse, ButStyle,BtSize, lpszCaption, dwStyle, rect, pParentWnd, nID, Rotate);
FieldBox.ShowWindow(SW_SHOW);
::LeaveCriticalSection(&m_cs);
::DeleteCriticalSection(&m_cs);
}
with 0 effect. Same trouble i had when i tryed to create some dynamic objects (with "= new ..."). Somebody had same trouble? What's the problem? (When i do the same thing without any thread it all results okey).. Pls help.
|
|
|
|
|
If this is MFC then its Window Maps are created per thread and a CWnd* object in one thread is not (easily) accessible in another. So doing UI stuff in worker threads is difficult. It is much easier to do this in the main app thread, and shuffle off any lengthy non-ui processing to worker threads.
|
|
|
|
|
usually if you are using worker and if you want to update GUI, then the best you can do is, just use SendMessage or PostMessage for GUI updation. otherwise it may to crashes, hope u dont want crashes
Else the suitable solution is use of UI thread, just refer [^]
Величие не Бога может быть недооценена.
|
|
|
|
|
Well.. thnx for the info it helped a lot. Now i am using UI-thread. And post messages to thread, etc. And it's all cool. It works. It creates the map of buttons and etc. BUT the problem hasn't been resolved. Buttons doesn't appear on the screen! They are created in memory but doesn't appear. Like i said the same trouble i had with pointers. I create pointer theApp.object = new CObject(...). Then theApp.object->Create(..) and theApp.object->ShowWindow(SW_SHOW) and it didn't show up. But if i write CObject globalobject; and then Create it, it appears correctly. I don't know how is that previously it worked with theApp.lvl = new ... but now it doesn't. But it all exists in the memory. I don't understand.
I noted that the objects actually works. I can click them, but the objects doesn't draw itselfs.
P.S. спасибо за ответ =)
modified on Monday, October 26, 2009 11:59 AM
|
|
|
|
|
I'm looking for some C++ code to let me quickly move a bitmap around a window, restoring the background as it moves. At present I capture the Window contents to a bitmap during the app initialization and in the OnPaint() I draw the this bitmap and then I draw my overlayed bitmap. I am double buffering the paint. The overlayed bitmap position moves with the mouse which invalidates the Window.
This works fine except it is too slow when the background window is large (think Windows Desktop) and the PC is slow. My guess is that redrawing the large background bitmap on every mouse move is the bottleneck. There has to be a much better and faster way to do this, but my searching hasn't found the answer I need.
modified on Sunday, October 25, 2009 5:25 PM
|
|
|
|
|
|
«_Superman_» wrote: Try writing a handler for WM_ERASEBKGND[^] and return non-zero.
Thanks, but I'm already doing that.
|
|
|
|
|
Try to redraw only parts on your window that really change instead of redrawing the whole thing.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
if the background is static, you really only need to draw the overlay at its new position and then draw the parts of the background that were uncovered when the overlay moved. there's no need to redraw the whole background.
1. the overlay's previous rect = R1.
2. the overlay's new rect = R2.
3. R3 = the bounding rect of R1 and R2.
4. alloc a bitmap of size R3
5. fill it with the appropriate chunk of background
6. draw the overlay into the temp bitmap
7. draw the temp bitmap to the screen
as long as the overlay is moving only a few pixels at a time, R3 should be just slightly bigger than the overlay size. if R1 and R2 don't instersect, you can split it into two operations: restore the background to one rect, then draw the overlay into the other - don't bother with the temp bitmap.
|
|
|
|
|
Thanks Chris, sounds like a good plan.
|
|
|
|
|
Load the image to memory and try to move it.
|
|
|
|
|
I am already using a memory buffer as I said at the start: "I am double buffering the paint."
|
|
|
|
|
Would you get better performance by using your current methods but using (say) DirextX or OpenGL to do the blitting? They might have better performing drivers that make better use of hardware?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks Stuart. I'd considered that but didn't want to add the overhead and complication of using these libraries. As of late yesterday I now have an implementation that works well enough on my slow old Vista Notebook and very well on my Desktop PC. Basically doing what Chris suggested.
|
|
|
|
|
Hi again,
Does anyone know a code so when the user presses the Escape key during the full screen mode in my Win32 project to exit the application just by pressing the button.
Thanks
Andrew McIntyre
|
|
|
|
|
Assing an accelerator key to VL_ESCAPE, and handle (eg) IDM_VIEW_CANCELFULLSCREEN.
Or hook up WM_KEYDOWN/VK_ESCAPE...
Basically, the same way as you'd handle someone pressing the 'A' key.
Enjoy,
Iain.
ps, I'm not touching the fullscreen bit, as I know you did all that yesterday. If you can switch into fullscreen, you can switch out.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
So how would that look like with in code.
Andrew McIntyre
|
|
|
|
|
MrMcIntyre wrote: So how would that look like with in code.
Well now that you know what the code looks like to maximize the window you should be able to figure out how to get it back to normal size.
|
|
|
|
|
Manage the use of electricity in a village (or ward)
1. Managing households in each village (data including: household owner, address, schools needed)
2. Manage the use of electricity in a month
3. Calculate the monthly electricity use of each household
4. Report payment of monthly electricity use
5. Handling violations (Interrupter, electric discharge back)

|
|
|
|
|
Uh, what a interesting project: good luck!
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]
|
|
|
|
|
*click*
Bad Question.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
If you do get help doing this, I trust you'll make a nice donation to a programming related charity?
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|