|
:-DEvery article in from microsoft has to be taken with a grain of salt.
Always take note of the keywoards they use and search on those. The odds are that there was a previous article on the same subject. One thing that microsoft tends to be good at is redundency.
I am always surprised when I have to go back to the help system for Win3.1 in order to find out what the hell they are talking about.
Note the IDropTarget under requirement:
Windows NT/2000: Requires Windows NT 3.1 or later. (XP did not exist yet)
Windows 95/98: Requires Windows 95 or later. (XP did not exist yet)
Windows CE: Unsupported.
Header: Declared in oleidl.h.
INTP
|
|
|
|
|
For example, I want to launch the below file.
C:\Windows\Tasks\Low Battery Alarm Program.job
What function can I use to launch this file in VC++ ?
Jesa
|
|
|
|
|
Is it launched by just double clicking on it?
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Dear Papa and DavidCrow,
It can be launched by just double clicking on it.
But I can't launch the dialog by using system(),ShellExecute(),WinExec(), or CreateProcess().
In NoteBook platform, we can launch the dialog by the below procedure:
1. Lauch the "Power Options Properties" in control panel.
2. Select the "alarms" page.
3. Click the "alarm action" button.
4. Check the "Run a Program" checkbox.
5. Click "Configure Program" button.
Is there any other way to do it??
Jesa
|
|
|
|
|
If it has an associated application, then just use ShellExecute() .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi, I have downloaded DirectX 9 SDK but when I try to use dx9err in my code, compiler gives an error: "Cannot open include file: 'dx9err.h': No such file or directory"
I have checked - there is dx9err.h, so I asume that there is no dx9err.cpp or dll, or something, as references to other header files in same directory don't raise compiler error.
Qusetion: Do I have to download dx9err separately or there is just mess in SDK documentation? I'm using VS .NET 2003.
Thanks.
|
|
|
|
|
More of an algorithm question than a C++ question, but here goes anyway:
A sequence of numbers needs to be plotted as a graph on the screen. There are many more numbers than pixels available, therefore the current implementation "compresses" groups of numbers so that it can represent each group as a single pixel.
eg:
Assume the following trivial sequence of numbers:
{ 1, 2, 3, 3, 2, 1, 1, 2, 3 }
Also assume that I only have 3 available pixels in which to display these values, such that:
pixel 0 = { 1, 2, 3 }
pixel 1 = { 3, 2, 1 }
pixel 2 = { 1, 2, 3 }
What is the best way to get a "best fit" of the numbers, so that the graph retains as much of its meaning as possible?
As far as I see it, I can take the minimum, maximum or average values of each group, but this is not always useful. For example, given the above groupings, I will end up with a flat line graph, which is obviously not representative of the data!
As I mentioned above, the software already exists to do this, but the results are not always satisfactory and are occasionally outright misleading. I really need a good algorithm that will retain as much of the "shape" of the graph as possible.
Thanks for any help!
|
|
|
|
|
Actually, in terms of MSE the average *is* the best option. It's an unfortunate example which you brings, but the general case favors the average.
I can make another suggestion, if it's acceptable: plot *3* graphs: average, mix, and max. For each "pixel" plot in one color the min, in another the max, and in a 3rd color the average of the "group" of values which that pixel represents.
That way you'll get a better feel, I believe.
-- Nitzan
|
|
|
|
|
Consider pairs of pixels.
Look at the data that is mapped onto two pixels and search for minimum and maximum.
Put the one that comes first into the first pixel, the other into the second pixel.
This way "noisy" data will look noisy.
HTH
Henrik
|
|
|
|
|
Text in a CStatic control, which is on CFormView (SDI app), gets erased after CPropertySheet dialog ends. Dialog is called from the menu. Does anyone knows what's the reason for such behaviour and how to prevent it?
|
|
|
|
|
Override OnActiveView() or OnSetFocus(), etc. and refresh the static control.
Kuphryn
|
|
|
|
|
How synchronised contact of outlook with an access application?
thanks
|
|
|
|
|
I'm developing a pkg in Visual C++ that will need to have a unique serial number for each copy of the software sent out. The program needs to be aware of its serial number, and it needs to be stored in a place somewhat inaccessible to hinder tampering.
The "brute force" method would be to manually change a #define in the code and recompile before each delivery of each copy of the software. Totally unworkable. Does anyone know of a way to do this? I thought of somehow automatically editing the .rc file, but that gets folded in at compile time, so that won't work, either. I need a clever idea....
Thanks!
|
|
|
|
|
In the dim and distant past when I was creating Novell Netware NLMs I did something like,
struct SerialNumber
{
char sentinel [ 33 ] ;
char serialno [ 33 ] ;
} ;
SerialNumber TheSerialNumber = { "That'll be the day, when you mak",
"00000000000000000000000000000000" } ; Put that somewhere in static space, then write a separate application that searches the exe for the sentinel string (ensure there's only one instance if you're paranoid....) and sets the serial no to whatever is desired.
I'd suggest encoding the serial on the way in and way out, this can be something fairly trivial, and perhaps using a likely looking error message as the 'sentinel'.
Paul
|
|
|
|
|
Thanks, Paul! That may just be the ticket! I need to create a separate exe anyhow, to automate serial number creation in the first place, so this should work nicely.
Thanks again!
|
|
|
|
|
I am writing an application that needs the mac address of a remote computer. I have tried the SendArp function, but it does not return the whole mac address when I try to retrieve it for any computer other than my own local ip. For example, I use the SendArp function with my local computer ip and it returns 00-00-83-44-60-79. If I use it with a remote computer on the domain, it returns 10-40-00-00-83-44, which 00-00-83-44 is the correct start of the mac address, but it is missing the end of it. I think that might have to do with the fact that it is a token-ring network. However, if I run nbtstat -a {Computer Name} at the command prompt, I get the correct mac address. I have also tried the following:
LPSTR cmp_name = {Computer Name};
WKSTA_TRANSPORT_INFO_0 *pwkti;
DWORD dwEntriesRead;
DWORD dwTotalEntries;
LPWKSTA_USER_INFO_0 pbBuffer;
NET_API_STATUS dwStatus = NetWkstaTransportEnum(cmp_name, 0, (LPBYTE *)&pbBuffer, buffer,
MAX_PREFERRED_LENGTH, &dwEntriesRead, &dwTotalEntries, NULL);
If I set cmp_name = NULL, it returns the correct mac address for my local computer. But if I set cmp_name to a valid computer name, pbBuffer becomes an invalid pointer.
Does anyone know how I can get the correct mac address on a token-ring network? Thanks a lot.
|
|
|
|
|
See my reply here.
smbecker wrote:
But if I set cmp_name to a valid computer name, pbBuffer becomes an invalid pointer.
And the return value is what?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I've been looking through Win api can't find anything. I'm looking through WMI - might have some luck. Does anyone know anything about a way of getting the lid closed event on a laptop computer?
|
|
|
|
|
Unless a power scheme is in use, I don't know of a way. Take a look at the GLOBAL_USER_POWER_POLICY and SYSTEM_POWER_POLICY structures. They both have a POWER_ACTION_POLICY member that defines the action to take when the system's lid is closed.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Do I pay a penalty for having many mutexes? I am designing a C++ class library and want to set a lock on each object. That is, one CMutex per object and several hundreds of objects (potentially), where only a small number of mutexes will be locked at the same time.
I somehow think this might not be a good idea, but maybe I am too pessimistic. Will this work, or will the sheer presence of a large number of mutexes bring Windows to a grainding hold?
TIA,
Bernd
|
|
|
|
|
A mutex has some kernel data structure associated, so you are "eating up" some ressources. However, if this comes from the nonpaged pool (which is limited) I don't know.
But from my understanding, just habving them "hanging around" will not cost you addditional CPU time.
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen
|
|
|
|
|
Thanks for your input. I am not so worried about CPU time as I am about system resources. I might be able to use critical sections instead of mutexes (don't need inter-process locking), that should be better in terms of system burden, right?
|
|
|
|
|
Not only lighter, but faster. Mutexes are kernel objects, while CS are user-level objects. This means that each operation on a mutex need a costly trip to the kernel, while an operation on a CS doesn't.
[stupid-disclaimer]
You are hereby notified that any unauthorized disclosure, dissemination, distribution, copying or the taking of any action in reliance on the information herein is strictly prohibited.
If you have received this communication in error, please immediately notify the sender and delete this message.
No addressee should forward, print, copy, or otherwise reproduce this message in any manner that would allow it to be viewed by any individual not originally listed as a recipient.
|
|
|
|
|
that is not completly right peterchen... it will coast you cpu time because a mutex is an object of the windows object manager. that means that every additional object "fills" the list so looking up another object will take more time!
Don't try it, just do it!
|
|
|
|
|
That isn't correct. An object handle maps directly into the process' object table. It is an O(1) lookup.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|