|
Does anybody knows how to get the XP key with C++ (console or windows)?
thanX
|
|
|
|
|
Only if it's in the registry. Why do you want it ? The PC you're running has it already, and you can't use it elsewhere, even if you wanted to.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
May I use Synchronization Objects like CSemaphore for synchronization function not to be threads ?
Thanks in advance
|
|
|
|
|
Yes you can use that, It would always be in current thread context.
<bold>- Nilesh
<italics>"Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw
|
|
|
|
|
hcmuns wrote:
synchronization function not to be threads
Could you elaborate that? Currently I think that you want to use synchronization objects in a single threaded application, which is (in most cases) not necessary.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
I would like to use in my class
|
|
|
|
|
Hello,
I suppose that you use them in a multithreaded application. In that case you should use them whenever multiple threads can access the same data at the same time!
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
I would like to use in my class
|
|
|
|
|
Hi,
I am using memory mapped file for communicating between two processes.
I write the information by one process onto the memory mapped file. If
the process is shutdown after writing the information. Can the other
process read the information in the memory mapped file ?
i.e. Will the memory-mapped file persist after the process which created
the memory-mapped file is closed ?
Thanks
|
|
|
|
|
If I remember correctly, the MM-File should be open until it's closed manually. That is by one of the processes. Windows however, will close the file (not delete it I think) if no valid handles are pointing to the file. So if you store a handle to the MM-File you should have no problem
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Nilesh K. wrote:
No, it would get lost.
Hello Sir,
I have never worked in memory mapped file, though i know it's use for interprocess communication.
If one appliction close after writing into memory mapped file, how the data get lost when other applcation still has a valid handle to the MEMORY MAPPED file!, if it so then it's great drawback for INTERPROCESS Data Transfer!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
It will remain as long as a single active process has the file opened and mapped into memory.
|
|
|
|
|
hi,
I want to ask if a DLL is unloaded, will the memory mapfile its referring to loses?
Thanks
|
|
|
|
|
Yes, if the load count of the DLL goes to zero, or there is no longer any process referencing the DLL, it will be unloaded.
|
|
|
|
|
I have manage to convert a DICOM image into a raw image..that is to say without its header.Now how can i view the pixel value of this raw image in binary form?
|
|
|
|
|
By RAW you mean a byte array ? DICOM is 10 bits per pixel, right ? So what you have is an array of bytes, with 10 bits representing each colour ( or 30 if it's not grey ) ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Actually RAW format is still the DICOM image which i open up to view using Adobe Photoshop. The only difference is all the headers has benn remove what i am left with is just the image itself. My problem now is how do i view the pixel values from Photoshop? The image is in the grey.Does MATLAB be of any help?
|
|
|
|
|
So you have a byte *, right ? And it's still a DICOM image, so it's 10 bits per pixel, right ? I assume DICOM does not waste any bits, that the 11th bit is the first bit of the next pixel ? Does it also flow on between rows that way ? Does it store the rows top down, or bottom up ?
If you have a byte * and you need to work out how to get at each pixel, then I doubt MATLAB will help much, what you need to do is work out the internal format exactly so you know how to get to the 2 ( or maybe 3 ) bytes you need, and then mask those bytes and shift thier values to get the final result.
I am on the edge of doing some work with DICOM, which is why I believe they are 10 bit, but I don't know enough about the format to comment beyond that. Do you have any resources about what a RAW DICOM file actually looks like internally ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
By the way, I am not the moron who voted this a 2.0.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Sorry i don't get what you mean by voted this as 2.0.Anyway i hope you are able to help.Thanks.
|
|
|
|
|
What if I save the DICOM image as a text file? Will I be able to convert the text file to binary? If so how should I go about writing the program? Can debugging help?Or perhaps using the basic "printf" function to display teh pixels values if I know where the values are store. PLease advise.Thks.
|
|
|
|
|
I'm working on an app that allows the user to burn CD's, but if the user hasn't previously set up an action for the CD Drive's property for action on a blank CD, the "What do you want Windows to do?" window pops up. This message needs to be supressed of course.
I have a working version of code, initially based off of a "service" article on MSDN (sorry don't have the link), that basically just enumerates all desktop windows to find the title of the window, then enumerates the children of that window to find the "What do you want Windows to do?" message. Once it finds all this, then it closes the window. It does this enumeration every 1/4 second in a background thread, but only when needed (just when prompting the user for a disc) to minimize CPU impact. The window will flash up, but will be gone before the user knows what hit them. This can probably be done better using hooks, but I'm not quite there yet -- and what I've found so far makes me think they won't work much better overall (see the next paragraph).
Anyway, the problem I'm having is that although this works, the application needs to be localized into around 8 different languages (possibly more, can't remember exactly off-hand), so looking for strings to go off of won't work very well, not to mention this code will break as soon as windows decides to change the text. Using normal hooking methods don't look any more promising for this, because I still need some way to figure out that it's the correct window being created.
I'm thinking there's gotta be something simple I'm missing here. Any ideas?
-----
In the land of the blind, the one eyed man is king.
|
|
|
|
|
Hello,
this[^] should point you in the right direction.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
I bet that will work, but the following disclaimer has me a little worried: "Applications should not modify these values, as there is no way to reliably restore them to their original values."
I don't see why there should be any problem restoring to the original settings though.
-----
In the land of the blind, the one eyed man is king.
|
|
|
|
|
Ah, even better ... found exactly what I needed on MSDN after checking out that article (and knowing what to search for ... that is half the battle with MSDN) Enabling and Disabling AutoRun[^]
Thanks a bunch!
-----
In the land of the blind, the one eyed man is king.
|
|
|
|