|
How are you opening the database? I think you need to not load the ODBC cursor library
If using CDatabase::Open() use FALSE for the bUseCursorLib parameter.
If using CDatabase::OpenEx() DON'T use the CDatabase::useCursorLib option in the dwOptions
parameter.
This is because you are using CRecordset::dynaset when opening your record set.
I still have no idea why MoveFirst() is not working correctly...
|
|
|
|
|
Hi,
I have an <name>.exe file. It should be invoked by the user who has admin privilages. How to do that in VC++?
Thanks and Regards,
Venkat
|
|
|
|
|
BOOL IsUserAdmin(VOID)
{
BOOL b;
SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY;
PSID AdministratorsGroup;
b = AllocateAndInitializeSid(
&NtAuthority,
2,
SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_ADMINS,
0, 0, 0, 0, 0, 0,
&AdministratorsGroup);
if(b)
{
if (!CheckTokenMembership( NULL, AdministratorsGroup, &b))
{
b = FALSE;
}
FreeSid(AdministratorsGroup);
}
return(b);
}
From MSDN...
|
|
|
|
|
Are you asking how to verify permissions in code, or how to set the file permissions so that only users in the local/domain administrators group(s) can execute it?
The latter may be done by right-clicking on the file in explorer and configuring the necessary security settings.
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! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Hi James,
I am looking for the first one .. How to verify the permissions of the user who is invoking the exe file
Thanks and Regards,
Venkat.
|
|
|
|
|
You have the function on the 2nd reply. Returns TRUE if the user is local administrator.
|
|
|
|
|
Hi Cristian,
I am checking it out .
Thanks for ur help.
Regards,
Venkat
|
|
|
|
|
1. What is a static class?
2. What is static member?
3. What is static function?
4. What is static constructor?
5. How can we inherit a static variable?
6. How can we inherit a static member?
7. Can we use a static function with a non-static variable?
8. How can we access static variable?
9. Why main function is static?
10. How will you load dynamic assembly? How will create assesblies at run time?
11. What is Reflection?
12. If I have more than one version of one assemblies, then how will I use old version (how/where to specify version number?) in my application?
13. How do you create threading in.NET? What is the namespace for that?
14. What do you mean by Serialize and MarshalByRef?
15. What is the difference between Array and LinkedList?
16. What is Asynchronous call and how it can be implemented using delegates?
17. How to create events for a control? What is custom events? How to create it?
18. If you want to write your own dot net language, what steps you will you take care?
19. Describe the diffeerence between inline and code behind - which is best in a loosely coupled solution?
20. How dot net compiled code will become platform independent?
21. Without modifying source code if we compile again, will it be generated MSIL again?
22. How do you handle this COM components developed in other programming languages in.NET?
23. How CCW (Com Callable Wrapper) and RCW (Runtime Callable Wrappers) works?
24. What are the new thee features of COM+ services, which are not there in COM (MTS)?
25. What are the differences between COM architecture and.NET architecture?
26. Can we copy a COM dll to GAC folder?
27. What is Shared and Repeatable Inheritance?
28. Can you explain what inheritance is and an example of when you might use it?
29. How can you write a class to restrict that only one object of this class can be created (Singleton class)?
30. What are virtual destructures?
31. What is close method? How its different from Finalize and Dispose?
32. What is Boxing and UnBoxing?
33. What is check/uncheck?
34. What is the use of base keyword? Tell me a practical example for base keyword’s usage?
I.Zone@sify.com
|
|
|
|
|
You have a few things working against you here.
1: This is stuff that you can get answered on MSDN.
2: This sounds a lot like a homework assignment.
3: This is .Net stuff and you are asking in the VC++ forum.
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! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Just go and buy a "c++ in 21days" because that is the answer you want.
Artificial Intelligence is no match for Natural Stupidity
No one can understand the truth until he drinks of coffee's frothy goodness. ~Sheik Abd-al-Kadir
I can't always be wrong ... or can I?
|
|
|
|
|
|
Except those are .Net questions...
Unless you are intentionally misdirecting the OP, which is even funnier!
Peace!
-- modified at 7:16 Wednesday 27th December, 2006
Wow! This was a reply to CaveFox... It got moved when the above post was created!
-=- 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! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
ask a stupid question ...
Artificial Intelligence is no match for Natural Stupidity
No one can understand the truth until he drinks of coffee's frothy goodness. ~Sheik Abd-al-Kadir
I can't always be wrong ... or can I?
|
|
|
|
|
People here hate such kind of posting. Always ready to help you out of your problem, but not to do anybodies homework.
You are lucky , you are getting less flames, as lots of CP'ians are on vacation.
|
|
|
|
|
I agree with you people are on vacation, codeproject is privacy
|
|
|
|
|
I think you are new on c++ and I suggest see www.cplusplus.com maybe it some helpful for you
|
|
|
|
|
my application consists of a treecontrol in which i have displayed system files and folders in a tree control similar to the left hand side of Windows Explorer. i am able to copy the folder from the treecontrol and paste it on the explorer where ever we need.Also copy and paste operations are occuring with in the tree control.Now i have added unicode support to my application.The copy to clipboard function is failing.when i copy the folder from explorer i am able to paste it in the treecontrol.But when i tried viceversa i am getting an error message like "the file name you specified is not valid or too long.specify a different file name".how can i make the folder copy from the treecontrol.The code i used is ,
CDropFiles DropFiles;
if(!PrepareFileBuff(DropFiles))
{
return;
}
if (OpenClipboard())
{
BeginWaitCursor();
::EmptyClipboard();
HGLOBAL hMem = ::GlobalAlloc(GMEM_ZEROINIT|GMEM_MOVEABLE|GMEM_DDESHARE, DropFiles.GetBuffSize());
memcpy( (LPTSTR)::GlobalLock(hMem), DropFiles.GetBuffer() ,DropFiles.GetBuffSize() );
::SetClipboardData (CF_HDROP, hMem );
::CloseClipboard();
EndWaitCursor();
}
|
|
|
|
|
radhika28 wrote: memcpy( (LPTSTR)::GlobalLock(hMem), DropFiles.GetBuffer() ,DropFiles.GetBuffSize() );
Try using wmemcpy instead.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
i got the file size.but in win32 how would i convert it into string so i can append 'KB' after the converted string.
e.g.
494 size
then after append 'KB' it should be like 494KB.
thanks
amit
|
|
|
|
|
Use sprintf .
e.g.
char str[200] = {0};
sprintf(str,"%d KB",494);
|
|
|
|
|
that i have tried before send.
i need in the win32(.Net) string variable.
then i will convert it into the wchar and then i put it into the list view
control.
it is char array how can i use it as string ?.
because when i got in the string form.
i can use append function as well as MultiByteToWideChar function.
amit
|
|
|
|
|
amitmistry_petlad wrote: i need in the win32(.Net) string variable.
You have not mentioned this earlier.
amitmistry_petlad wrote: i need in the win32(.Net) string variable
I guess, you are talking about standard library string .
For wide char string swprintf present, too.
amitmistry_petlad wrote: it is char array how can i use it as string ?.
you can use std::string for char array.
i.e.
char arr[] ="some value";
std::string var(arr); and std::wstring for wchar_t array.
I would prefer StrFormatByteSize suggested by James.
|
|
|
|
|
Always adding "KB" is a bad idea - if the size is large, you do not want to write something like 2048KB , you want to write 2MB .
Try the StrFormatByteSize(...) and StrFormatByteSizeEx(...) functions.
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! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Hey cool! I never heard of those APIs!
They must be new to Windows 95, huh?
Thanks James!
|
|
|
|
|
In additional you can use of wsprintf of course StrFormatByteSize is better
|
|
|
|