|
How can I open a web page in the default web browser of my system?
Thanks!
Erik
|
|
|
|
|
Call ShellExecute() and pass it the URL, and use "open" as the verb.
--Mike--
http://home.inreach.com/mdunn/
Time is an illusion; lunchtime doubly so.
|
|
|
|
|
Does anyone have HTML Parser in Visual C++ for reference?
Thank you.
|
|
|
|
|
Vickie
I been looking for a parser myself, I need to parse raw HTML fetched from a Winsock connection.
In the end I wrote my own, but it is specific in the way that it only parses links.
If you get a copy of WebFerret (www.webferret.com) and do a search for "C++ HTML Parser" you'll find some a parser written for Unix, but I'm sure with little effort could be ported over to Win32.
Regards
Norm
|
|
|
|
|
Vickie
I been looking for a parser myself, I need to parse raw HTML fetched from a Winsock connection.
In the end I wrote my own, but it is specific in the way that it only parses links.
If you get a copy of WebFerret (www.webferret.com) and do a search for "C++ HTML Parser" you'll find some a parser written for Unix, but I'm sure with little effort could be ported over to Win32.
Regards
Norm
|
|
|
|
|
In my program, I just want to parse the contents, headings, frames and links. However, followed what you've adviced, I could only find XML parser in C/C++ but none for html. Can you give me more advice or if you can show me some coding?
Thanks!
Regards,
Vickie
|
|
|
|
|
If you don't need to format text, this might not be too difficult.
Hmmm... lets say you can load the whole page into, say, a CString. Work directly with the file stream if you like, but a CString or string might allow less code for a prototype.
Every item you're interested in will start with a '<' character. As you travel through the string Find ing this character, you examine the chars that follow (perhaps using Compare and Left(position, strlen(tag)) (remember to discard initial white space) to see if they match one of the keywords you're interested in (H1, H2, href etc.) and take action. If the chars after the the '<' don't match anything you need, just go back to looking for the next '<'.
This is very much 'context free' parsing, and is something that HTML lends itself well to - writing a browser gets a lot more complicated, but for what you want to do this might be a good start. Probably only 'context' you have to deal with is remembering you have seen a <tag> when you encouner a </tag>
There are certainly some details to work out as to how you store and parse the tags you're looking for, but start small and you'll probably find a reasonably efficient setup. I bet you could do something quite elegant with the STL containers, if that's your cup of tea.
You might also search for some web spider code - there's bound to be some link parsing you can borrow in that type of app.
|
|
|
|
|
Thanks a lot for your detailed advice! I am trying to write the parser now! Hope there is good news few days later!
|
|
|
|
|
Just noticed that Andrew Koenig / Barbera Moo 's article in Januarys CUJ has a routine (p48) for finding URLs in a text string.
Worth a look, if you're interested in an STL solution.
|
|
|
|
|
How can I put a button (bitmap) next to the minimize button on the title bar
|
|
|
|
|
Why would you want that? It's not quite regular behavior to do that. (At least, not at this moment yet).
I think this article may be very useful.
G'luck!
--
Alex Marbus
|
|
|
|
|
Hi:
I want to know is there any way to view (load into the program if possible) if not just is there any viewer for this type of files, so that I can call that application in my program in away or another. I'd appriciate any help.
thank-you
|
|
|
|
|
Hello
does anybody know if it is possible to use a vaiable datatyp in a template header. for instance
template <class vartyp=""> ...
the reason is that i would like to get the name of my varTyp from an external file.
or does anybody has another solution?
greetings
|
|
|
|
|
Hello!
We have a service running under Win2k, and the problem is that we doesn’t know when a user has logged on and the Taskbar on the desktop is created. We need this information to create our System Tray afterwards, so that it will surely appear on the Taskbar.
We have tried to solve this problem by implementing a Notification Packet DLL, which Winlogon.exe loads automatically and calls a registered logon function that was implemented in the DLL. This function will then inform MTS that a user has logged on. There is however, an uncertain span between the time when Winlogon calls this function, and when the taskbar is created on the desktop.
We would like to ask which message or notification our service should subscribe, which will be sent to the service only after the taskbar is created?
Thanks in advance!
Mathias Tunared
Ericsson Enterprise AB
Sweden
|
|
|
|
|
http://support.microsoft.com/support/kb/articles/Q244/6/51.ASP
|
|
|
|
|
Thanx!
Here is another answer to my question:
http://msdn.microsoft.com/library/psdk/shellcc/shell/Shell_Int/Taskbar.htm
|
|
|
|
|
I'm looking for a good method of including Adware ( !Not Spyware )
In a publicly distributed App
Any suggestions on a good method for doing so.
Regardz
Colin Davies
|
|
|
|
|
Hi
I'm wondering since quite some time how do do a really good and fast anti-alias for a very common CView. When I look at Macromedia Flash or Freehand, it looks amazing but how do they do that? Anybody has some code snippets or such?
Daniel
|
|
|
|
|
anti-aliasing is simple in theory:
your drawing algorithm tells you to draw a white (RGB(255,255,255)) pixel at (5.2, 10.4). but because you can't draw pixel at fractional locations, you have to distribute the "white" to the pixels closest to the ideal location.
here's an easy way to do this:
1. pick the four pixels closest to your ideal pixel. if (5.2, 10.4) is your target, choose : (5, 10), (6, 10), (5, 11) , (6, 11)
2. for each of those, find the distance to the ideal pixel (use the simple 2D distance formula d^2 = deltaX^2 + deltaY^2. for the first pixel, the distance is sqrt(0.2^2 + 0.4^2).
3. based on the distance, blend a percentage of the "white" with the color of the current pixel.
4. repeat for every pixel you need to draw.
yes, this will be incredibly slow if you do this with GetPixel and SetPixel.
-c
|
|
|
|
|
Hi
I'm new to ATL Com programming. Recently I found a source code which I need to use, but on compilation there was error C2872: 'ATL' : ambiguous symbol. In the source it refer to the line :-
if (ATL::InlineIsEqualGUID(*arr[i], riid))
Could anyone advise me what really is the problem?
Thank for your time!!!
Cheefarr
|
|
|
|
|
I have a "hello world" situation with a VB COM DLL and an MFC client.
When I switch the VB COM DLL to debug with "wait for component to be created", QI of LPUNKOWN for the default interface returns 0x80004002 (No such interface supported). If I don't run the COM dll in the debugger, everything is fine.
If I use a compiled VB .exe as the client, VB component debugging is supported.
I was told that this is a security related issue, so I went into dcomcnfg and added myself and the interactive user to "Access Permissions" and "Launch Permission" under the Default Security tab. No luck.
Here is the relavent code in the client (hopefully I don't have to start learning about CoInitializeSecurity or get saddled with debugging VB in the VC++ IDE )
CoInitialize(0);
IUnknown* lpUnk;
// this succeeds each time, and hits on Class_Initialize in the debugger
HRESULT hr = CoCreateInstance(__uuidof(WhyDebug::TheObject), NULL, CLSCTX_ALL, IID_IUnknown, (LPVOID *)&lpUnk);
// this fails when the VB component is in "wait for component to be created" state
// and succeeds with the VB debugger switched off.
WhyDebug::_TheObject* pTheObject;
hr = lpUnk->QueryInterface( __uuidof(WhyDebug::_TheObject), (void**)&pTheObject);
|
|
|
|
|
The problem here was I wasn't setting Project Compatibility to Binary. Hence, each time I ran the VB component, a new UUID was being generated for each interface. Duh!
|
|
|
|
|
Help....
How do you force mouse click messages in W95.
MouseEventEx only works under NT is there another way ?
I am creating a small very customized version of a the old W3.1 mouse recorder and this is the point at which I
get stuck...
Thanks in advance
|
|
|
|
|
|
Thanks..
Actually I did look in the help at mouse_event and saw "Windows NT" only then read no further - it refered to MouseEventEx only...
Just goes to show you - read everything carefully...
|
|
|
|