|
You are probably right.
If you want to have EVERYONE permission, you need to create new security descriptor.
NULL says that the default ACL is used, i.e. only the user or someone with higher privileges (administrator for example) can change the file.
Try this:
SECURITY_ATTRIBUTES m_pSecAttrib;
SECURITY_DESCRIPTOR* m_pSecDesc;
m_pSecDesc = (SECURITY_DESCRIPTOR*)LocalAlloc(LPTR,
SECURITY_DESCRIPTOR_MIN_LENGTH);
InitializeSecurityDescriptor(m_pSecDesc,
SECURITY_DESCRIPTOR_REVISION);
SetSecurityDescriptorDacl(m_pSecDesc,TRUE,(PACL)NULL,FALSE))
m_pSecAttrib.nLength = sizeof(SECURITY_ATTRIBUTES);
m_pSecAttrib.bInheritHandle = TRUE;
m_pSecAttrib.lpSecurityDescriptor = m_pSecDesc;
It should create security descriptor with EVERYONE permission.
Instead of NULL, send &m_pSecAttrib.
Hope I helped.
|
|
|
|
|
Jusef Marzbany wrote: but when I log in with a user other than one in which I created the file, I can not save any modification in it neither delete it. any help?
What error message are you receiving?
"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
|
|
|
|
|
Hello all.
I'm again bringing up this problem because my last thread regarding this problem dissolves in lot's of thread here, Hoping to find answer this time.
I am extracting the data in "Simplified Chinese" from database and writing the data into file(Notepad).. In other words i'm making many LAN Files from single database. It works well, I'm getting right data in LAN Files...
Now the problem is that the project is pretty big and old applications are using GetPrivateProfileString to read from LAN files, But when they(applications) read "Simplified Chinese" LAN files they get Junk or question mark instead of Simplified Chinese characters.. Also when i tried reading and displaying using GetPrivateProfileStringW it works well but i cannot alter old applications code..
So my question is that, Is there any way i can read that data in simplified chinese using GetPrivateProfileString and able to display right data on GUI.
P.S
I make different LAN files using different language databases including "Traditional Chinese" and it works well, Only Simplified Chinese is creating problem.
Thanks.
modified on Friday, August 7, 2009 4:49 AM
|
|
|
|
|
It seems your old applications were ANSI. You should recompile them with UNICODE flag set instead.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Thanks for your reply, Yes they are in ANSI But i simply cannot change anything..There's lot of dependency.. Whatever i can do is in my code(Database to LAN)..
|
|
|
|
|
I'm not sure if it really can be done, but try looking at the different code pages[^]. See GBK[^].
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
I tried int iReturn = _setmbcp(936); also... But no suuccess
Anyone...
Thanks.
|
|
|
|
|
gothic_coder wrote: iReturn = _setmbcp(936);
I don't know what that is.
Anyway, if you're program is ANSI how can you read Chinese Simplified? Isn't it supposed to need Unicode or at least MBCS or am I wrong?
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Yes it will better to change the project setting with UNICODE support.
ANSI characters only 256 they wont support any East Asian language.
Величие не Бога может быть недооценена.
|
|
|
|
|
The OP says that Traditional Chinese works in his first post.
P.S. I make different LAN files using different language databases including "Traditional Chinese" and it works well, Only Simplified Chinese is creating problem.
I really don't get it how it can work with an ANSI program, but he seems to say that.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Yes it work smoothly in "Traditional Chinese"... Trust me, Other applications which reads are ANSI based... I am really confused why it's not working in the case of "Simplified Chinese".
Thanks.
|
|
|
|
|
My program is in UNICODE, and other applications(Which read from LAN) as i mentioned earlier were written long back and in ANSI... But when i make "Traditional Chinese" lan files the applications read the right data and i get right data in GUI.. I'm writing the unicoded data in the file(notepad) in my program...
So isn't there any way for "Simplified Chinese".
Thanks.
|
|
|
|
|
|
Also when i tried "Traditional Chinese" LAN files in "Simplified Chinese" operating system, It shows everything in English..I mean when i check LAN files it is in "Traditional Chinese" but when applications read from LAN files and display on GUI, it shows everything in English.. The OS is Windows7..
Also in Win XP, The application shows the mixture of right data and "?", It must mean that whatever application understand it shows it and for the rest it shows "?"..
Thanks.
|
|
|
|
|
I have a CMFCRibbonComboBox (which is derived from CMFCRibbonEdit), and I've captured the event of the user selecting an item by overriding OnSelectItem. However I don't know how to capture the event of the user typing inside the edit box and pressing enter. I looked at CMFCRibbonEdit::OnKey, but it is not called. Should I place a message-map entry instead? In spyxx the class of the edit box is isn't "EDIT", but "RichEdit20A".
Here's my code so far:
class MyCMFCRibbonComboBox : public CMFCRibbonComboBox
{
public:
MyCMFCRibbonComboBox(UINT nID, BOOL bHasEditBox = TRUE, int nWidth = -1, LPCTSTR lpszLabel = NULL, int nImage = -1)
: CMFCRibbonComboBox(nID, bHasEditBox, nWidth, lpszLabel, nImage)
{
}
virtual void OnSelectItem(int nItem)
{
CMFCRibbonComboBox::OnSelectItem(nItem);
}
};
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Just override the rich Edit EN_CHANGE message.
It will be notified.
Величие не Бога может быть недооценена.
|
|
|
|
|
I tried overriding it in CMainFrame message map like this
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWndEx)
...
ON_EN_CHANGE(ID_RIBBON_BTN_COMBO, OnRibbonBtnComboChange)
...
END_MESSAGE_MAP()
But my function didn't get called.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
modified on Friday, August 7, 2009 7:51 AM
|
|
|
|
|
Did u checked with spy++, which message is coming on clicking the Rich edit
From which control does your control derived from Combo box?
Величие не Бога может быть недооценена.
|
|
|
|
|
Well, while typing inside the edit control mostly 0x400 notify message is sent (EN_UPDATE). But it's called even when I'm not typing anything.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Hello Friends
I m reading one .bmp file using Bitmap and BitmapiNfo class.I m getting RGB value for each pixel and file size is around 27kb having pixels 96*96 .
And now the problem is I can write this much data as ASCII into my XML file so first how do i converto them as Binary then after that Can i write binary data into XML file?
Thanks IN Advance.
Regards
Yogesh
|
|
|
|
|
why XML?
It is Possible, but i afraid whether it is a good solution.
Величие не Бога может быть недооценена.
|
|
|
|
|
b'coz I m using XML as database.so thats y i need to save all this information IN XML.
|
|
|
|
|
yogeshs wrote: b'coz
yogeshs wrote: y
You use such a conciseness in your posts and such a verbosity in your databases, let's try the opposite...
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]
|
|
|
|
|
Why do you want to save your bitmap into your xml file ? This looks like a very ugly solution to me... Waht are you trying to achieve by doing this ?
|
|
|
|
|
b'coz i m using XML as database .Thats y i need this.
|
|
|
|