|
The word "get" is ambiguous here. Do you want to read text from the screen, or write text to the screen?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I want to read text from anywhere on screen.
|
|
|
|
|
That will require use of the IAccessible interface, specifically the get_accValue() method.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hello,
Could anyone tell me how to cope with this error message.
the start of my code goes like
#pragma once<br />
<br />
using namespace std;
...
I get the errormessage that the namespace does not exist, and msdn provide little information about this error message.
error C2871: ´std´:a namespace with this name does not exist
Sorry if I provide to little code or further descriptions...
But maybe somebody has a tips
best regards
doneirik
|
|
|
|
|
That should compile OK on any machine. Exactly on what line did you get the error message? Maybe where the error is generated your code is at a different scope not within that of your "using" declaration? Maybe where the error is generated the header file with your "using" declaration is not included?
|
|
|
|
|
this can come from the files you really include.
for example :
#include <string.h> this will include all the C standard function to manipulate C-string (strcat(), strlen(), etc...) in the global namespace : ::strcat(), ::strlen(),...
#include <CSTRING> this will put the functions in the std namespace : std::strcat(), std::strlen(), ...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
doneirik wrote:
Could anyone tell me how to cope with this error message.
the start of my code goes like
#pragma once
using namespace std;
...
I get the errormessage that the namespace does not exist, and msdn provide little information about this error message.
error C2871: ´std´:a namespace with this name does not exist
You probably should include a file with code in namespace std before 'using' namespace std, e.g.
#include <vector>
using namespace std;
|
|
|
|
|
hai ..
can anybody help me in my problem?My problem is to maintain constant size to one text file.eg 500kb then if i add any thing it will not show that text files size increasing.please help me.
regards
shaanu
shan
|
|
|
|
|
How about (temporarily) using a copy of the text file instead and add to that?
|
|
|
|
|
I am storing 32 bit keys.so i want to store some more keys.but the size of text file should be constat.i want to limit its size by some 500 kb like that.so what should i do for make constant size of text file in vc++?
shan
|
|
|
|
|
what about overwriting the file content ???
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
If you add to a file, it's going to increase in size. There is no way around this. This is a very odd requirement.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
hi all,
I want to draw 3D object like a ball using GDI+ Graphics,Brushes..Can any body Guide me to do it?
Thanks in advance..
|
|
|
|
|
dear sir.
i am an MSc studient, I need some informations about my project which its titled "image compression using multiwavelet transform" (source code program to do it)in visual C++
with my regards
|
|
|
|
|
Do you know of any such api or function which enlists applications?
eg, Internet explorer,Word,Power point etc.
Also do you know of any api which enlists the the hardware devices like
mouse,keyboard,NIC etc
Please tell about these apis and their header files
Thanks a lot
|
|
|
|
|
brilliant101 wrote:
Do you know of any such api or function which enlists applications?
eg, Internet explorer,Word,Power point etc.
To get a list of running processes, use Process32First() and Process32Next() .
brilliant101 wrote:
Also do you know of any api which enlists the the hardware devices like
mouse,keyboard,NIC etc
Please tell about these apis and their header files
This is exactly what SetupDiEnumDeviceInfo() and SetupDiEnumDeviceInterfaces() are for.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi,
I develop a multi langugage support GUI screen in SDK, The appropriate language font doesn't displayed in dialog control, i done the settings in windows XP. But it doesn't displayed.
plz write your suggestion.
Regards,
Inbha.
|
|
|
|
|
Hi,
I'm trying to construct a library which features a class that should be able take a pointer to any user-defined function (preferably in a user-friendly way). Now, I've tried a templated approach which seems to work, but inheriting from template classes seems rather a pain and dito for all the different function pointer types. Small example:
<br />
#pragma once<br />
<br />
template < typename _TReturn, typename _TArg><br />
class IExecute<br />
{<br />
public:<br />
typedef typename _TReturn _return_type;
typedef typename _TArg _arg_type;
typedef void _class_type;
<br />
virtual ~IExecute(void) = 0;<br />
<br />
virtual _TReturn Execute(_TArg _Arg) = 0;
};<br />
<br />
template < typename _TReturn, typename _TArg><br />
inline IExecute< _TReturn, _TArg >::~IExecute(void)<br />
{ }<br />
<br />
template < typename _TClass, typename _TReturn = unsigned int, typename _TArg = void * ><br />
class CExecuteMember : public IExecute < _TReturn, _TArg ><br />
{<br />
protected:<br />
typedef _return_type (_TClass::*_ptr_type)(_arg_type);
typedef typename _TClass _class_type;
<br />
_class_type * m_lpClass;
_ptr_type m_lpRoutine;
<br />
public:<br />
CExecuteMember(void) : m_lpClass(NULL), m_lpRoutine(NULL)<br />
{ }<br />
CExecuteMember(_class_type * _Class, _ptr_type _Routine) : m_lpClass(_Class), m_lpRoutine(_Routine)<br />
{ }<br />
~CExecuteMember(void)<br />
{ }<br />
<br />
_return_type Execute(_arg_type _Arg)
{<br />
if (this->m_lpRoutine == NULL)<br />
throw std::runtime_error("No routine pointer exists");<br />
if (this->m_lpClass == NULL)<br />
throw std::runtime_error("No class pointer exists");<br />
return (m_lpClass->*m_lpRoutine)(_Arg);<br />
}<br />
<br />
inline _ptr_type GetRoutinePtr(void) const { return this->m_lpRoutine; }<br />
inline _class_type * GetClassPtr(void) const { return this->m_lpClass; }<br />
inline void SetRoutinePtr(_ptr_type _Routine) { this->m_lpRoutine = _Routine; }<br />
inline void SetClassPtr(_class_type * _Class) { this->m_lpClass = _Class; }<br />
};<br />
<br />
template < typename _TReturn = unsigned int, typename _TArg = void * ><br />
class CExecuteNonMember : public IExecute < _TReturn, _TArg ><br />
{<br />
protected:<br />
typedef _return_type (* _ptr_type)(_arg_type);
<br />
_ptr_type m_lpRoutine;
<br />
public:<br />
CExecuteNonMember(void) : m_lpRoutine(NULL)<br />
{ }<br />
CExecuteNonMember(_ptr_type _Routine) : m_lpRoutine(_Routine)<br />
{ }<br />
~CExecuteNonMember(void)<br />
{ }<br />
<br />
_return_type Execute(_arg_type _Arg)
{<br />
if (this->m_lpRoutine == NULL)<br />
throw std::runtime_error("No routine pointer exists");<br />
return this->m_lpRoutine(_Arg);<br />
}<br />
<br />
inline _ptr_type GetRoutinePtr(void) const { return this->m_lpRoutine; }<br />
inline void SetRoutinePtr(_ptr_type _Routine) { this->m_lpRoutine = _Routine; }<br />
};<br />
And then I tried an approach with functionoids (here[^]" rel="nofollow">) but that would require users to pretty much always encapsulate the target functions in a class derived from a functionoid interface. Small example:
<br />
#pragma once<br />
<br />
class IFunctionoid
{<br />
public:<br />
virtual ~IFunctionoid(void) = 0;<br />
virtual unsigned int operator()(void * lpArg) = 0;
};<br />
<br />
inline IFunctionoid::~IFunctionoid(void) { }<br />
<br />
typedef IFunctionoid * LPFUNCTIONOID;<br />
<br />
Anyone have any alternative solutions or improvements on the above? Please?
|
|
|
|
|
Anyone could please tell me,
How to convert from DIB to BITMAP?
How to convert from BITMAP to JPEG?
How to convert from DIB to JPEG?
|
|
|
|
|
|
HI,
In my project, I need to logon programmatically on the local machine.
I am using "LogonUser()" api. The calling process must have SE_TCB_NAME privilege enabled. I dont how to get that privilege.
For that I have written following code.
//Start
if(!OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hCurrentToken))
printf("\n\nError Code for OpenProcessToken : %u",GetLastError());
else
printf("\nToken obtained");
if(LookupPrivilegeValue(NULL, SE_TCB_NAME,
&tkp1.Privileges[0].Luid))
printf("\nLookup Privilege value TCB returned true");
if(LookupPrivilegeValue(NULL, SE_CHANGE_NOTIFY_NAME,
&tkp2.Privileges[0].Luid))
printf("\nLookup Privilege value CHANGE returned true"); ;
tkp1.PrivilegeCount = 1;
tkp2.PrivilegeCount = 1;
tkp1.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
tkp2.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
if(!AdjustTokenPrivileges(hCurrentToken, FALSE, &tkp1, 0,
(PTOKEN_PRIVILEGES)NULL, 0))
printf("\nCan't set privileges required in tkp1");
dwErr = GetLastError();
if((dwErr != ERROR_SUCCESS))
printf("Error code for tkp1 : %u",dwErr);
if(!AdjustTokenPrivileges(hCurrentToken, FALSE, &tkp2, 0,
(PTOKEN_PRIVILEGES)NULL, 0))
printf("\nCan't set privileges required in tkp2");
dwErr = GetLastError();
if(dwErr != ERROR_SUCCESS)
printf("\nCan't set privileges required in tkp2");
strcpy(pchUserName,"user1");
strcpy(pchPasswd,"user1");
strcpy(pchDomain,"MYDOMAIN");
if(!LogonUser(pchUserName,pchDomain,pchPasswd,LOGON32_LOGON_INTERACTIVE
,LOGON32_PROVIDER_DEFAULT,&hToken))
printf("\nLogon failed :\n\n ");
//End
Output :
Token obtained
Lookup Privilege value TCB returned true
Lookup Privilege value CHANGE returned true
Error code for tkp1 : 1300
Logon failed :
**************************************************
Please help. How to set SE_TCB_NAME privilege and how to programmatically login on to the local computer.
bhavesh
|
|
|
|
|
ace_maggot wrote:
if(!AdjustTokenPrivileges(hCurrentToken, FALSE, &tkp1, 0,
(PTOKEN_PRIVILEGES)NULL, 0))
printf("\nCan't set privileges required in tkp1");
dwErr = GetLastError();
if((dwErr != ERROR_SUCCESS))
printf("Error code for tkp1 : %u",dwErr);
Since GetLastError() returns a DWORD , use %lu to ensure proper results:
if (! AdjustTokenPrivileges(hCurrentToken, FALSE, &tkp1, 0, (PTOKEN_PRIVILEGES) NULL, 0))
printf("\nCan't set privileges required in tkp1. Error = %lu\n", GetLastError()); This has no bearing on the problem, however.
Does this help:
OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hCurrentToken);
LUID luidName;
LookupPrivilegeValue("", SE_TCB_NAME, &luidName);
TOKEN_PRIVILEGES tokenName;
tokenName.PrivilegeCount = 1;
tokenName.Privileges[0].Luid = luidName;
tokenName.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
AdjustTokenPrivileges(hCurrentToken, FALSE, &tokenName, 0, NULL, 0);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi,
Using VS.NET 2003, I am trying to write files (without using the Serialize class method) with CString variables and trying to read the data back into the Edit Control boxes with the same CString variables. I can write the files from the CString variables and read the files' data to CString variable. But I cannot get the data to the Edit controls (multiple controls' data in one CString record) without type def errors.
Any suggestions, advice, directions, would greatly be appreciated.
|
|
|
|
|
i'm not sure i understand well.
what functions so you use ? SetWindowText() and GetWindowText() are the one to use to transfer datas between controls and CString.
moreover, you should be careful on printing a CString into a CEdit control. first, it must be using the multi-line option. secondly, each '\n' on the CString must be replaced by "\r\n" in the CEdit otherwise you won't see any new lines in the edit control...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
You hit the nail on the head!!
However, not all of my Edit control variables are of the CString type: I have some Edit variables of INT type. Initially, I have used the MFC DDX/DDV methods to swap data from the dialog to variables and back. But, after retrieving data from a file, I still cannot get the data into the INT Edit variables though I can load data into the CString Edit variables better using the methods provided and the ReadString method of CStdioFile.
Any suggestions, directions, help on loading the INT Edit variables? And, THANK YOU for the prior methods, which worked like a charm for the CString Edit variables!!;)
WohooWahoo
|
|
|
|
|