|
error is::error C2668: 'pow' : ambiguous call to overloaded function
and i m using Visual c++ 2005 .
|
|
|
|
|
Yeah those are because most like arguments of pow are not compatible. Check if is code like this
double x = 10;
pow(5, x);
In this case change it to
pow(5.0, x).
And just FYI when you get a warning or error in VC++ you can look for it in MSDN in detail and ways to fix it. Easiest way to do this is click on the error or warning number in the Output Window and press F1.
-Saurabh
|
|
|
|
|
|
i m check this code they r using ActiveX control for table,but i using simple List control.
so this example is nat make me clear,please tell sumthing else.
thanks for help.
|
|
|
|
|
Try also the SQL/ADO/ADO.NET forum [^].
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
|
|
|
|
|
So have you already created the database using Access itself, or are you wanting to do that via code?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
no i have no idea about this please tell me any thing which helps me.
|
|
|
|
|
ThatsMe. wrote: no i have no idea about this
How can you not know if you've already used Access to create the database or if you are wanting to do it via code?
ThatsMe. wrote: please tell me any thing which helps me.
How can I possibly know what information to provide you when you are having difficulties answering my questions?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
You can see a lot articles about Databse(and Access) on the codeproject,did you seee that section?
|
|
|
|
|
Hi,
How do you make assembly wrappers for a GNU compiler? I am confused as to how to make an assembly wrapper/macro. Upon my searches/readings, I think that there is no standard way to do it, and that it depends on your compiler/assembler.
My problem is that I have a few lines of assembly code that I keep using for several functions.. in C/C++, you would just make macros for those lines of code. How do you do that for assembly? Any pertinent feedback would be appreciated. Thanks, let me know.
Luis_the_Code
|
|
|
|
|
Yes,we can use Macro in C/C++. It seems that you know ASM,if so,there is Macro syntax,too.
And if you have a few ASM lines would be used for several function,if in C/C++,I want to say,you can use Macro too,using it like this
#define ASM_MACRO __asm{ \ //for multiline Macro
... \ //there are some asm code lines
}
I wish it will help to you.
Regards.
|
|
|
|
|
I'm investigating garbage collection methodologies for C++.
I've been reading about smart pointers, and they seem to make sense, except for this one point that I cannot understand:
In the case of a container object, such as a hash table or even just an array of smart pointers, how do the pointers know that they are still "alive" once they are put into the container?
Thanks if someone can help me understand how that works.
“Cannot find REALITY.SYS...Universe Halted.”
~ God on phone with Microsoft Customer Support
|
|
|
|
|
Independent123 wrote: how do the pointers know that they are still "alive" once they are put into the container?
The objects exist until they go out of scope, at which time their destructors are called.
mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: The objects exist until they go out of scope
That I understand, but, for instance, a member variable in a class instance doesn't really have a scope, does it?
It exists as long as the class instance exists, even though it's not actively being used in any expressions.
“Cannot find REALITY.SYS...Universe Halted.”
~ God on phone with Microsoft Customer Support
|
|
|
|
|
It is basically the Object lifetime not the scope, when the smart pointer get destroyed the objected it points to is also get destroyed. Scope can lead to end of object lifetime for example when a control leaves a block the local varable gets destroyed. smart pointer in a container class has lifetime as that of container class, it exists as long as class instance exists.
|
|
|
|
|
You have to be more specific on the type of smart pointer you are talking about. 'Smart pointer' is a generic label that is used to describe a number of techniques.
In the context of GC you are likely talking about reference counting.
In this case maintaining a smart pointer in the container ensures that the objects reference counts stays above 0.
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
|
Hi buddy!
How can I get an unique ID for each computer, so that it doesn't change after installing a new OS.
Thanks...
|
|
|
|
|
Microsoft has invested millions of dollars into developing such technology.
Their activation system takes a snapshot of all the hardware in the machine and produces a hash of many different parameters.
It isn't a simple answer.
“Cannot find REALITY.SYS...Universe Halted.”
~ God on phone with Microsoft Customer Support
|
|
|
|
|
Hello,
I am programming in MS VS c++.
In my application I want to get the information: Is my software is running "as administrator" or not.
On Windows Vista an administrator can be logged in, but it could be, that the application (my software) is not running "as administrator".
If the user starts a software "as administrator" so he has an other access to files, like ini- or txt-files.
Background of my question:
--------------------------
My software application is installed in the folder "c:\Program Files\myapplication\myApp.exe"
In this folder I store some configurations in the file "myconfig.ini".
If I want to change some entries in the ini-File (with myApp.exe), so under Windows Vista the changed file will be saved in the following folder:
C:\Users\...\AppData\Local\VirtualStore\Program Files\myapplication\myconfig.ini
But if the software "myApp.exe" is running "as administrator", so the changed ini-file will be stored in the original folder "c:\Program Files\myapplication\myconfig.ini".
So how I can to get the information (during run time): is myApp.exe is running as administartor or not? I need this information, because I want inform the user that the changed confiuration file will not be stored in the original installed folder, but in an another virtualstore-folder, if the software is not running as administartor.
Does somebody has a solution for this problem?
|
|
|
|
|
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);
}
Best Wishes,
-Randor
|
|
|
|
|
Thanks for your help.
I have insert "IsUserAdmin(void)", but I get the error: C2065: 'CheckTokenMembership' : undeclared identifier
I have found an other way to check the administrator status:
int IsAdminRunning(void)<br />
{<br />
bool IsMember = FALSE;<br />
ATL::CAccessToken ProcToken;<br />
ATL::CAccessToken ImpersonationToken;<br />
ATL::CSid UserSid(Sids::Admins());<br />
<br />
ProcToken.GetEffectiveToken(TOKEN_READ | TOKEN_DUPLICATE);<br />
ProcToken.CreateImpersonationToken(&ImpersonationToken);<br />
ImpersonationToken.CheckTokenMembership(UserSid, &IsMember);<br />
<br />
return IsMember;<br />
}<br />
But here I have the problem to use the ATL-Control.
If I insert a new ATL-Object in my project, so how I can use the CAccessToken and CSid?
|
|
|
|
|
Simon1 wrote: I have insert "IsUserAdmin(void)", but I get the error: C2065: 'CheckTokenMembership' : undeclared identifier
The sample code Randor given is here,
CheckTokenMembership[^]
Have you included "windows.h"
IsUserAnAdmin()[^] API is available, the link as hint that this API might be altered or unavailable in subsequent versions of Microsoft Windows.
modified on Monday, March 31, 2008 1:58 AM
|
|
|
|
|
|
Look in the 'Remarks' section:
This function is a wrapper for CheckTokenMembership. It is recommended to call that function directly to determine Administrator group status rather than calling IsUserAnAdmin.
Best Wishes,
-David Delaune
|
|
|
|