|
SHFileOperation() is the one you are looking for!
It does have the progress window if you want to use.
It does do copy recursive sub-directories.
This does copy/rename/delete too...;) all in one package
I dont think this is the fastest way but application level safest way as its a high level api.
Thanks,
Ramu
|
|
|
|
|
1. What do i have to set the bmWidthBytes property to? MSDN says to set it to the number of bytes in each scan line, what is a scan line?
2. What do i have to set the bmPlanes property to? MSDN says "Specifies the count of color planes." what are color planes?
3. To create a valid bitmap picture, do i just save the entire BITMAP sctruct to the harddrive or is there another function that i should use?
Thanks in advance.
|
|
|
|
|
a scan line corresponds to the width of the screen, bmWidthBytes is the number of bytes required to represent on horizontal line of pixels.
the bmPlanes property refers to the number of color planes used by the device. Some printers require that the information for a scan line be sent one color at a time. e.g. send the red value of all the pixels, then send the blue values then the greens. In most cases set it to 1.
|
|
|
|
|
Thankyou. How do i then create a valid bitmap picture that can be opened in any picture viewer? Do i just use WriteFile? If so, how do i use it? What should i pass as the parameter that should be written and how many bytes shoul di write?
Thanks
|
|
|
|
|
If you have a BITMAPINFO structure, then you can write it out to disk, using IOStreams or Microsoft specific methods.
GDI+ will do this for you, for bmp/jpg/gif/I forget the others.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
I have created an MFC ActiveX control, in Visual C++ 6.0, that dynamically creates another ActiveX control at runtime. (I did this to create a high-level ActiveX control that wraps a low-level 3rd party ocx). The dynamically created ActiveX control has events that it fires, but I do not know how to handle these events?
Is there a way to pass the name of an event handler to the create() method and handle events this way? Do I have to use an event sink? Or reflection?
Any help, or code exmples, would be greatly appreciated...
Dave Janu
Dave Janu
Software Projects Manager
UEMSI
w137 n5560 Williams Place
Menomonee Falls, WI 53051
|
|
|
|
|
I had the same problem, I never did get it to work. You need to establish connection points in your code to correspond to the events in the 3rs party control. You then attach your connection points to the control by notifying it of their location. It kind of works like a reverse method call.
The wizards do this for you if you use them to create the control. When you have a dynamic control you have to do it yourself. Look at the Type library handling routines for a start.
I never saw a sample of this done dynamically. (I looked for a month.) I found hudreds of examples of connection points, but all were created at design time.
good luck.
Please send me a mail when you find an answer, I finally gave up and changed my design.
|
|
|
|
|
I am having problems installing a system wide hook from a service.
The hook is installed by the service when it starts. I am using PostThreadMessage() to forward messages from the hook DLL to my service's thread. At first I thought there was a problem sending the thread messages, but with further poking around I found that the DLL hook doesn't seem to be receiving any messages to forward.
I think this make be related to the "desktop" the service runs in. I have specified the "interact with desktop" flag when creating the service though.
Can anyone give me any ideas?
Thanks!
--
Dana Holt
Xenos Software
|
|
|
|
|
Hi.
I posted a thread about adding a feature to a program that searches a websites via Google. I have the basic design and implementaton done. Now I am debugging it.
I have successfully design and implement a chat program using TCP/IP and non-blocking mode via WAsynSelect(). I am using that same design with this website algorithm. I am running into a problem in this early debugging stage.
The program is I am not sure if TCP/IP and HTTP are the same or are similar. With TCP/IP and using WAsynSelect() mode, the non-blocking model relies on the Windows messaging system. With HTTP protocol, will the server, i.e. Google, send messages about the read, write, and/or close status of a socket (the socket connects the user computer to Google server via an Internet).
Thanks,
Kuphryn
|
|
|
|
|
HTTP is built on top of TCP/IP and is a TCP/IP based internet protocol. HTTP chat is funny in the sense, the client connects to the server, sends its request and then receives data till the server closes the socket connection from it's side. So it's not much of a chat in a way.
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
|
|
|
|
|
Thanks.
From some of the responses I have seen, I am getting a messages that in this program, I will have to do three things over and over again.
- connection to search engine
- send search
- receive response
- disconnection from search engine
The problem is when should you *receive*? For example, let say you send a message to search for something. When do you know the server is sending data base? With the chat program I am working on, TCP/IP sends some type of notice and then Windows messages a message to WAsynSelect(). That is who I know when to receive data. Moreover, the same works for sending data. Everything works in along with Window messaging system.
So do I need to *assume* the server will send a response immediately after I send a search message? My concern is when to call send, receive, and disconnect. With the chat program I have control over everything because the chat program is both a server and a client.
Kuphryn
|
|
|
|
|
If you're implementing the HTTP stuff on top a TCP connection governed by WSAAsyncSelect , the protocol is more or less like this:- Connect to the server.
- Send the HTTP request, terminated by a empty line. The server won't send any data back till you've finished doing this.
- Wait for the server to answer, Winsock will notify thru the event provided in
WSAAsyncSelect when incoming data arrive.
- Keep reading till the connection closes (if you're using HTTP1.0, for version 1.1 things are a little more copmlicated.)
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
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
|
|
|
|