|
Success! Thanks wrathgame of GameDev for the nice HTTP GET code and the other modifying HTTP handshake codes.
The program I am working on can now do a search on Google and filter out sites. The only problem I face now is determine when to stop sending GET for addition pages. Google has a limit on the number of pages in a search. For example, if you do a search for "car," I believe Google returns about 800 or so pages. Google sends ten hits per GET command, so you send the GET command 80 times. With programming, I am not sure how to determine the last page Google will send back.
Please post if there is some HTTP code that Google sends back indication that it is the last page for a particular searchkey.
Thanks,
Kuphryn
|
|
|
|
|
i have file tree control.
there are two state image lists.
one is for regular check uncheck image
the other list is only use it only for certain file (item).
so i tried to do so, but it didn't work.
m_TreeCtrl.SetImageList(&m_DupImageList, TVSIL_STATE); // setting images as checkbox
m_TreeCtrl.SetItemState(hItem,INDEXTOSTATEIMAGEMASK(2),TVIS_STATEIMAGEMASK);
m_TreeCtrl.SetImageList(&m_StatusImageList, TVSIL_STATE ); // setting images
as checkbox
do you know why>?
how should i do?
thanks
|
|
|
|
|
Hi All,
I've got a big programming problem.Need Help asap!
I've got two dialogs:
Dialog 1(Students Dialog): Has a List Ctrl Report Style which is supposed to display 3 columns from an access database(Name,Add,Tel).
Dialog 2(Add Student Dialog): Adds a new record into the database and the List Ctrl Displays it.
Then there's the Edit and Delete buttons respectively in dialog 1.
I need to know:
1) How I can display access tables using a list control
2) How I can add a simple record into the list control (or make it look like it)
3) Click on a field on the List Ctrl and (eg. Tom)-> then click EDIT and the EDIT DIALOG appears with Tom's Name and other info ready for editing.
Beginner in need of help.
Thanks so much!!
Mark Shian
Kuala Lumpur, Malaysia
|
|
|
|
|
You have to handle all these thngs yourself.Read each record from database and put them one by one into list control.
There is another list box in VC6 that you can add to your project it is good for your purpose.You can add it from the place you add other activex.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Hi there, what is a good way to run a worker thread as following:
- perform an action every 50-100 ms (variable to configure)
- meanwhile use less CPU power?
- accuracy of the configured time has to be +=100ms (that's fine but not longer!)
TRACE("me worker thread, me good\n");
for(;!bStopThread; )
{
Sleep(0);
}
TRACE("worker thread leaving\n");
|
|
|
|
|
ohhh, a simple Sleep(timeperiod_in_ms) does work! MSDN says Sleep() will suspend the thread. Wow, easy.
Which granularity can I use with Sleep(), which minimum value?
|
|
|
|
|
The argument for Sleep is in milliseconds
|
|
|
|
|
Is there a way that my program can fire an event when ANY application is opened/started.. for example my program customizes other windows, I want to know when these apps are started up so I can restore the customized options (so the user doesn't have to go back and reset all the customized options). Any ideas where I can start?
Thanks,
Rob Jones
|
|
|
|
|
You can use a global hook. Do a search here, there are a few articles on the subject. Here's a link to get you started...
--------
The real problem is that you don't have to be religious to be a religious fanatic,
you just have to be a fanatic. -- Stan Shannon, the lounge
|
|
|
|
|
How do I compare times using CTime. When I retreive a CTime value from the registry and compare it to the current time (using CTime::GetCurrentTime(), it also compares the dates which are several days apart. I need to compare the time part. Is there a way to mask out the date part then check if the current time is > or < the time saved in the registry?
Paul Jahans
|
|
|
|
|
you could create two new CTime objects like this:
CTime t1(1900,1,1,inTime1.GetHour(), inTime1.GetMin(), inTime1.GetSecond());
CTime t2(1900,1,1,inTime2.GetHour(), inTime2.GetMin(), inTime2.GetSecond());
then compare t1 and t2.
(there might be a better way, tho)
-c
Garbage collection, making life better - for weenies!
|
|
|
|
|
This is very simple. I'll use this for now unless I find a more common way. Thanks for you help Chris.
Paul Jahans
|
|
|
|
|
look at CTimeSpan, it might help you
Max
|
|
|
|
|
I've been using CSystemTray by Chris Maunder and it's really a wonderful class and made tray icon related programming very convenient.
However I found one problem, the icon shown on system tray is 16*16, so if the source icon is 32*32 it will be shrunk to 16*16, which obviously produces shape distortion. I thoughy that's not the problem because I could add a 16*16 format into the source icon so that it now has both 32*32 and 16*16 formats, but after I added new format it still uses the 32*32 format and shrinks the icon, it just seems to ignore any format in an icon but 32*32.
Now in order to let it recognize 16*16 format, I must delete(!) the 32*32 format from the source icon, by the way Visual studio 6 resource editor does not provide this feature, I had to use a third part icon editor to delete the format, now the only format remains in the icon is 16*16, and it finally worked.
Is there a way to tell the CSystemTray class to specifically choose a format from a given icon? Usually we will store both format in icon IDR_MAINFRAME, use the 32*32 for application main icon, and 16*16 for system tray displaying, that makes sense. We should not have to use two separate icons.
|
|
|
|
|
Visual Studio 6 can delete a specific "device bitmap" from an icon. Go to resource editor, open your icon and check the menu for something that looks like "Delete device bitmap" (sorry I use the german version dunno what it's named in the US version).
Hope it helps, I use the class and it works for me.
|
|
|
|
|
Great, I found the "delete device bitmap" menu, thanks.
My main problem still remains though, how do you specify an icon format? For example, you have an icon resource IDR_MAINFRAME, which consists of both 32*32 and 16*16 device formats, now how do you tell CSystemTray to "Hey, please display the 16*16 one on system tray!", can you?
|
|
|
|
|
When you load the icon, use LoadImage() and specify the size you want. This will work nicely for icon sizes, but be aware: prior to WinXP, the tray does not display icons with more than 16 colors, even if that's what you explicitly load.
--------
The real problem is that you don't have to be religious to be a religious fanatic,
you just have to be a fanatic. -- Stan Shannon, the lounge
|
|
|
|
|
AFAIK LoadIcon() can't, but LoadImage() can.
Well, I personaly never specify icon size, usually Windows picks the appropriate icon automatically. Hm if you feel problems try to trick a little bit:
SetIcon(AfxGetApp()->LoadIcon(IDR_ICON_DEFAULT), TRUE);
SetIcon(NULL, FALSE);
Do NOT call SetIcon() for the small icon with an icon handle if your big icon provides the small device bitmap too.
Another workaround: feed CSystemTray with an 32x32 icon which is a scaled 16x16 icon (each pixel is build by 4 identical pixel).
Hope it helps.
|
|
|
|
|
I have read the article by Chris Maunder about printing. But I'm having some problems. I would like to print plain text from a large CString. How do I know where to break the page??? I've read some articles about this but everyone is avoiding this bit.
Can someone please help a beginner ??
Regards
Henrik
|
|
|
|
|
HenrikO wrote:
I've read some articles about this but everyone is avoiding this bit.
because that's the hard bit.
you essentially have to measure the page, then measure the string. if the string is too long, break it somewhere (by breaking and measuring in a loop, usually). then print the first part, page break, print the next part (or, as much of it that fits on the page) and so on.
i'm sure someone will correct me if i'm wrong... but that's the way i've always seen it done.
-c
Garbage collection, making life better - for weenies!
|
|
|
|
|
Thanks for your response.
Excuse me for the stupid question's I'm asking, but how to I make a page break
regards
Henrik
|
|
|
|
|
CDC::StartPage and CDC::EndPage control where a page starts and ends. CDC::StartDoc and CDC::EndDoc control the overall document.
-c
Garbage collection, making life better - for weenies!
|
|
|
|
|
Thank You I Think this will help me alot!!!!
Best Regards
Henrik
|
|
|
|
|
I just posted an article about this. You can find it in the printing section.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
i want to call the main window of my sdi from a custom dialoge .. is there any way for doing it..
secondly i want to make a check such that every time when i run my software it could check the values in the database .if the data base is all empty it should call the secondary dlg first with displaying the main dlg. and if the data base has some entries then the main dlg should be called.
thanks for ure help
looking forward from all the gurus of code
|
|
|
|