|
I am building an MFC application in which I inserted an ActiveX control. I want to subclass (or hook) the control so that I can process some mouse message. Could you please help me with that?
Thank you very much.
|
|
|
|
|
My question is how would I detect when windows are open and closed/etc in another program and then send info accordingly to that program. I know this is a newbie question but I'm lost at this point.
|
|
|
|
|
My question is how would I detect when windows are open and closed/etc in another program and then send info accordingly to that program. I know this is a newbie question but I'm lost at this point
|
|
|
|
|
You're wanting to know when windows are opened and closed, yes? I'm inclined to suggest FindWindow() , but it has limitations. While I've not tried, you might could create a message-watching hook with SetWindowsHookEx() , watching for the WM_CREATE and WM_DESTROY messages. Without knowing more about what you are after, it's hard to pinpoint a reliable solution.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
This program is basically going to be a macro for a game. I need to know when things such as the option window comes up for attack, cast, etc. when the battle is over so the character can exit the place of battle. So if I knew when windows opened I could reference them and send mouse and keyboard commands and gain information from them.
|
|
|
|
|
I would say it is impossible.
If the game is developed to use DirectX or a similar hardware programming API, you can't hook it's messages very easily. The only viable solution would be (In DX case) to monitor for the DirectX COM main interface object when a new instance is requested on the interface, then hook this request and filter it through a custom message handler. In short: impossible.
The usage of DirectX grants a direct access to the hardware when the game is running, thus effectively passing the Windows messaging structure. So, what you're asking would require some sort of a plug-in or extension into the actual game engine. You might want to discuss the game developers if they left any viable add-on slots open into the actual engine.
But without help from the game developers, you're out of luck.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
my suggestion would be to watch packets comeing in from the game's port. if you can get a scheme of packets (i did this for ultima online back in the day) you can hook with the packets and read from there.
|
|
|
|
|
hello!
can anyone tell me why NetUserSetInfo gives an error while using the structure USER_INFO_1005 in windows XP and NT. the error value is 87 and the value of the last parameter of the function is 5.
can anyone please help me
thank you
|
|
|
|
|
Has it worked in the past? Can you show us a code snippet of how you are using the function?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
DWORD adminStatus;
DWORD check;
USER_INFO_1005 user;
user.usri1005_priv= USER_PRIV_ADMIN;
adminStatus=NetUserSetInfo(NULL,username,1005,(LPBYTE)&user,&check);
This is way i am trying to use this function.The same is given in MSDN.
Thank you.Waiting for your reply.
|
|
|
|
|
Is username the right type and have the right value?
Can you use NetUserSetInfo() with 1003? I'm just trying to ascertain if it's related to 1005 or NetUserSetInfo() in general.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
I included <TLHELP32.H> in my project then got the compiler error says ULONG_PTR is undeclared identity. What am I missing?
|
|
|
|
|
=[ Abin ]= wrote:
What am I missing?
Not sure, since there is no ULONG_PTR in TLHELP32.H. If you remove the inclusion, does the compiler still complain?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
|
Hi there!
I have to use some functions in my application but they must be in an apart file because they are going to be used from differents applications. How should I write it in my code so it runs? What headers should I add to my code?
Thank you in advance!
|
|
|
|
|
Put the declaration of the function(s) in a .H file. Put the definition of the function(s) in a .C or .CPP file. Whenever you need to use one of the functions, simply include the appropriate .H file.
To keep the linker from complaining about multiply-defined symbols, you'll need something like the following at the top of each .H file:
#if !defined(some_unique_symbol_here)
#define some_unique_symbol_here
#pragma once
...
#endif
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
I'm looking for advice/opinions on DAO vs ADO vs ODBC converting an MFC/VC6 app to VC7(.net)
All my DAO functions have been declared deprecated in VC7 so I'm a little nervous regarding future support.
Can I do the same things with ADO/ODBC as I can with DAO - I need to be able to create the Access database as well as read and write to it.
How about performance -DAO vs. the rest.
Or should I start thinking about deploying personal SQL server on all my machines in the field. In that regard can I look at a SQL server database with Access (all my users are familier with Access, so loosing that functionality is a drawback)
Also have some odd things happening with DAO in VC7 - like the connection being closed when returning from a function (as if the destructor gets called when it shouldn't)
I know thats a lot to ask, but any and all opinions or help will be greatly appreciated.
Thanks in advance,
John Horstkamp
|
|
|
|
|
From experience ADO and MSDE are the way to go. I switched about 3 years ago from DAO to ADO because DAO is not thread safe and my applications are all multithreaded. Also MSFT support for DAO is declining. There is a learning curve but it is worth it. Most examples in ADO used to be geared twards VB but that has changed a bit now. As for MSDE, its free and works fine for all my applications. The only problem I have had with it was we were hit with the slammer worm that also hit SQL server...
Here is a good place to get you started:
http://www.codeproject.com/database/caaadoclass1.asp[^]
John
|
|
|
|
|
Thanks,
So how does MSDE relate to SQL server?
BTW - the app is not really a high performance database.
The "admin" info is fairly trivial even for Access.
The point of concern is that there is also a lot (can be really huge)
numerical info (calibration data) that I store in the Access equivalent of a blob. Will I see performance gains with MSDE/SQL server?
|
|
|
|
|
After doing a little research on MSDN it does seem that MSDE and ADO are the way to go...Downloading MSDE now.
I may have further questions...<grin>
Thanks for the response
John
|
|
|
|
|
IMO, the benefits of ADO far outweigh that of DAO (ADO.NET is even better). With MS declaring DAO depricated in VC7, this not only means no support but also no backward compatibility.
MSDE is more robust and has much more functionality than Access. Users can continue to use Access by linking to SQL Server.
|
|
|
|
|
"...(ADO.NET is even better)"
In what regards (or is that too open ended a question)?
|
|
|
|
|
I guess it depends on what you're trying to do. Lately I have been working with XML out of databases and find that ADO.NET has much more functionality in that area. If your app is not using the .Net platform then it will probably be too much overhead to include with the distribution.
|
|
|
|
|
Don't have much experience with XML but I thought XML is more of a data transport mechanism as opposed to a data storage mechanism.
Actually, what I am doing (for a variety of reasons) is changing an application from using the Microsoft serialization scheme to a relational database scheme. The app object model actually lends itself nicely to a relational database. The database (50 or more .dat files or 1 .mdb) is fairly stable - ie nothing changes - once a site is calibrated and up and running. The creation and calibration of a site is another story. The admin portion of the database is trivial - even for Access. There is however a large portion of numerical (calibration) data that I store as a blob.
The app was started in VC6 and I am converting to VC7. It will run on Win2k and XP machines (and maybe NT at some old sites).
I don't know if that's too much info...or even makes sense... or is relavent
John
|
|
|
|
|
After doing a little research on MSDN it does seem that MSDE and ADO are the way to go...Downloading MSDE now.
I may have further questions...<grin>
Thanks for the response
John
|
|
|
|