|
i was surfing the whole noon just looking on how to create a shared folder over network with permission. i also couldn't found any example in MSDN. at last i found some code snippets on some forum.. anyone could give some code snippets? thanks in advanced.
SECURITY_INFORMATION SecurityInformation;
SecurityInformation = OWNER_SECURITY_INFORMATION;
SECURITY_DESCRIPTOR SecurityDescriptor;
ACL Acl;
SID Sid;
DWORD dwAclAllowed;
dwAclAllowed = sizeof(ACCESS_ALLOWED_ACE) - sizeof(DWORD) + GetLengthSid(&Sid);
InitializeAcl(&Acl, dwAclAllowed, ACL_REVISION);
InitializeSecurityDescriptor(&SecurityDescriptor, SECURITY_DESCRIPTOR_REVISION);
SetSecurityDescriptorOwner(&SecurityDescriptor, &Sid, TRUE);
SetSecurityDescriptorGroup(&SecurityDescriptor, &Sid, TRUE);
SetSecurityDescriptorDacl(&SecurityDescriptor, TRUE, &Acl, TRUE);
SetSecurityDescriptorSacl(&SecurityDescriptor, TRUE, &Acl, TRUE);
SetFileSecurity(strOCRDownloadFontLibPath, SecurityInformation, &SecurityDescriptor);
from,
-= aLbert =-
|
|
|
|
|
This may be a general doubt but I do need clarification .
I have declared a userdefined class object m_pElement as a member of CMainFrame.
I want to release its memory in the destructor in the foll.manner.
CMainFrame::~CMainFrame()
{
if (m_pElement)
delete m_Element;
}
But if I had not declared memory for pElement using 'new' the above destruction leads to exception.
How to check for allocated memory and then release the memory for pElement.
laiju
|
|
|
|
|
In the class constructor of CMainFrame, set pointer to NULL:
CMainFrame::CMainFrame()<br />
{<br />
m_pElement = NULL;<br />
}
Like that, in your destructor, if the pointer is NULL, it won't be destroyed.
|
|
|
|
|
Set m_pElement to NULL in your constructor. Then, the if statement will actually work and the delete will not be executed. And even if it is, it's not a problem to delete a pointer to NULL. In your case however, m_pElement can point to 0x0ccccc (arbitrary) and you're trying to delete it which is not legal.
|
|
|
|
|
i am working in MFC VC++ and need to read a specfic line, and only that line from a text file. Is there a readline() function or something like that?
thanks
|
|
|
|
|
is std::ifstream::getline() useful ?
cheers,
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
There is _fgetts(...) function.
Are you looking for something MFC-specific, like CStdioFile::ReadString(...) ...? Or something that uses native Win32 HANDLE s?
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
I'm not sure I'm doing the right thing.
I have a CStatic in a dialog ( with the associated variable in the dialog class ), and I want to change the "weight" of the font of the CStatic, make it bold or normal depending on a state.
Can I do something like :
CFont* font = m_MaxStatic.GetFont();
LOGFONT logFont;
font->GetLogFont( &logFont );
logFont.lfWeight = FW_BOLD;
CFont newFont;
newFont.CreateFontIndirect( &logFont );
m_MaxStatic.SetFont(&newFont);
when I do the above, the font seems ok, it appears bold, but if the dialogs ( or the control ) gets invalidated, the font (size) is different.
Do I need to make the 2 different fonts (normal and bold) class members ( of either the dialog or a derived CStatic class ) ? or is there a better way to dinamically change the font of a control ?
Should there be a functional difference between small fonts vs. large fonts.
Thanks a lot.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Maximilien wrote:
CFont newFont;
You are creating the font correctly. But since it is local to the function, it goes out of scope when the function exits. This means that the font the control is trying to use has been destroyed. So the next time it tries to draw, it no longer has a valid font.
Make the CFont object a member of the class. That should do it for you.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Yeah, thanks, It figures ...
(ranting)
it's kind of weird that I have a CWnd object with the SetFont() method and I need to keep a local copy of the font ... why can't it copy the font instead of keeping a pointer to it.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
It allows only a single instance of the same font to be used with multiple controls, and you (the developer) maintain its lifetime, so there is no additional allocate-copy-deallocate overhead.
I would not want to set the font for 20 controls on a non-modal dialog, then open a few copies of that dialog, and have MFC have a bunch of identical copies of a font being managed.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
|
Thanks for the faq link ...
I will hide under a rock ...
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I've tried to implement the MATLAB C++ Math Library using Riazi's article posted 28 May 2003. I get a link error 'cannot find the file "MSVCIRT.LIB". I've tried the recommended fix (/nodefaultlib "MVSCRT.LIB" and (/nodefaultlib "MVSCIRT.LIB") which yields more undefined symbols. I've also tried selecting multithreading and still get the error. Any suggestions would be appreciated.
Ron
|
|
|
|
|
If you tell us what some of the undefined symbols are, sometimes we can suggest which library to try linking with. What seems to be missing?
|
|
|
|
|
Hi Everybody,
I am doing a project in image processing using VC++, in which I have to find the intersecting points in a grid.
I tried many corner detection algorithms. Everything works fine with straight lines but not with skewed lines.
Please help me with some algorithm or code
Thanks in advance
|
|
|
|
|
I guess you'll have to take each pixel and verify if it has the same value as at least one from his neighbours.
Something like this:
[ 1 2 3 ]
[ 4 5 6 ]
[ 7 8 9 ]
Now you take pixel #5 and check his value with the ones from that matrix. if it's the same then it is a point of the line(composing the grid), if not then it don't belongs there.
Once you know where the grid lines starts it's easy to identify the intersecting points since you'll know the angle and everything.
|
|
|
|
|
Is it possible to load msword doc and to perform string manipulation.Suppose If we use "Navigate2" we can load the Doc Files,but I was not able to do string manipulation?.Can anyone help out in this.
Thanks,
Gnanaprakash
|
|
|
|
|
You need to Google or search MSDN for Word Automation.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
David,
Thanks for ur info.Is there any third party controls like CHTMLView.
|
|
|
|
|
GnanaprakashJebaraj wrote:
Is there any third party controls like CHTMLView.
Not sure what you mean by "third party" but CHtmlView is part of MFC.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
|
Alok Gupta,
Thanks for ur info.Is there any third party controls.If we go for Addins we have to port in WinWord.But I need to have in SDI/Dialog.Is there any option.
Thanks,
Gnanaprakash
|
|
|
|
|
Microsoft NewsGroup will right place to ask these type of Question
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Thanks for ur info.
www.mindcracker.com/code/2003/July/WordAddIn.asp
I have done all the steps to load Addins in the Word as mentioned in article.I was able to compile code but I couldn't see my addin item button in Word.
Even tried this
Tools -> Customize
Select the Commands Tab
Select Tools in the Categories
Drag the "COM Add-Ins" to a toolbar somewhere.
Click Close.
This article for outlook is working .www.mindcracker.com/mindcracker/c_cafe/atl/BuildingOffice2KCOMAddInAD.asp
How can I see my addin items.Iam using office2000
Thanks,
Gnanaprakash
|
|
|
|