|
sirryan wrote: ::SetClipboardData(CF_BITMAP, (HANDLE)hFace);
This is wrong; you are pointing the clipboard to some data in your app and then destroying that data. You must copy the data to global memory first. Check the documentation on MSDN for the clipboard functions.
|
|
|
|
|
There is something strange going on. I found that not only the EmptyClipboard function gives an error 1418(Thread does not have a clipboard open) but also all the functions after that:
SetClipboardData, CloseClipboard, DeleteObject.
It seems like I have forgotten to open the clipboard but I open it successfully as the OpenClipboard(NULL) returns 1. In spite of the fact that all the functions mentioned above give an error, the icon is usually added to my button.
Why can't I open the clipboard as it should be? Could there be another reason for my problem with the Add-in crashes (they appear sometimes) except the clipboard issues?
|
|
|
|
|
sirryan wrote: Could there be another reason for my problem with the Add-in crashes (they appear sometimes) except the clipboard issues?
There may be some extra rules to follow when doing this via an Add-in. I have not used this feature so cannot offer any suggestion.
|
|
|
|
|
It seems that I found the problem. It is definitely about the clipboard. So first I figured out how to overfill the clipboard. I just open the MS Word and make a huge file containing about 4-5 thousand pages of witch 30% pictures and 70% text. Then Select All and Copy. When i try to close the MS Word application it asks me if I want to save the clipboard to other applications. I click Yes. Now there is a overfilled clipboard! The MS Word is usually not responding but leave it that way. Don't hurry up shutting it down.
Now when I try to open another MS Word - it crashes because of the add-in. When I debug the add-in it turned out that when the clipboard is overfilled the PasteFace() function throws an unhandled exception. Now the only thing I have to do is to deal with the exception.
|
|
|
|
|
hi:
In a MFC class, I button the right mouse "goto definition of XXX", but can not enter the function "XXX". It enter another function .how todo it.
|
|
|
|
|
lxkjlzz wrote: not enter the function "XXX"
You've to wait for your 18th birtday.
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]
|
|
|
|
|
1. add message handler WM_RBUTTONDOWN
2. Under this method call ur function xxx();
|
|
|
|
|
He was talking about the Code Browser I think.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
it is not add message,it is only find a exist function.use mouse right key,show "go to definition xxx".but find another function.
|
|
|
|
|
wait answer
|
|
|
|
|
Most likely your .ncb file has become corrupted. Close your project, then delete the .ncb, .aps, and .clw files (they will be automatically recreated when needed). Reopen the project and you should be OK.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
thank you ,finally you can know my question.It's the answer that i want to get.
|
|
|
|
|
I am writing a program in C that compares two images taken by a camera to see if they are different. I have an idea of how to do this, by putting the images into 2 dimensional arrays and comparing the RGB value at corresponding array positions, however I cannot figure out how to get the image into an array.
I've found a ton of example of how to do this in C#, but that's not so helpful. The only bit of C code I've been able to find uses fread() to read the images but that doesn't seem to work.
I've also heard some suggestions that converting the images to greyscale is helpful in comparing the pixels. Agree? Disagree? And I've been working with jpegs, but is there another format that might work better?
Thanks in advance
|
|
|
|
|
use CImage::GetPixel()of two images .
then write into two text file / Array
then you compare it ..what is the difference are there !!
Raju !!!
|
|
|
|
|
Thanks for the answer, but this seems to only be available in C++ and I need to code in C.
|
|
|
|
|
Use GetDIBits to get the bitmap information of each image and then compare these informations.
|
|
|
|
|
I've been searching and I can't find any mention of GetDIBits in C, only C++. Is it available in C?
|
|
|
|
|
It is a Windows API and definitely available in C.
|
|
|
|
|
Ah. Thank you very much, but I'm afraid I should have mentioned that I am writing my program on Linux. Thanks anyways!
|
|
|
|
|
justabeagle wrote: I'm afraid I should have mentioned that I am writing my program on Linux.
Gee, you think? But no problem - I'm sure all the people who responded didn't mind wasting their time.
|
|
|
|
|
Clearly, seeing as how you wasted your time just to make sure I knew I was wasting other people's time.
|
|
|
|
|
justabeagle wrote: I am writing a program in C that compares two images taken by a camera to see if they are different.
This article may give you some ideas.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
in debug version of my program the OnKillFocus function of combobox is called,but in its release version this funcion is never called .Can anybody tell me why? PS: the combobox is a child window of a listview control.
|
|
|
|
|
vctrlao wrote: in debug version of my program the OnKillFocus function of combobox is called,
How do you check that it is called or not ?
|
|
|
|
|
I added TRACE0 in this function
|
|
|
|