|
Hello,
I am trying to get a point to a client window without status bar and tool bar. How can I do it? Thank you very much
|
|
|
|
|
I have read with interest the article CODBCRecordset for reading data from
an excel spreadsheet.
My problem is that this appears to work intermitenly. I have a spread sheet with formats of general but sometimes it will read in a others times it won't.
If I force the data types of the columns that doesn't appear to work.
Has anybody encountered such a problem before ? Any ideas
Cathy taylor
|
|
|
|
|
Does anyone know how I can find out what NT groups a user belongs to.
Given a domain and account name, I can get the user's SID but I would like to find out (recursively) what groups he belongs to. I need this so that I can walk a DACL to see if he has access to a given file. I would like to use GetEffectiveRightsFromAcl() but it appears to be totally broken (MSDN sez that it fails under NT4 SP4 and SP6; my testing shows that it has problems under W2K as well). My code works fine for user SID's but obviously I need to take into account group memberships as well.
As an aside, I also tried getting a token (via LogonUser()) and calling AccessCheck() which works fine for files that have no security assigned. When I try to assign an ACE (via Explorer), AccessCheck() fails with ERROR_INVALID_SECURITY_DESCR ("The security descriptor structure is invalid").
HANDLE hToken ;
DWORD rc = LogonUser( pUserName , pDomain , pPassword , LOGON32_LOGON_NETWORK , LOGON32_PROVIDER_DEFAULT , &hToken ) ;
assert( rc ) ;
HANDLE hFile = CreateFile( "d:/tmp/junk" , GENERIC_READ , 0 , NULL , OPEN_EXISTING , FILE_ATTRIBUTE_NORMAL , NULL ) ;
assert( hFile != INVALID_HANDLE_VALUE ) ;
SECURITY_DESCRIPTOR* pSD ;
ACL* pACL ;
rc = GetSecurityInfo( hFile , SE_FILE_OBJECT , DACL_SECURITY_INFORMATION , NULL , NULL , &pACL , NULL , (void**)&pSD ) ;
CloseHandle( hFile ) ;
assert( rc == ERROR_SUCCESS ) ;
DWORD desiredAccess = FILE_READ_ATTRIBUTES ;
GENERIC_MAPPING genericMapping ;
PRIVILEGE_SET privilegeSet ;
DWORD privilegeSetLen = sizeof(privilegeSet) ;
DWORD grantedAccess ;
BOOL accessStatus ;
rc = AccessCheck( pSD , hToken , desiredAccess , &genericMapping ,
&privilegeSet , &privilegeSetLen , &grantedAccess , &accessStatus
) ;
assert( rc ) ;
cout << "AccessStatus=" << accessStatus << endl ;
|
|
|
|
|
|
Kinda. They return the group names, not SID's and are a total pain in the ass to work with; you have to everything twice, once for networked groups and once for local and they only work with Unicode strings. I was hoping for some function that I could just call and it would return a list of SID's.
|
|
|
|
|
> Kinda. They return the group names, not SID's
What about GetTokenInformation with TokenGroups as TokenInformationClass?
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Hi All,
I have a problem with disconnected recordsets.I have a component.One if it's function will get the selected Records in a Database.I am passing the Recordset pointer from the server to the Client.I am using disconnected
recordsets for this.
I can see that at the server side I am getting the Recordset
pointer.But, I could not get this pointer on the client side.
the function has the protoype
STDMETHODIMP GetSpecificElements( [out] IUnknown **ppRecordset);
I could get the Recordset pointer at the server side, but could not pass it to client.I am using Client side cursor(adUseClient) and standard
Marshaling.I am using some user defined classes inside this function to Open Database and get the Recordset Pointer .I could get the Recordset Pointer inside these classes , but failed to get
this pointer from this function to client .Does the Disconnected Recordsets vary between ADO and ADOX ?
what could be the problem ?
Thanx in advance for the help.
Regards,
yamini
|
|
|
|
|
Hi!
I need to trap the event that occurs when a checkbox control gains focus.Need to do some validation as soon as this happens.There is no such default event for a checkbox. How do I trap this? Please let me know.
Thanks and Regards,
Leo.
|
|
|
|
|
|
How can I draw on the all the FrameWnd Components like the closebox. I don't mean how to draw the components I mean how to draw on the components.
|
|
|
|
|
|
Hi! I'm trying to write a multi-lingual dictionary program in MFC. It's my first *real* Windows program and I'm sorta stuck on a problem. I was wondering if anyone could tell me how to get a CDocument pointer from inside a dialog class. If anyone could help I'd really appreciate it if you could e-mail me at Taluesin3@juno.com. TIA
Taluesin
|
|
|
|
|
pass it a pointer from the view (or whatever) class before showing the dialog
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Hi,
Is it possible to use a tree control in a dialog to get the following comportment:
when I select an item, the dialog changes his controls a similar way of a Tab control or property page ?
Thanks,
Claude
Claude
|
|
|
|
|
Yes, it's possible. Handle the TVN_SELCHANGED notification and change the contents of the dialog.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
do you have any sample?
Thanks
Vu
vucsuf
|
|
|
|
|
I need to implement text file input and output for a pocket pc application. Embedded VC++ no longer supports ReadString and WriteString function of CStdioFile class. Is there any way to do this?
bo
|
|
|
|
|
Hello,
How do I know when another window (other apps or folders) are being dragged over my client window? I ended up overriding OnErase, so I'm having to catch most of the messages which effect the view. OnActivateView or OnShowWindow don't do this. Is there another message that tells my client that I have to redraw my client? This would apply even if my app isn't in focus and foremost.
Right now, I'm getting ghost images of folders and everything which are getting dragged over my app client window (menus and icons are redrawn automatically though).
Please help if you can.
|
|
|
|
|
I don't think there's some special message - when your client area is invalidated after dragging, the window receives WM_PAINT/WM_ERASEBKGND. Are you sure your handlers are OK?
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Well, the thing was, OnDraw only draws when necessary, and I had no means to detect window movement over the client. Erase won't occur either as I had overriden it. So the end result was the ghoust images of windows being dragged over it. Isn't there a message to detect a child of the client over it? Like when tool bar floating over client, how do I detect that sort of floating window getting dragged around within client?
|
|
|
|
|
Would it help if you put a little code in your OnEraseBkgnd to check if your app has the mouse or focus? If a call to GetCapture, e.g., reveals that the window with the mouse capture is not yours, there's a good chance that the WM_ERASEBKND is one you should act on.
|
|
|
|
|
Hi, everyone.
I have got the problem,the problem is that I made MDI (RichEditView based class) application n i also created a dialog on the MDI, But i am not understanding how can i pass the data from dialog to CRichEditView.However i gave the dialog, base class to the same existing view.Plz explain it to me in detail...
Thanx.
|
|
|
|
|
How do I copy an Icon (I got a handle to HICON) into the clipboard?
Thanks,
Jignesh
|
|
|
|
|
I am working on a project where I would need to remove a file safely (owerwrite the file data with other). How can I access the cluster directly within a MFC program?
|
|
|
|
|
I'm making a couple of assumptions here, so if this isn't what you're looking for provide additional detail...
You can create a CFile, and open it shareExclusive, that will prevent others from working with it or reading it while you have it open.
You can then Seek to a specific location within the file, and write your new data to that spot, then close the file.
Check out the documentation for CFile.
Hope this helps
Jeff
|
|
|
|