|
not yet - in the process tho...
|
|
|
|
|
You can't just pass a dib handle to SetClipboardData - that would be too easy. You have to copy the contents into a global memory block and pass the handle of this memory block to SetClipboardData. DIBLOOK sample may be helpful; have a look at CopyHandle helper.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I've already tried the CopyHandle() method, and I get the same results.
|
|
|
|
|
|
Hi,
I have an MCI application that reads/catalogs audio CD's using the CDDB Interface.
There are two things I would like to get it to do that it currently does not;
1) Recognise that a CD has been loaded into the drive, so that I do not need to have a menu item to add a new CD.
2) Eject the drive after the information has been cataloged.
I know that for 2) there are a couple of KB Articles, Q165721 and Q168180, but I would like a simpler, more universal method, if possible.
Many Thanks in advance for any info.
Bryan Anslow.
|
|
|
|
|
Ejecting with MCI is easy. Assuming that you know the drive letter, send the following strings:
"open f: type cdaudio alias cdx0"
"set cdx0 door open"
cdx0 is just a sample alias. Any identifier should work.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thanks Tomasz,
I use mciSendCommand() everywhere in this prog, so I found this worked;
mciSendCommand(_mciDevice, // Eject the CD
MCI_SET,
MCI_SET_DOOR_OPEN,
(DWORD)(LPVOID)&mciSet);
also, for finding out when a CD is inserted, I just added a line to my mainframe module (it's an MFC App)like;
ON_WM_DEVICECHANGE()
and the OnDeviceChange() function can find which device etc., by examining the passed parm,
Bryan.
|
|
|
|
|
I cannot find any useful functions from neither the MSDN nor the MFC source code. What can I do now? Please help me!
Law is meaningless without chaos.
Chaos without Law is equal to destruction.
Chaos and Law create our rich and colorful world.
|
|
|
|
|
Have a look on this site PJ Naughter has written a class that does the job!
Norm Almond
Chief Technical Architect
FS Walker Hughes Limited
|
|
|
|
|
I'm sorry to waste your time. But I don't know which article you refered to. Did you mean the FTPTransferDlg class?
Looking forward to your reply. Thank you.
Law is meaningless without chaos.
Chaos without Law is equal to destruction.
Chaos and Law create our rich and colorful world.
|
|
|
|
|
Can anyone tell me how to delete a file to the recycle bin programatically.
I can use CFile.Delete(), but this appears to delete the file completely, but what I would like to do is move the file into the recycle bin.
Thanks in advance for your help
|
|
|
|
|
|
|
Thanks, That's just what I needed
|
|
|
|
|
Hi @ all
I hope that somebody can tell me how I can create a makefile from the command-line (not from VC++ with project/export_makefile) from .dsp or .dsw files.
Thanks a lot
|
|
|
|
|
Why don't use the VC++'s project/export_makefile? It's very convinent.
Law is meaningless without chaos.
Chaos without Law is equal to destruction.
Chaos and Law create our rich and colorful world.
|
|
|
|
|
Is it possible or isn't it possible? I found a perl-script programm on the internet that can convert a .dsp-file to a makefile, but I don't wanna start learning perl now just because of this one 'problem' (I'm getting strange error messages while compiling this script...).
So I just wanna get a makefile without always being forced to open VC++.
I wanna use this command in another makefile (with recursive use of make) to make sure to be always up to date with the dependencies.
|
|
|
|
|
Hi,
I am wondering if it's possible for my MDI Child window to have only max in min buttons, with no "X" for close?
Is the only was to achieve this with WM_NCPAINT?
Thanks
|
|
|
|
|
I have a weenie problem. As I have probably mentioned ( ad nauseum, I know ) I am doing a GUI library that is in Win32 and exposes itself through a Python console. I've created a dialog that shows a progress bar and allows you to set a range and step through it. You can also specify a timeout, so it shows itself after a particular time, the idea is unless it's a long time doing the function, you don't get the dialog. ( It was not my idea, I think it sucks ).
Anyhow, it works UNLESS you use it in a real world situation, i.e. where the processor is actually doing something during the timeout. I did it initially with a timer, but the timer would fire when the dialog went out of scope ( well, just before, but when the calculations stopped ). So I put the dialog in a thread. It wouldn't show at all. Now I put a seperate thread into the dialog class ( we have a class based on code stolen from Jeffrey Richter's book and we overload it by changing the Run method, so an instance of the class is a link to another thread ). I pass in the hWnd of the dialog, and in the thread I specify a timer and the call ShowWindow(m_hWnd, SW_SHOW). I have established the timer now fires perfectly, but as soon as I try to access the HWND, which is not being used for anything in the main thread, it hangs until the main thread finishes calculating, and the HWND is deleted.
I am at a loss - what could be happening here ? I tried a critical section around using the HWND, which just froze the program. Personally I don't see the point, but it's been requested and it's becoming a matter of pride. I admit to knowing little about threading (it's high on my list), so it's probably something really obvious. I *am* concerned about the possibility the HWND cannot be used in a different thread to the one that created it, but I don't think so because I believe such handles must surely be system wide, and I know the main thread is not doing anything with it.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Window created in one thread gets its messages from the thread message queue. If your dialog was born in thread A, it's goint to be fed with messages from the A message queue. Have no idea how exactly timers fit in this picture, but I feel that you should simply create the dialog in other thread.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I tend to agree, which is why I started with the instance of the thread class holding an instance my the dialog and creating it in the thread. The program froze, the GUI died and the window was never seen.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Are you sure the second thread is the GUI one? Maybe post some code.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I would have done so right away, but the code is at work. I admit to being a thread virgin - are you saying only one thread can be responsible for my GUI ? The main thread is doing all my GUI at the moment, except initially my dialog was happening in my second thread ( well, supposedly, nothing happened and the program froze ). The way our thread class works, I am certain that when it froze I was trying to run the dialog in the second thread. Now I am not, but either way when the second thread tries to access a HWND in any way, it freezes until the main thread kills the HWND.
I guess that's not much help, I should post some code tomorrow.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
are you saying only one thread can be responsible for my GUI ?
Absolutely not. But there are two flavours of threads - the worker threads without message queues, windows and such, and GUI threads with message queue. Probably you invoke your thread with AfxBeginThread, do you pass address of some function or RUNTIME_CLASS as 1st param?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
It's created with _beginthreadex, the app does not use MFC. I did not write the thread class, someone else stole my Richter book and wrote it.
He seemed to think when I asked that there was no difference between GUI and worker threads, which I thought was wrong but accepted as he has at least written this thing. I'll go to bed now and readu p on it, I think.
Thanks - I'll post some code tomorrow if I'm still stuck.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|