Visual C++ :: Extracting Stuff From IHTMLDocument2?
Feb 20, 2013
I got as far as getting a web page into an IHTMLDocument2 but I don't know what to do from there, all the examples I found are C# or .NET or something else I don't understand.
Any simple example in C++ of getting all the links from an IHTMLDocument2 ?
I was able to do this:
Code:
IHTMLElementCollection* collection;
hResult=document->get_links(&collection);
long nLinks;
collection->get_length(&nLinks); // returns correct number
collection->Release();
How do I loop through the collection and extract the actual links ? Also, if they come out as BSTR do I simple treat them as WCHAR* ? If I can do that I can figure out the rest myself.
View 2 Replies
ADVERTISEMENT
Sep 14, 2012
I have a toolbar created in VC++ 6.0 using ATL Project libraries! I need to use IHTMLDocument2 library in my toolbar project can i use it ? if yes then how ?
View 1 Replies
View Related
Apr 26, 2013
I am trying to automatically extract all time stamps in a pdf file. These are typically in a line like:
when="2010-07-30T15:20:30+04:00"
For this I was thinking of using CStdioFile and the ReadString function. Somehow this doesn't work. My example code is below. Is this because pdf is not a true text file, because strings read can be longer than some max,...? Any quick way of reading the file and extracting the desired text between the brackets?
Code:
CStdioFile InputFile;
if (InputFile.Open(FileName,CFile::modeRead)) {
[Code]....
View 14 Replies
View Related
Nov 28, 2012
I am writing a program to play rock paper scissors, and I am trying to get a vector to store the result of a given round of play, and output it as a declaration as to who won. I can't figure out how to store the values in the vector properly, and how to use the vector as an argument to output the result of play.
Code:
#include <iostream>
#include <iomanip>
#include <ctime>
#include <vector>
#include <cstdlib>
#include <string>
using namespace std;
const string name[4] = {" ", "rock", "paper", "scissors"};
const string roundResult[3] = {"computer win", "player win", "tie"};
[Code]....
View 1 Replies
View Related
Jun 5, 2014
void readpatient() {
int count = 0;
f = fopen("patient.txt","r");
while(!feof(f)) {
printf("
%d",count++);
p2=new patient();
[Code] .....
Here is what I've tried. I'm trying to read a file aND print stuff in it, but my while loop isn't ending up.. What should i do? It only prints patient name 1 time and after that it prints nothing.
removing system("pause");
results in an endless loop.
View 2 Replies
View Related
Jan 16, 2012
We are in process to get rid off Roguewave library while moving from AIX to Red hat Linux.
Need to replace RWZone, RWTime stuff with standard gnu implementation on RHL.
View 2 Replies
View Related
Apr 16, 2014
Using cin.sync() works great so far, but my program still breaks if you copy something with multiple lines into the console.
string test = "";
while(true) {
cin.sync();
getline(cin, test );
cout << endl << "test: " << test << endl;
}
However, if you were to copy this:
1
2
3
and paste it into the program, the output would be1
2
3
test: 1
test: 2
And if you press enter one more time:1
2
3
test: 1
test: 2
test: 3
The 3 finally pops out.
View 2 Replies
View Related
Mar 1, 2015
I'm having trouble trying to extra the second row from the array:
Code: double data[10][10] = {{0,5,10,15,20,25,30,35,40,45},{0,13,22,37,54,62,64,100,112,126}};
When I do this, it posts the entire array:
Code: int x,y;
for(x=0;x<2;x++)
{
for(y=0;y<10;y++)
{
printf("%.0lf ",data[1][y]);
}
}
View 5 Replies
View Related
Dec 5, 2014
So, I have a string and I need to extract numbers from it. I've tried different things but they are not working. So, Here is what I have:
int main() {
string myString;
char *strPtr;
cout << "Enter a string to evaluate: " << endl;
getline(cin, myString);
[Code] ....
View 10 Replies
View Related
May 17, 2013
I have a string like this
const char *filename = "C:/Qt/progetti/worlds/fasr.world";
then I have a string like this
char *pathdir = "C:/Qt/progetti/worlds";
I would get this string: "worlds/fasr.world" how should I do ?
View 6 Replies
View Related
Feb 15, 2013
We have an assignment to produce code to gather a string of input from the user in which they are entering a date. We then have to extract parts of that string to make substrings, and display different formats for the date(I will add my code in here so you can see what I have done). It took me a long while plucking away at this to understand this part. You will see that at the end of my code I have opened a file months.txt. We were provided with a file which states months corresponding to dates. I.e. 01January 02February 03March 04April, and so on until December. Exactly how I have typed it is how it is in the file.
I understand how to open and extract what is in the file as a string. I have extracted this as a string called myMonth (as you can see in the code as well) NOW,
I am supposed to have the program search for the month in the file, matching that to the month the user has input earlier, and then use the number infront of that month. I understand the basics of using find(), and making substrings. But how on earth do you get the computer to correlate what the user has input for a month, to finding that in the file, and then using the correct number.
Here is the code I have done so far:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main() {
string myDate; // Date input from user;
string myMonth; // Input from months.txt
[Code] ....
View 1 Replies
View Related
May 16, 2014
Extracting integers from a string is trivial, but I am unable to find a function or code that will extract decimal numbers from a string.
I have a string that looks something like this:
" Asdf 1 1.3825 4.0000 12.0000 1.9133 0.1853 0.9000 1.1359 4.0000 "
Any tips on extracting the numbers (in decimal form) and storing them in a vector?
View 5 Replies
View Related
Nov 30, 2013
I want to extract polynomial coefficient out of a string recieved by input, for example if i enter 4x^3+2x^4+3 , the resulting out put be : 2 , 4 , 0 , 0 , 3
View 10 Replies
View Related
Jun 5, 2014
I have a program here that writes employee information into a text file called employee.txt. I don't have a problem writing into the text file.
I'm supposed to enter the employees ID and search for it. Then pull up all they're info.
This is what I have.
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main(){
ifstream inFile;
ofstream outFile;
[Code] ....
This is the text file
Viktor,Luc,552,123 Home,5000
Joe,Luc,553,123 House,7000
View 7 Replies
View Related
Apr 20, 2015
Create a simple data file like the example shown below containing the 4 dates below plus 10 or more additional dates. The file should include 1 date per line and each date should have the form MonthNumber-DayOfTheMonth-Last2DigitsOfTheYear with no extra spaces. All dates should be in this century. No error checking for invalid dates is necessary.
My Output displays like
February -19,1991
How do I get my program to ignore the dash between the dates?
#include <fstream>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
int main(){
const int M = 13;
[code]....
View 1 Replies
View Related
Sep 25, 2014
So this may be against the rules, not sure, grey area probably? However I just bought the PC game Oil Rush, and was having a look at how the assets are packed. As with most games the textures, scripts, sounds and audio are all free to access.
However the game data such as maps, models and other, are packed into UNG files, i.e a custom encrypted file format, which probably is also compressed. So I googled for an unpacker/extracter and found one which also comes with the C source. You can download here. [URL] ....
So I am trying to figure out how these authors work out this file format, from the source we have,
Code:
static const u8 unigine_mask[] = "xffx7fx3fx1fx0fx07x03x01";
u32 unigine_key = 0xa13cdbde;
Looks like a password of sorts. You then have to work out the complete understanding of the file formats, headers, blocks etc.. How is this done...
View 4 Replies
View Related
Nov 29, 2013
If I have a number 117, represented in binary as : 01110101 and I wanted to grab the top nibble. What would be the decimal value I would be extracting?
Would it be 0111 or 0101 decimal values 112 or 5 or is my understanding completely wrong?
View 11 Replies
View Related
Sep 19, 2013
so i have a loop that will run x number of times and each time it will produce a prize which is a certain sum of money. I need to a way to sum all the money earned. I am thinking there should be a way to extract the prize one for each time the loop runs but i am not sure how to do that.
#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
using namespace std;
int main() {
cout <<"Option A: Drop one chip into one slot" << endl;
[Code] .....
View 2 Replies
View Related
Jun 4, 2013
I have written a C++ program I have multiple of CSV file used as input, which I open one at a time and close it after extracting data to a output file which is the only file.
I run getline(inFile,line);
outFile << line << endl;
I run this code, and only part of it is goes to the output file I got, also have spacing randomly to specific file and inconsistent
But when I slower the code, like system("Pause") in the loop, I can get extract what I want perfectly....
Is my program running to fast, why getline would be skipping part of what things I want?
View 11 Replies
View Related
Aug 2, 2014
I have a text file called (Test.txt) with the following text:
This is line one
This is line two
This is line three
How do I go about writing a program that will print a line of text (e.g. "This in line two" on the console screen?
All I can seem to do is display the entire text file.
View 6 Replies
View Related
May 28, 2014
The project is about reading data from PIC and display the data on the dialogue created by the MFC GUI of Visual studio 2010. There are 4 data need to be displayed (2 weight and 2 angle). the data will be display on the edit control box on the dialogue.
I have try to solve the COMPort and Readdata issues many times, but I'm fail. I have read many sources and implement the source codes... They are never work....
The detail about the issues that I need to solve is clearly mentioned on the main dialogue.cpp. Take a look to an uploaded zip file that I have attached.
View 6 Replies
View Related
Nov 8, 2012
What I'm trying to do is get the selected folder value put into my dirlocation var.
Code:
private void dirLocation_Click(object sender, EventArgs e) {
FolderBrowserDialog fdb = new FolderBrowserDialog();
fdb.Description ="Please choose the directory your .rlt files are located in";
if (fdb.ShowDialog() == System.Windows.Forms.DialogResult.OK) {
dirLocation = fdb.SelectedPath;
}
Is this how you do it? I keep getting an error like Cannot implicitly convert type 'type' to 'type.
View 5 Replies
View Related
Aug 15, 2014
I heard that you can't use it with express, but that doesn't seem right... Can you use it with Codeblocks, at least? I just hate the Qt Creator IDE. I don't like the UI... all I want to do is code Qt. I don't care much for the GUI editors.
View 10 Replies
View Related
Aug 28, 2014
I am trying to create a OCX from a C++ dll., Here's the scenario I have a C++ dll and this dll needs to be called in VB.net program my boss want's me to create an OCX out of this.
C++ dll and use it in a VB.net class library, apparently I have created an OCX but it requires a form but the VB.net program is a class library.
View 5 Replies
View Related
Sep 27, 2012
I don`t known how to convert IP to hex .
In this link [URL] .... . I see hex IP : Hex IP 0x462a1779
I want to convert IP "70.42.23.121" to "0x462a1779"
Code:
#include <winsock.h>
#include <windows.h>
#include <stdio.h>
UINT32 ip_to_hex(UINT32 ip_add) {
UINT32 ip_hex;
//code convert ip to hex
return ip_hex;
[Code[ ....
And this is result : 7b 1e 80 and a , not 0a
Further i think we must separate each octect by a (dot) . , Then convert decimal to hex.
View 6 Replies
View Related
Mar 5, 2013
In a C++ project, I need to call a C# created COM object (as a .dll)
Is there a way to use such a COM object without having it be registered in the registry?
The C# COM dll is just a "go between" our C++ code and a .NET library, there's no "COM contract" of any kind, the COM interfaces change each version. The fact it's COM and needs registration is annoying because it makes it hard to have multiple versions of our software installed (needed under some circumstances) and running at the same time.
I'd like a way to not have any registration at all. And just be able to do a LoadLibrary("c:TheRightPathcom.dll") of the right dll and then get going from there.
View 14 Replies
View Related