|
I want to access any windows input elements from a win32 or mfc program.
i want to open browser from a win32 program and want to manipulate the contents...
it is like accessing html dom using javascript. i want to do it in windows.
this is my idea and i want to know which of the concepts does this work either in win32 or in mfc?
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
I presume you're talking about accessing the HTML UI elements in a page displayed in your own Window.
I remember looking at this briefly sometime back and unfortunately couldn't find any easy to use classes to achieve this (I was under severe time constraints to go about writing one of my own). Note that both MFC and WTL do provide a wrapper for you to host HTML pages within a window. And the MS-HTML renderer provides COM connection points into which can hook for receiving events. These events do include events generated by the UI elements in the page. There's an article in CP that provides a basic wrapper to trap these events but I can't seem to locate it.
Also, looks like there's an ActiveX wrapper for Mozilla, which means you can use Gecko as the renderer to display you HTML UI.
Link below discusses this:
http://nick.typepad.com/blog/2003/11/feeddemon_and_m.html[^]
Hope this helps. Good luck.
Hari
|
|
|
|
|
You are a little right but i want to access any windows controls. for example i can open (spawn) another application from my program and i want to access all of its UI controls like what we do in html.
anyway thanks for the reply i want that for another work and i have to try it.
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
Hello All,
In "ListCtrl" i need to set the focus of the Key Up&Down events,how can i set,please some one help me.
With kind regards,
Bhanu
|
|
|
|
|
Until the control has focus, the up/down keys are meaningless. After the control has focus, the up/down keys change the selection within the control; it does not lose focus.
So, what exactly is the problem?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi Friends,
I am now trying to learn C++ data structure.
Can you guys suggest me some good programs so that I can try that out.
Till now I have tried the program's like a dictionary with spell check(using Binary search tree),
program to parse a file , create data structure and do some processing on that.......etc...
please suggest me some questions like this...
If the questions includes use of DS such as tree/LinkedList/graph etc.... then it will be very good....
Thanks in Advance...
|
|
|
|
|
pavarathyRock wrote: I am now trying to learn C++ data structure.
Can you guys suggest me some good programs so that I can try that out.
My favorite was always an RPN calculator.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi Thanks for suggession,
I have started on that.
till now I have done this much for infix notation.
The algorithm I have tried is "Shunting-yard algorithm".
This program is having some problems, that I need to fix......
and you experts can give suggession in good coding practices also....
#include<iostream>
using namespace std;
const int maxExpressionLength = 100;
class stack
{
char data[maxExpressionLength];
int top;
public:
stack();
bool push(char input);
bool pop(char & output);
void print();
};
#include "program.h"
#include "ctype.h"
stack::stack()
{
memset(data, 0, sizeof(data));
top = -1;
}
bool stack::push(char input)
{
if (top >= maxExpressionLength - 1)
{
cout<<"Error : expression size is more than supported\n";
return false;
}
top++;
data[top] = input;
return true;
}
bool stack::pop(char &output)
{
if (top <= -1)
{
return false;
}
output = data[top--];
return true;
}
void stack::print()
{
if (top == -1)
{
return;
}
for (int i = 0; i <= top; i++)
{
cout<<data[i]<<" ";
}
}
int strilen(int maxLength, char * string_data)
{
if (NULL == string_data)
{
return 0;
}
for (int i = 0; i < maxLength; i++)
{
if (string_data[i] == 0)
{
return i;
}
}
return maxLength;
}
bool isValidOperator(char oper)
{
if ((oper == '^') || (oper == '*') || (oper == '/') || (oper == '+') || (oper == '-') || (oper == '(') || (oper == ')'))
{
return true;
}
else
{
return false;
}
}
int presedence(char op1)
{
if (op1 == '^')
{
return 5;
}
else if ((op1 == '*') || (op1 == '/'))
{
return 4;
}
else if ((op1 == '+') || (op1 == '-'))
{
return 3;
}
else
{
return 0;
}
}
int main()
{
char expression[maxExpressionLength + 1] = {0};
cout<<"Enter the expression\n";
cin>>expression;
if (maxExpressionLength < strilen(maxExpressionLength + 1, expression))
{
cout<<"Error : The size of expression is more than supported["<<__LINE__<<"]\n";
getchar();
getchar();
return -1;
}
stack obj;
char rpnOut[maxExpressionLength + 1] = {0};
int expressionCounter = 0;
char c = expression[0];
int counter = 0;
while (c != 0)
{
if (isdigit(c))
{
rpnOut[expressionCounter++] = c;
}
else
{
if (false == isValidOperator(c))
{
cout<<"Error : input expression is not correct. problem with "<<c<<" please check the input["<<__LINE__<<"]\n";
getchar();
return -1;
}
else if (c == '(')
{
obj.push(c);
c = expression[++counter];
continue;
}
else if (c != ')')
{
char oper = 0;
while (true == obj.pop(oper))
{
if (presedence(oper) > presedence(c))
{
rpnOut[expressionCounter++] = oper;
}
else if (presedence(oper) == presedence(c))
{
rpnOut[expressionCounter++] = oper;
break;
}
else
{
obj.push(oper);
break;
}
}
obj.push(c);
}
else if (c == ')')
{
char oper = 0;
while (oper != '(')
{
if (false == obj.pop(oper))
{
cout<<"Error while parsing the input expression. please check input["<<__LINE__<<"]\n";
getchar();
getchar();
return -1;
}
if (oper != '(')
{
rpnOut[expressionCounter++] = oper;
}
}
}
else
{
obj.push(c);
}
}
c = expression[++counter];
}
char oper = 0;
while (false != obj.pop(oper))
{
rpnOut[expressionCounter++] = oper;
}
cout<<"The expression in RPN = "<<rpnOut<<endl;
getchar();
getchar();
getchar();
getchar();
return 0;
}
|
|
|
|
|
Some suggestions:
create a fast XML-parser, with low memory usage
create a program that writes MIDI-files (you will tear your hair out)
Show the waveform of a wavefile
Create a program that parses an EML-file, including attachments
Create a simple interpreter. for example. one that can execute batch-files
Write a C-compiler
Create a RTF-editor
Satisfied?
Rozis
|
|
|
|
|
Yes satisfied, may be this is tooooo advanced for me.
but I am gonna try it out.....
may be i can create an XML parser with high memory usage, then I can optimise it.....
and other programs.....okey i will try.
|
|
|
|
|
stdlib.h defines EXIT_FAILURE as 0 and EXIT_SUCCESS as 1... though convention is that these two are usually used the other way around - I'm just wondering why stdlib defines them like this... is convention wrong?
|
|
|
|
|
In both SDKs of Visual Studio 2008 and 2010 (also Window 7 RC SDK)
it's defined as
#define EXIT_SUCCESS 0
#define EXIT_FAILURE 1
How it differs in your SDK headers?
-Sarath.
Rate the answers and close your posts if it's answered
|
|
|
|
|
On my Mac, both gcc (Mac OS X, gcc-4.0.1) and VC++(Windows 7/VMWare Fusion, VC++ 9.0) define EXIT_SUCCESS as 0, EXIT_FAILURE as 1...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hmm, I recall it being defined the other way around...
The reason I thought this is because I was returning EXIT_FAILURE / EXIT_SUCCESS from a function, but checking the result against TRUE / FALSE.
EXIT_FAILURE would always be considered true, and EXIT_SUCCESS considered false... I should have checked the actual definitions...
|
|
|
|
|
Hi,
I am supposed to develop an application(yet to be done)which continuosly monitor the Application log in Windows 2003 and Windows 2008 servers (both seperately).
When ever an event is logged in the Application log corresponding event source, id and description is obtained and displayed in to the screen.
I have refferred MSDN and found that the notifyChangeEventLog() method will do this.
I have tried out a sample and was able to get event id alone, but not event source and event description.
Can some one please tell me how to obtain event description and source using c++ program.
Also please suggest me the best solution to develop this application.
Thanks in Advance
ARD
|
|
|
|
|
HI,
i have a TabCtrl which is created using Create function(using control variable) but not using resource...
Now how can i increase the font inside the TabCtrl
|
|
|
|
|
hello,
I want to read .csv files but the following code read many lines more than required.
std::ifstream DataStream(FileToRead);
istreambuf_iterator<char> iter(DataStream.rdbuf());
istreambuf_iterator<char> end_of_stream_iterator;
int NOOFCHAR =10;
char temp[255];
CString h ;
int ct =0;
while(!iter.equal(end_of_stream_iterator) )
{
vector<CString>v;
for(int i=0;i<FileObj.NumCols;i++)
{
DataStream.get(temp,NOOFCHAR,',');
DataStream.ignore(1,',');
h = temp;
v.push_back(h);
}
ct++;
DataStream.get(temp,NOOFCHAR,'\n');
iter++;
}
In the above code I should ct = 2331 but I get the valu of ct = 198520
what must be wrong . and why the program doesnt end at line no 2331
Pritha
|
|
|
|
|
prithaa wrote: and why the program doesnt end at line no 2331
Where are you telling it to end at line 2331?
Have you used the debugger to step through the code to see if you agree with what it is considering a line?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
why it's necessary to create iterator for a file buffer? you don't need to deal with internal buffer of a file. You can simply use other stream, string classes to get your task done. Just see a sample code below. it's plain and clear no? (Sorry it's not written myself. taken from some forums)
#include <iostream>
#include <iostream>
#include <sstream>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
int main ()
{
ifstream inFile ("csv.dat");
string line;
int linenum = 0;
while (getline (inFile, line))
{
linenum++;
cout << "\nLine #" << linenum << ":" << endl;
istringstream linestream(line);
string item;
int itemnum = 0;
while (getline (linestream, item, ','))
{
itemnum++;
cout << "Item #" << itemnum << ": " << item << endl;
}
}
return 0;
}
-Sarath.
Rate the answers and close your posts if it's answered
|
|
|
|
|
thank you
for your replies
|
|
|
|
|
Hi All,
I have a com dll which i want to use without registering it so is it possible? i tried it this way but while trying to call its functions i am not getting its reference....
Thanks A Ton
Ash_VCPP
walking over water is just knowing where the stones are.....
|
|
|
|
|
Check this![^]
-Sarath.
Rate the answers and close your posts if it's answered
|
|
|
|
|
hi,
i read all the menifest stuff required...so there is no other way accept suggested one to do the thing...
Thanks A Ton
Ash_VCPP
walking over water is just knowing where the stones are.....
|
|
|
|
|
Hai All,
I have a shared folder in WAN(windows server 2003) and I have to access that folder through programming by hard coding the credentials(from windowsXP).
Regards
ranjith
|
|
|
|
|
The suspense is killing me. What's the question?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|