|
Manasi D wrote: But if its a service I need to use OpenSCManager(), StartService() etc..
I think u meant services already install in the Service control manager database.
If the service is already installed, u can query for the services installed using EnumServicesStatusEx and get the binary file name for the service using QueryServiceConfig and compare it. This is not an optimised solution
|
|
|
|
|
I used to use the LPT port in a program in Windows XP. In order to get access to the port, I used TotalIO.
Now I am using Windows Vista 32-bit, but I can't get TotalIO to work. It says the service is loaded successfully, but I still do not get access to the x86 assembly in and out instructions. I still get the priveledged instruction error. I have even tried running as Admininstrator with XP compatibility.
Has anyone had any success with getting port access in Vista that has any tips?
Please note: I want to avoid using inpout32.dll; although if it is the only option I will. The reason is, in my experience, TotalIO is MUCH MUCH faster than inpout32.dll.
modified on Thursday, February 7, 2008 9:03 PM
|
|
|
|
|
It seems strange that it worked on XP: the in and out instructions are privileged in XP too and so can only be executed from kernel mode (i.e. by drivers, for example.)
Steve
|
|
|
|
|
Stephen Hewitt wrote: It seems strange that it worked on XP: the in and out instructions are privileged in XP too
that is why he is using TOTALIO, a driver which changes the priviledge bit to give direct access to hw port to the application.
|
|
|
|
|
|
Stephen Hewitt wrote: I would assume the driver is not compatible with Vista,
I too.
|
|
|
|
|
Using such a driver is reckless, to say the least. It affects every process running on the system. This means that a badly written process (perhaps not even the one that installed the driver) can trash the system instead of just terminating with an exception, and Microsoft would probably cop the blame!
Steve
|
|
|
|
|
Stephen Hewitt wrote: and Microsoft would probably cop the blame!
How so?
If they would refrain from promising infinite compatibility, no one would come to blame them when there is none.
MacOS has changed its API (and broke compatibility) two times now.
Linux constantly changes its internal APIs and drop outdated ones (SysFS, still remembered?).
Yet both are on the rise, while MS declines...
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
jhwurmbach wrote: How so?
Because in modern operating systems user programs can’t directly access the hardware of the machine, this is the job of a device driver. TOTALIO gives user programs access to the in and out instructions; any user program. This means that installing TOTALIO allows a badly written application to crash the whole system instead of just crashing itself. This is obviously the kind of thing that needs to be stopped. When a user’s computer blue screens Microsoft will cop the blame when the fault really lies with the software that installed TOTALIO.
Steve
|
|
|
|
|
Yes, obviously.
x87Bliss wrote: in my experience, TotalIO is MUCH MUCH faster than inpout32.dll.
I think this is because direct execution of instruction rather than deep path to kernel mode driver like inpout32.dll.
I would suggest that he can increase the performance by decreasing the number of calls through inpout32.dll (buffered commands), if the frequency of the call is high. inpout32.dll source is available for him to experiment on.
|
|
|
|
|
Thank you all for your info and security concerns. This is just a personal program, I am not designing it for public release. I only allow TotalIO to run during the timeframe that I need it. I will have to give GiveIO a try, since that should be much more secure, thanks for that tip. And Steve's info on the allowed port range also clears it up: "up to about 0xf00". As my LPT port is on port 0xCD00 - thanks to the add-on card. It's no wonder TotalIO "isn't doing it's job" if you will.
Again, thank you all. TotalIO's failure, and your comments, is like a wake-up call to stop doing the I/O the quick and dirty way.
|
|
|
|
|
|
I have a series of radioboxes (not grouped); and I can find out which one is selected by the ON_BN_CLICK, but exactly how do you uncheck that radio button? the MSND is confusing on that issue to me.
I need to be able to uncheck a user's prior selection. IDC_WORK_TYPE (radio button).
A C++ programming language novice, but striving to learn
|
|
|
|
|
non-MFC - send the BM_SETCHECK message with the state as BST_UNCHECKED
MFC - button.SetCheck (BST_UNCHECKED)
Judy
|
|
|
|
|
I would also look at CheckRadioButton. This is MFC and not-MFC.
After all, it's odd to have NO radio options selected. If that's really what you want, you can have a final radio option labelled (eg) "None". Otherwise, it will just get confusing.
Iain.
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
The reason for wanting to uncheck it is that after the user has made a selection, finishing the data entry for one person, the user has an option for entering another "record" by selecting the [More] button. Naturally I don't want a previous selected radio button checked when the user is entering a completely different "record".
A C++ programming language novice, but striving to learn
|
|
|
|
|
Autoit version 3 has very simple functions that I thin can also be done in visual basic or v C ++.
Since autoit is C++ oriented i think this isn't a problem. The main types of functions I want to use are pixelchecksum which finds an image checksum of an image outside the developer envirornment, then functions like winactivate that activates external windows outside developer env., and also sendmouseclick which sends mouseclicks to ext windows outside devel. env.. I have asked many people and noone seems to know. If you could just tell me how that would be great.
|
|
|
|
|
|
i found mouseinput which should work for the mouse parts. I just need a way to find a checksum of a region of pixels and a way to create a library and then call on these images and use their library definitions in my script.
Thanks for the help.
|
|
|
|
|
is mouseinput not available for vb?
|
|
|
|
|
I found out I don't need to use pixelchecksum. I just need to use optical character recogniton to recognize the number and symbol posted on each image. Then based on the color of these two symbols for each image i can know exactly what image I am looking. At. Does anyone know how to have an ocr program run with a new application in vb or vc++ that can recognize numbers 0-9 letters a-z and four symbols(a heart, a club, a spade, a diamond) Through screen scraping and optical character recognition in an external game window seperate from my new app?
|
|
|
|
|
hello veryone,
how to call coding in C++ to mathlab?
|
|
|
|
|
See here[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Have a look at [^].
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
|
|
|
|
|