|
Hi Guys,
Can anyone plz suggest some links for CTabctrl + Property Page application( eg: the page which is displayed when Properties of a folder or file is clicked.
Thanks in Advance
Velayudhan
|
|
|
|
|
|
See here[^] maybe it is some helpful to you
|
|
|
|
|
Is there any API to convert C:\DOCUME~1\SUNIT~1.SIN\LOCALS~1\Temp to C:\Documents and Settings\sunit.sinha\Local Settings\Temp.
Pls help me.
hanx in advance
never say die
|
|
|
|
|
sunit5 wrote: Re: convert File Path form DOS to Windows type
GetLongPathName()
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanx a lot
never say die
|
|
|
|
|
sunit5 wrote: C:\Documents and Settings\sunit.sinha\Local Settings\Temp.
GetShortPathName to convert it back!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi,
in my applcation,i have graphs, trend graph like that.Each view i have this kind of diagrams..I have to print this page when i press print button in my view page.How can i do that?Till now i didnot work in printers.
Is there tutorial?Pls help me?
Anu
|
|
|
|
|
Hi,
Please use this code.
CPrintDialog printdlg( FALSE );
printdlg.DoModal();
Regards
Velayudhan
|
|
|
|
|
See PrintDlg(...)StartDoc(...)StartPage(...)
|
|
|
|
|
Hi!
I am having problem using CopyFile() function call. I am trying To copy a file which is not a read only file to a new folder created using CreateDirectory(). But Its giving me error numbered 5 saying Access Denied.
I found that whenever I create new directory It is read only by default. I cant change/remove its read only attributes.I am using XP SP2 and I am having administrative rights.
How should I do this? How can I copy file to a readonly folder?
Thx
|
|
|
|
|
sach!! wrote: How can I copy file to a readonly folder?
Did this in a console based application.
#include "windows.h"
DWORD CreateDirWithSecurity(LPCTSTR lpPath)
{
SECURITY_ATTRIBUTES mySecAttrib;
SECURITY_DESCRIPTOR mySecDesc;
PACL pAcl = NULL;
DWORD cbAcl = 0,dwNeeded = 0,dwError = 0;
HANDLE hToken;
PTOKEN_USER ptu = NULL;
if(!OpenProcessToken( GetCurrentProcess(), TOKEN_QUERY, &hToken))
return GetLastError();
GetTokenInformation( hToken, TokenUser, NULL, 0, &dwNeeded);
if(GetLastError() != ERROR_INSUFFICIENT_BUFFER)
{
dwError = GetLastError();
goto clearAll;
}
ptu = (TOKEN_USER*)malloc(dwNeeded);
if (!GetTokenInformation(hToken, TokenUser, ptu, dwNeeded, &dwNeeded))
{
dwError = GetLastError();
goto clearAll;
}
cbAcl = sizeof(ACL) + ((sizeof(ACCESS_ALLOWED_ACE) - sizeof(DWORD)) + GetLengthSid(ptu->User.Sid));
pAcl = (ACL*) malloc (cbAcl);
if(!InitializeAcl(pAcl, cbAcl, ACL_REVISION))
{
dwError = GetLastError();
goto clearAll;
}
if(!AddAccessAllowedAce(pAcl,ACL_REVISION,GENERIC_ALL|STANDARD_RIGHTS_ALL|SPECIFIC_RIGHTS_ALL,ptu->User.Sid))
{
dwError = GetLastError();
goto clearAll;
}
InitializeSecurityDescriptor(&mySecDesc,SECURITY_DESCRIPTOR_REVISION);
SetSecurityDescriptorDacl(&mySecDesc,TRUE,pAcl,FALSE);
SetSecurityDescriptorOwner(&mySecDesc,ptu->User.Sid,FALSE);
SetSecurityDescriptorGroup(&mySecDesc,NULL,FALSE);
SetSecurityDescriptorSacl(&mySecDesc, FALSE,NULL,FALSE);
mySecAttrib.nLength = sizeof(SECURITY_ATTRIBUTES);
mySecAttrib.lpSecurityDescriptor = &mySecDesc;
mySecAttrib.bInheritHandle = TRUE;
CreateDirectory(lpPath, &mySecAttrib);
dwError = GetLastError();
clearAll:
if(ptu) free(ptu);
if(pAcl) free(pAcl);
CloseHandle(hToken);
return dwError;
}
int _tmain(int argc, _TCHAR* argv[])
{
CreateDirWithSecurity ("C:\\TestDir");
FILE *fp;
fp=fopen ("C:\\TestDir\\TestMe.txt","a+");
fclose (fp);
CopyFile ("C:\\TestDir\\TestMe.txt","C:\\TestDir\\TestMe1.txt",true);
return 0;
}
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I have a GUI which uses some of the Registry access functions. What they do is basically read some contents from the windows registry which will be used in the GUI. The problem i face is that, if USER is logged into the machine as ADMIN and then uses the GUI, the GUI is able to read registry contents. But if the USER is logged into machine as restricted USER without ADMIN privilages, then the GUI is not able to read registry contents. I was trying the GUI in DEBUG mode and found that, in restricted USER mode the registry functions are returning a error value (5 or 6). But in ADMIN mode it returns "0" which is the success return value.
Any idea why this problem occurring and any soutions?
Thanks in advance.
|
|
|
|
|
dipuks wrote: have a GUI which uses some of the Registry access functions. What they do is basically read some contents from the windows registry which will be used in the GUI. The problem i face is that,
if you opening registry only for reading, than open reg key with KEY_READ access only, you will not face any problem reading registry key
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
dipuks wrote: But if the USER is logged into machine as restricted USER without ADMIN privilages, then the GUI is not able to read registry contents.
Which indicates you are probably trying to read from the wrong hive. Settings common to all should go in HKLM, while user-specific settings should go in HKU.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello friends,
I am building an MDI application. How do you make the application, main, frame, and any and all views initially displays themselves in their maximized state? Also, how do I make it so that while the user can resize the main application, they can't resize the (child) frames containing a particular view? When I try to modify the create struct (i.e. cs.dwExStyle &= WS_MAXIMIZE) to accomplish that (in every class that has a precreate function), it doesn't work. It seems to launch maximized temporarily, then automatically make it self smaller with out any user prompt.
Any help, as always, would be greatly appreciated.
Sincerely,
BP
|
|
|
|
|
Its may be because, In initinstance, there is call to ShowWindow,comment it, instead add WS_VISIBLE to window style in precreateWindow
Instead you can do this,
Let code in InitInstance be at it is,
In precreatewindow of main frame,add this line,
AfxGetApp()->m_nCmdShow=SW_SHOWMAXIMIZED;
And in child frame precreatewindow this code would be there,
cs.style |=WS_VISIBLE | WS_MAXIMIZE;
|
|
|
|
|
Thank you so much, you answered my question completely.
BP
|
|
|
|
|
Hello
In PPC, I wnat to open a picture viewer in my dialog. I call
pimg.exe and it open the picture viewer in \\My Documents\\My Pictures.
How could I open picture viewer in other path??
Thanks a lot!!
Any suggestion is useful!! Thanks!!
|
|
|
|
|
sdhtyjnniutnbjnhbghb wrote: open the picture viewer in \\My Documents\\My Pictures.
That should be the default path set somewhere in the application.
You can use a file dialog that the user sees on the click of the Browse button. Let the user select the path from the file dialog and then open the image.
See:CFileDialog
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanks a lot.
In PPC picture viewer, it already support a browser list to let user select the path. I want to auto select the path in the picture viewer in different condition. So I want to find a method to do it.
Any suggestion is useful!! Thanks!!
|
|
|
|
|
Can you be more specific.
|
|
|
|
|
Now I design a camera UI in PPC. when I press down the album button, it will go to the picture viewer. If the SD Card inserted, I wish the path in the picture viewer will change from \\My Documents\\My Pictures to \\SD Card. So I must find a method to change the path.
Thanks in advance;).
Any suggestion is useful!! Thanks!!
|
|
|
|
|
sdhtyjnniutnbjnhbghb wrote: I call
pimg.exe and it open the picture viewer in \\My Documents\\My Pictures.
How could I open picture viewer in other path??
Does pimg.exe support command-line arguments?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I search the megneto document.
One topic is as below:
Setting the Default Browse Directory
The command line executable pimg is used to specify the default browse directory. This is done by using the option -directory: followed by the name of the desired default directory:
pimg -directory:<directory_path>
But how can use that when the appilcation is running in O.S.??
Any suggestion is useful!! Thanks!!
|
|
|
|