|
Member 3653751 wrote: i want send and recieve Continuesly
So then shouldn't you be using CAsyncSocket instead? See here for more.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Can someone tell me how to track "rename sheet" event in Excel ? Is there any event gets called when we
rename some sheet in Excel ?
I couldn't find any ..please help
|
|
|
|
|
Dear sir,
I want to retrieve the value of Registers of operating systems by using C language.
|
|
|
|
|
Hi,
The first bad news is that operating systems don't have registers, the processor does. Secondly there's no portable way of reading them in C - it's processor and compiler dependent, if you can do it at all.
Just out of interest, is there any particular reason you want to do this as most of the things you read will be completely meaningless in the wider operating system context?
Cheers,
Ash
|
|
|
|
|
Hi!
Thanks for giving interest in my problem.
Acctually I have an pripherial device(MS-DOS) based;I want to retrieve their SerialNumber or any internal information.
Ex. We can retrieve the Motherboard number by using getipaddress();
|
|
|
|
|
I m sorry;Getipaddress is used for IP Address;also we can retrieve the Motherboard number.
|
|
|
|
|
I like to clear my problem with explanation.
EX:If i used the Usb Drive(pen Drive)to my computer system; I want to extract the Serial Number or any Internal information from the memory of the USB.
If u have any idea plz tell me.
|
|
|
|
|
Ah, okay.
Despite working for a harddisk manufacturer I've never dug around in USB. If you're using Windows then http://www.emmet-gray.com/Articles/USB_SerialNumbers.htm[^] seems to have all the recipes you'd need to grab the serial number from a USB 2.0 device. One problem is that the code is written in VB, but it gives the sequence of Win32 calls you'd need to make to get the information (and it's a bit convoluted - hopefully someone more in the know can point you at a simpler method).
If you're using another OS then there's probably a similar recipe out there somewhere.
Another alternative would be to write a device driver and tickle the device directly through it's I/O ports and see how it giggles. However you'll need to know more than most mortals should need to know about USB - and having seen a colleague of mine go bald reading the OHCI, UHCI and EHCI specs I wouldn't wish that on anyone.
Cheers,
Ash
PS: Perhaps posting another question with "Reading configuration data (e.g. serial number) from a USB device" might attract someone who knows what they're talking about.
|
|
|
|
|
Thanks for this response;
But actually have an other Electronics device Ms-DOS based, Please clerify how to retrieve the information any system which can communicate with Computer System.
|
|
|
|
|
I'm not sure what you mean by a device being MS-DOS based.
If you can expand that a bit I might be able to point you somewhere to help.
Cheers,
Ash
|
|
|
|
|
Hi,
ok ,I have an CMRI is an Energy Meter Reading Device; I want to know the serial no. of CMRI;which is unique & provided by the manufacturer.
CMRI is Ms-Dos based device. PLz help me
|
|
|
|
|
kushMuchaal wrote: CMRI is Ms-Dos based device.
Please explain what is meant by MS-DOS based device - this makes no sense.
It's time for a new signature.
|
|
|
|
|
Seems to me that the manufacturer of the device would have provided such with their API.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Just done a bit of digging...
Okay, looks like CRMI devices are used to read 'leccy and gas meters. They seem to have RS232 or USB interfaces on them and usually come with a suite of tools through which you can connect the CRMI to a host computer. These CRMI things seem to run something that looks like PC-DOS or MS-DOS but that's a complete red herring, it has no bearing on getting data off the device.
Now if the device has a USB port and follows the USB 2.0 specification then the link I dropped in an earlier post will show you the sequence of function calls you need to make to get the device's serial number. From what I've read the USB capable ones are just USB mass storage devices and look like any other disk drive when they plug in. If you want the data on the device you can then just use ordinary C standard library function calls to open the files on it.
Cheers,
Ash
|
|
|
|
|
I do not think you can access the registers directly in C (in C++ use the __asm keyword). However, even if you could address them their content will be meaningless beyond containing a few variables local to your function.
Perhaps you could clarify what you are trying to achieve.
It's time for a new signature.
|
|
|
|
|
I like clear my problem with explanation.
EX:If i used the Usb Drive(pen Drive)to my computer system; I want to extract the Serial Number or any Internal information from the memory of the USB.
If u have any idea plz tell me.
|
|
|
|
|
Hi,I want to draw one line in left side of editbox in dialog,the color will vary depends on the value in editbox.
So im getting the size of the editbox in OnInitDialog() like this.
GetDlgItem(IDC_SPVALUE)->GetWindowRect(&SPclrrect);
Im drawing line in OnPaint()
CPen SPClr;
SPClr.CreatePen(PS_SOLID,4,RGB(255,0,0));
pDC->SelectObject(&SPClr);
pDC->MoveTo(SPclrrect.left-7,SPclrrect.top);
pDC->LineTo(SPclrrect.left-7,SPclrrect.bottom);
But it doesnot draw on the exact place,it draws very below edit control.
SPclrrect shows
bottom-414
left-44
right-131
top-394
But when i give this manual value it exactly draw in right place
pDC->MoveTo(37,345);
pDC->LineTo(37,362);
Then why SPclrrect returns wrong value.
Any other way to do this work?
Anu
|
|
|
|
|
My Question do you want to line to appear inside CEdit Control or outside edit control?
If inside, you have to overide CEdit OnPaint function
if outside, you ClientToScreen or ScreenToClient function to get exact location of point
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
I use ScreenToClient().It works.
Thank you so much.
Anu
|
|
|
|
|
Shameless plug: Please vote for answer
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Dear all,
I want to develop a service (that is written by unmanaged C++) in Win7.
This service can detect status of UPS, example: low battery, out of electric, etc..
It connect with UPS by RS232C cable through COM port.
I google and find some funtions: GetCommState, SetCommState, GetCommModemStatus but don't know how to use it to check status of UPS (low battery, out of electric, ...)
Pls. help me to solve it .
Thanks a lot.
Ratkit!
|
|
|
|
|
You havnt said what you want to DO with the UPS status once you've found it - lets assume you wish to write it to the Windows Event Log for start..
I would appoach it in a number of 'phases', not knowing what experience you have
1) build a console mode program capable of writing application events to the event log
2) use something like Serial library for C++[^] in a console mode program to be able to read the UPS data from the serial port - somewhere in the specs for the UPS it will tell you how to interpret the data to give you the status
3) then write a service, make sure you can do the normal things - start, stop, use the knowledge gained from (1) to write an event to the log on a timed basis - eg, every 5 minutes
4) once youve gotten here, you then re-do the service to use the knowledge gained in step 2, to determine and log the UPS status to the event log
Once your service is up and running, you can expand the logging event to (for example) send an email if the UPS needs attention, or (for example) add a system-tray applet and change the colour of it to red
'g'
|
|
|
|
|
Check out the Win32_UninterruptiblePowerSupply WMI class.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
According to the documentation on Win32_UninterruptiblePowerSupply: "Beginning with Windows Vista, this class is obsolete and not available because the UPS service is no longer available."
http://msdn.microsoft.com/en-us/library/aa394503(VS.85).aspx
Can you suggest another way to help me solve it?
|
|
|
|
|
In addition to what David said, you can call GetSystemPowerStatus() to get that information.
|
|
|
|