|
This is not a valid ini file. You can't have multiple keys with the same name inside a same section. You are trying to use the wrong tool for the job. As suggested before, you should use something like XML. Here[^] is a simple and lightweight XML library that you could use.
|
|
|
|
|
As Cédric said, you should use unique keys. A workaround may be appending the item number to the name, for instance:
[T_FREC]
ID0= 1
DES0= 100.001
ID1= 2
DES1= 100.002
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]
|
|
|
|
|
Where does this file come from?
"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
|
|
|
|
|
CPallini wrote: Have you considered XML?
I took it that he was reading from the INI file, not writing to it.
"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
|
|
|
|
|
Someone already mentioned that you may need to rethink your design. It would appear that you are using the .ini file as a simple database, and this is not its purpose. You would be better to use a simple text file or XML to store these records.
|
|
|
|
|
johnjitu wrote: ...i have to load elements from a .ini o txt files...
Is this something new?
"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
|
|
|
|
|
I have made a Word Add-in. I use the clipboard to put an icon in my Add-in button. The code is:
HBITMAP hFace =(HBITMAP)::LoadImage(g_hInst,
MAKEINTRESOURCE(IDB_OPEN_PDF),IMAGE_BITMAP,0,0,LR_LOADMAP3DCOLORS);
// put bitmap into Clipboard
::OpenClipboard(NULL);
::EmptyClipboard();
::SetClipboardData(CF_BITMAP, (HANDLE)hFace);
::CloseClipboard();
::DeleteObject(hFace);
// set style before setting bitmap
spButton->PutStyle(Office2000::msoButtonIconAndCaption);
spButton->PasteFace();
return S_OK;
OpenClipboard opens the clipboard successfully as it returns 1 every time. The problem is that EmptyClipboard returns 0 every time. It seems that there is a problem with the clipboard. EmptyClipboard gives an error 1418 - Thread does not have a clipboard open. That is strange because I've just opened the clipboard successfully.
Has anyone run into such problem?
|
|
|
|
|
From MSDN [^]:
If an application calls OpenClipboard with hwnd set to NULL, EmptyClipboard sets the clipboard owner to NULL; this causes SetClipboardData to fail.
Are you sure is what you want?
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]
|
|
|
|
|
Actually this is not quite right . The definition of the hwnd parameter of OpenClipboard is:
Handle to the window to be associated with the open clipboard. If this parameter is NULL, the open clipboard is associated with the current task.
However I tried to pass the hwnd of the program my Add-in is associated with (that is MS Word in my case) but I could not get the Active Window because it is probably not initialized when I ask for it.
The problem is that the program crashes sometimes because of my add-in. The reason is something about using the clipboard. I also noticed that EmptyClipboard clears the clipboard but still returns 0. My icon is usually added but it is unexceptable for me sometimes to crash.
Do you have any idea what can be the reason of the strange behavior of the EmptyClipboard function and the reason that cause the crashes?
|
|
|
|
|
sirryan wrote: Actually this is not quite right Smile .
So MSDN is wrong? Write a remark to them...
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]
|
|
|
|
|
CPallini wrote: So MSDN is wrong?
It wouldn't be the first time.
"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
|
|
|
|
|
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 !!!
|
|
|
|