|
Please see my reply to Iain.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
It's a little more subtle than you think.
There are THREE message boxes.
::MessageBox - the windows API function. The others end up wrappers around this, so it's good to read the docs fully for all the flags (esp DEFBUTTON2, as it can be handy!)
CWnd::MessageBox - This uses the CWnd you're calling it from (maybe this , maybe some other window - up to you) for the window handle. It also provides defaults for the title and flags.
::AfxMessageBox - gives you defaults also, but uses your MainWnd as its parent window.
The last two are fairly similar, but you can end up with odd situations where you don't want a disabled or hidden window being a parent etc.
Shorter answer: Near as dammit the same thing, but not quite.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
|
Dear Friends,
I want to delete a file which is used by other application.
When I try to delete that file,it shows error as
"Cannot delete file: It is being used by another person
or Program.Close any programs that might be using the file
and try again."
On searching Google, some utility programs like "Unlocker" does this.
But I am in need of the code just only to unlock the file
and delete it.
Could anyone help me out please?
Thanks
|
|
|
|
|
What file that you want to delete ir depends to OS or other programs?
|
|
|
|
|
Not OS locked.
The file is "*.tds" file generated by
Borland C++ (bcc32.exe) compiler.
|
|
|
|
|
you can use "Process Explorer[^]" to find which application/process/thread uses the file (then up to you to kill it or not)
|
|
|
|
|
I think he's looking for a way to achieve it programmatically.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
i read and reread his post again, and still not sure about that
maybe a reply will guide...
|
|
|
|
|
poda wrote: But I am in need of the code just only to unlock the file
and delete it.
The quote is from the original message. I think the badly formatted message makes it difficult to read.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Yes I want to do it programatically.
When we compile and link a project,the compiler will
generate many files(like obj,map,ils,tds etc).
One of them is .tds file.
But this file is 'hold' by the IDE of Borland C++.
How to release this 'lock' so that it can be deleted.
|
|
|
|
|
i don't know borland, but maybe if you just close the IDE, it will release the file, won't it ?
|
|
|
|
|
Ofcourse,it will release the file.
But I will use the linker to create DLL as
a separate process for which the .tds file has
to be deleted when the IDE is open.
I need to know to how to release or unlock a file
which is holding by a application.
Thank you
|
|
|
|
|
Hi,
I want to communicate with a USB device from my PC by using Visual C++.The device is a RF-ID.So I do not need to transfer large files, I only need to read the ID from RF-ID. How can I do that simply? I search the web some but the sources that I found are more advanced than I can understand. Can you seggest me a simple way because I am not much experienced?
Thanks for any help
ibrahim
|
|
|
|
|
I think you'll get more help here [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
You have to get a handle to the driver that is supplied with the USB device (using CreateFile). Then you can communicate with the driver using WriteFile and ReadFile. For more advanced stuff, you can then use DeviceIOControl. Anyway, all of that should be documented with the device. You also need to have the device driver.
|
|
|
|
|
Firstly I have not the control codes for the device. I am understanding that I should want the control codes from the producer company?
And If I know the contol code how can I use it?
|
|
|
|
|
Where did you get this device from ? I guess you should have received some documentation with it. Did you take a look at it ?
|
|
|
|
|
iayd wrote: And If I know the contol code how can I use it?
No information about the device = use it a paperweight, depending on how pretty it is.
I've had to deal with some odd devices in my time, and most supplier companies are quite good at emailling you the obsolete device pdfs if you ask politely and give them some time. After all, you're not spending money with them at the moment... That's already happened.
Or get numbers off it, and google it. You'd be surprised just how much info on odd wacky stuff is floating about out there.
Once you have the information, you may even get a COM object that does the work for you, or you'll need WriteFile / ReadFile / DeviceIOControl to talk directly to the driver.
Iain.
-- Edited once I reread original post!
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
Hi all,
How can I differentiate between SATA and IDE/ATA hard drive.
I have more than one hard drive attached to my machine, Now I have to code in VC++ by which it can be recognize that this is SATA hard drive and this is IDE/ATA.
I am thrying to get it by using Win32_diskdrive WMI class. There is one property "InterfaceType" that is returning IDE for both hard drive, while I have one SATA and one ATA/IDE.
Is there any other WMI class by which it can be recognized?
thanks.
|
|
|
|
|
I there
I' new into dynamic programming and i have to write some code using OpenCV lib.
I did my job until now, but my software doesn't reuse memory. My application use 4mb/sec from my RAM.
How to check what part of my code consume so much memory?
I'm using VS 2005 and my application is written in VC++ with OpenCV
Edit/Delete Message
|
|
|
|
|
If you want to find leak memory on your project see Visual Leak Detector[^] if else more info is helpfuls.
|
|
|
|
|
I want to know how to detect object presence in a scene.Will the opencv functions edge detection and square detection do it?
|
|
|
|
|
|
Sir,
I have tried with the code.But i get an error message as
"fatal error C1083: Cannot open include file: 'cvaux.h': No such file or directory"
Please do help me in doing the code.ie,how to arrange all the files..
|
|
|
|