|
Hi,
It seems that in Windows 7 there are some "File Permitions" system.
When my program creates a file on the hard disk, while user A is logged, when user B loggs into widows 7 and runs my program, my program can't get write access to the file which was created by user A.
When I right-click on the problematic file, go to "Properties" , and go to the security tab, I see a list of users that can access the file.
But I need to enable ALL users to be able to access the file.
Any Ideas?
Thanks!
modified on Tuesday, June 1, 2010 9:40 AM
|
|
|
|
|
I hope this code works
Instead of using SHGetSpecialFolderPath
use this code:
TCHAR szCOMMON_APPDATAPath[MAX_PATH];
SHGetFolderPath(0,CSIDL_COMMON_APPDATA,NULL,0,szCOMMON_APPDATAPath);
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
modified on Tuesday, June 1, 2010 8:25 AM
|
|
|
|
|
Sorry, it didn't help.
Still can't access a file that was created by my program when it was first ran under other user.
Any other ideas?
|
|
|
|
|
Thanks for the link, it was very helpful!
Seems the "User access Control" is a very complicated thing ...
I have a 200,000 lines of code project using many libraries like TinyXML, which create files without using "User access Control" but just doing fopen().
I turned off "User access Control" in Windows 7 and everything works fine.
Hope our customers won't mind to turn UAC as well ...
Those Microsoft guys ... they have nothing to do but to destroy the good Windows XP with stupid features in windows 7 like UAC.
|
|
|
|
|
why should the OS allow you to write to a file which you do not own ?
|
|
|
|
|
This is a file my program creates which holds a database, that all users need to have access to it.
Any Ideas?
|
|
|
|
|
|
Hi All,
I have some questions in mind about map and multimap.
1) I know that STL use height-balanced-binary-search tree for MAP implementation but what is actually used for multimap.
2) multimap can also use the same thing with a list in each node for a key. Am I right?
3) How do I give a iterator functionality in a tree structure as in maps and multimaps as in tree it's hard to go through data sequentially.
It will be very helpful if these questions can be answered.
BR,
Akash
|
|
|
|
|
It will be very much appreciated if someone can throw some light on this.
|
|
|
|
|
In previous versions, when I use dependencies and make a library project a dependency of another project, a link is added to the solution, and I can debug through the main project into the library. With VS2010, making the same dependency has no obvious effect on the solution. When I build the main project, the library is built, but is NOT included in the link. Seems trivial, but need help.
Related. When I want to add a library from another developer, I used to use 'Add existing'. This still works in VS2010, but .lib is not in the drop downs. What is the preferred method for doing this.
EJS
|
|
|
|
|
Hi Ed,
Those wacky folks at MS have changed the way dependencies are stored and used. Dependencies are now stored in the project file rather than the solution file. Please have a look here[^] - it's explained a bit better than I could, especially the section "Solution Dependencies into Project to project reference."
Hope that helps, at least to dig deeper,
Cheers,
Ash
modified on Tuesday, June 1, 2010 8:38 AM
|
|
|
|
|
Hi all,
I want to display a image in a particular control for this i have used CImage Class like this:-
CImage m;<br />
HRESULT hr=m.Load(Header_str);
But my problem is i am not getting how to show it in a particular control like static text box or picture control.
Thanks in advance
|
|
|
|
|
CImage class has already defined conversion operator to HBITMAP handle type so you can use in the same way like CBitmap class.See the documentation here
you have even example on hand.
Life is a stage and we are all actors!
|
|
|
|
|
learningvisualc wrote: But my problem is i am not getting how to show it in a particular control like static text box or picture control.
You need to use one of the drawing or 'blitting' methods to render the image onto your device context (window). See the options here[^].
It's time for a new signature.
|
|
|
|
|
Have you tried the CStatic::SetBitmap method.
You could use it like static.SetBitmap((HBITMAP)m) ;
|
|
|
|
|
Hi
How to replace occurance of one particular character in a string
For ex String str1 = "test_string_one"
In above string there are 3 occurance of character 't' at position 0,3 and 6
say i want to replace this 't' with 'z' so my string becomes as
"zesz_szring_one"
How to do it in C++ in one line without any looping or with looping
|
|
|
|
|
The CString class has a Replace method that will do this.
|
|
|
|
|
Replace(wchar_t oldChar, wchar_t newChar)
--
"Programming is an art that fights back!"
|
|
|
|
|
If you want to do it with standard C++ then use std::replace:
std::string str1( "test_string_1" );
std::replace( str1.begin(), str1.end(), '_', '-' );
FREX converts all the underscores to dashs.
Cheers,
Ash
|
|
|
|
|
Hi,
In my MDI application,i have one Group view with more No of views.I will get every page by using PageUp and PageDown.
So i coded in OnKeyDown() to get this function.
But when i press PAGEDOWN or PAGEUP,it doesnot go to that function part.But when i press like
SHIFT+PAGEDOWN it works.
So i use PreTranslateMsg() coding,i copied same coding form OnKeyDown(),but when i press PAGEDOWN it works but it move to 3rd page not 2nd page.It goes like 3,5,7 page.
When i use Mouse roll it works fine in OnKeyDown().
void CGroupView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
if(nChar == 17)
return;
BOOL bMax;
CView *curView;
CMDIFrameWnd *fWnd = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
CMDIChildWnd *fChWnd = fWnd->MDIGetActive(&bMax);
if(fChWnd->GetSafeHwnd())
curView = (CView *)fChWnd->GetActiveView();
else
curView = NULL;
switch(nChar)
{
case 33:
{
giGrPNo--;
if(giGrPNo<1)
giGrPNo=1;
else
{
Invalidate(FALSE);
}
iTagNo = -1;
break;
}
case 34:
{
giGrPNo++;
if(giGrPNo > iGrpCnt)
giGrPNo = iGrpCnt;
else
{
Invalidate(FALSE);
}
iTagNo = -1;
break;
}
}
BOOL CGroupView::PreTranslateMessage(MSG* pMsg)
{
UINT nChar = (UINT)pMsg->wParam;
UINT nKeyDown = (UINT)pMsg->lParam;
<..Same coding from OnKeyDown()..>
}
When i press PAGEDOWN it should go to that function part.What can i do?
Anu
|
|
|
|
|
Anu_Bala wrote: So i use PreTranslateMsg() coding,i copied same coding form OnKeyDown()
Possibly you should move the 'same coding' from OnKeyDown to PreTranslateMsg .
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]
|
|
|
|
|
Ya,
i moved everything form OnKeyDown() to PreTranslateMsg().
It works when i press PAGEDOWN,but it not goes to second page,directly to 3rd page.again if i press PAGEDOWN,it goes to 5th page not to 2nd page.
Anu
|
|
|
|
|
I doubt View switching might be called more than once.
Try using WM_KEYUP
Check documentation for WM_KEYDOWN:
Because of auto-repeat, more than one OnKeyDown call may occur before an OnKeyUp member function call is made. The bit that indicates the previous key state can be used to determine whether the OnKeyDown call is the first down transition or a repeated down transition.
--
"Programming is an art that fights back!"
|
|
|
|
|
I have an application which ejects a USB by CM_Query_And_Remove_SubTree API, but it returns 0x17( CR_REMOVE_VETOED ) error code in XP SP3. But it works fine in XP SP2.
Also please note the below case:
In XP SP3, after I plugged the USB first time after machine start, the USB displayed in explorer, but not able to create/copy a folder\fine into the USB drive.
I have checked with other xp sp3 machine also... issue exists. If I unplug and plug the USB manually then it works. But it works fine in XP SP2 machines.
Could any one please let me know why this issue occurs in xp sp3?
aks
|
|
|
|
|
Hi all,
I want to open a URL(http://10.14.15.23/test/test.aspx) which is present in the server.I am using the following code.
CInternetSession objInetSession;
try
{
CStdioFile* objStdFile = objInetSession.OpenURL("http://10.14.15.23/test/test.aspx",1,INTERNET_FLAG_TRANSFER_ASCII ,NULL,0);
}
catch(CInternetException* exp)
{
exp->GetErrorMessage(lpErr,sizeof(lpErr),NULL);
::AfxMessageBox(lpErr,MB_ICONSTOP);
return 0;
}
Everything is working fine. But, the server local user account, which is configured in IIS for anonymous access, gets locked frequently. So, i am not able to access this link.
Server machine has a policy that if we enter wrong password for more than 4 times while logging,the user account will get locked.
Can anyone please tell me the reason for this user account lock?
Thanks,
modified on Tuesday, June 1, 2010 2:54 AM
|
|
|
|