|
Fabio,
Are you trying to lock to a specific computer?
In that case, use multiple hardware keys and multiple system metrics and allow the program to work if a 'majority' of them are met.
Use hard drive volume numbers, get the MAC address of the network card if there is a network card, use a hash of monitor type name, you could look up modem manufacturer or modem type, memory quantity, sound card manufacturer or type, etc.
You save all these bits of information somewhere, and when you do your check, you allow it to be successful if several of the items are still valid (for example, user might have temporarily used a different monitor, but it is unlikely they constantly add or remove memory or change hard drives around).
This way, you are not dependnet upon one single bit of information that might change, and as a result, constantly issuing new keys to your users unecessarily.
|
|
|
|
|
Hey Blake,
Yeah, trying to lock it to a certain machine. The idea behind the HDD serial was that would stop the user from copying the program to another HDD, and also allow him to change whatever hardware he needed on the machine (video card, monitor, etc.) without having to request a new key. If he changed HDDs, then he would need a new key.
But I have been frustrated by how seemingly complex it has been to retrieve the HDD serial, so I am open to other ideas. Your suggestion is very good, but I don't know how to retrieve any of the information you mentioned. I have not yet searched for it (at work, not much time right now), but do you know of any offhand?
Thanks a ton.
Best Regards
Fabio Miguez
|
|
|
|
|
I am still new at initilization list.
For penSolid.CreatePen(PS_SOLID, 1 RGB(100, 100, 100));
I can initilize with
penSolid(PS_SOLID, 1 RGB(100, 100, 100))
How would I go about Initilization list
fontTimesNR.CreatePointFont(85, "Times New Roman"); ?
The default intialization list is using font.CreateFont();
|
|
|
|
|
If the class in question has a constructor that takes the arguments you want it to, then you're good to go. Unfortunately for you, the only constructor for CFont is the default, which takes no arguments and doesn't really do much of anything. You need to call the appropriate CreateFont * to get an actual font created.
You might want to take a look at GDI+ if you don't need Win95 compatibility - its object model is a lot nicer.
Shog9
I'm not the Jack of Diamonds... I'm not the six of spades.
I don't know what you thought; I'm not your astronaut...
|
|
|
|
|
i have the compiler but after i compile my code i go to execute it and a dos looking window pops up and then goes away
if you have any information that could help me please reply
|
|
|
|
|
I am trying to copy a group of files with the same name, but different extension, but I want to rename them during the copy operation.
If I use the command line, the syntax would be:
copy file.* newfile.*
which works perfectly.
Is there an elegant way to do this using SHFileOperation, which says that "Wildcard characters are not supported" in the destination.
I don't want to have to expand the wildcard in order to copy, and I *really* don't want to open a command window to run a DOS command either! Either I'm missing something obvious, or there seems to be some functionality missing from SHFileOperation....
|
|
|
|
|
Use FindFile to loop through the files indicated by the first wildcard, creating destination filenames based on this. Use CopyFile() or SHFileOperation() as appropriate to perform the copy.
Miszou wrote:
there seems to be some functionality missing from SHFileOperation
I would say the functionality is missing in the shell... renaming multiple files with the same extension does not preserve the original filenames in any way. But, that's the way they did it...
Shog9
I'm not the Jack of Diamonds... I'm not the six of spades.
I don't know what you thought; I'm not your astronaut...
|
|
|
|
|
At my school, we're currently using visual C++ (sorry i said visual basic before by mistake). I recently downloaded the new beta versoin of VC++, and it doesn't seem to have iostream.h. I was wondering where I could find a good source for both iostream, and other libraries I may need in the future.
=P
|
|
|
|
|
iostream is a C++ thing, not VB.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Try iostream without the .h
|
|
|
|
|
#include <iostream>
without the ".h" it should work.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
hmm, I'm not sure if my problem's linked, but I'm getting an unidentified identifier error when i try to use cout or endl. (while using #include <iostream>) It doesn't seem to effect my program wether or not I include iostream (without the .h) at all.
-------------------------------
I'm also having trouble getting string to work.
String Suit1 = "No suit", Suit2 = "No suit";
An error comes up when i run that code, saying I forgot a ; before suit1. and I'm getting syntax error: identifier 'String' whenever it's used in the program other then the initial delaraction of the variables Suit1 and Suit2.
I have #include string.h (with arrows, the post acts weird if i put them in) and there seems to be no problems with it, and I've run similar code on VC 6 with no problem.
-------------------------------
Am I doing something wrong, or is there a problem with my libraries?
=P
|
|
|
|
|
OK. Here's your problem. When the C++ standard was introduced, one thing that was added was namespaces. The standard libraries were placed in namespace std, and the headers that end in .h were deprecated ( i.e. most compilers have them, but they are not standard, they are not part of C++ as define by X3J16 ).
So, to use the string class, for example, you must #include<string), NOT #include<string.h>.
BUT, by doing this, you make part of namespace std visible, which will not give you access to the string class unless you do one of these:
using namespace std; // This is really bad, it includes everything in std, i.e. a lot of stuff you don't know about, and which could change in future compilers
using std::string; // much better, drag the string class alone ( well, and any iostream operators, but that's another story ) into the global namespace
or, in your code:
std::string myString; // best of all in terms of segmentation of namespaces, but a bit cumbersome, I'd use it only for things I am only going to define once or twice.
Also, String with a capital S is wrong. The string class is all lower case.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Thanks a ton, that cleared a lot of stuff up. That seems strange that my school is teaching me outdated material (damn budget). Anyways, I'm still a little confused as to what I do to use cout or endl. Are there replacements, are they in std, etc.?
=P
|
|
|
|
|
Kyle Bishop wrote:
That seems strange that my school is teaching me outdated material (damn budget).
The problem is rarely the budget, it's that teachers are probably a bunch of old C hackers who actually don't know any better.
Kyle Bishop wrote:
Anyways, I'm still a little confused as to what I do to use cout or endl. Are there replacements, are they in std, etc.?
Yes, the standard headers contain the same stuff, they are just in std. So, to extend my example:
#include <iostream>
using std::cout;
using std::endl;
will give you what you're after.
As an aside, don't overuse endl, it does more than send a /r/n, it also flushes the stream, so if you use it in tight loops, performance will suffer.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
|
Kyle,
I don't know if you are using VC++ 6.0 or .net. I also had a similar problem when porting VC++ 6.0 code to 2003 .net.
Some kind soul informed me that I should use "iostream" instead of
"iostream.h" and it worked!
Somehow, MicroSoft dropped the ".h" in later releases of the compiler in this case.
Good Luck.
|
|
|
|
|
thompsons wrote:
Somehow, MicroSoft dropped the ".h" in later releases of the compiler in this case.
This is not the case. In fact, when you are using iostream without .h and in angle brackets, you are using STL's iostream. Microsoft dropped support for streams when they first came up with Visual C++.NET
Found on Bash.org
I'm going to become rich and famous after i invent a device that allows you to stab people in the face over the internet
My Articles
|
|
|
|
|
I am using the VMRPLAYER sample program from DirectX SDK
as a template. I need to use the filename from file opened
as the main stream for the C language fopen command.
I need the full filename (ie: C:\subdirectory\video.vob) in the C program. Where to look and what strmcopy is best.
Thanks
|
|
|
|
|
I try to record and playback application session with help of WH_JOURNALRECORD and WH_JOURNALPLAYBACK hooks but can’t properly playback MOUSEWHEEL event ( rotation direction is ignored)
JournalRecordProc and JournalPlaybackProc hook procedures use LPARAM ( pointer to the EVENTMSG structure ) to get/pass message specific information during recording/playing.
This EVENTMSG structure has no member for WPARAM information, but key indicator and wheel rotation information are stored in WPARAM of WM_MOUSEWHEEL message. The same problem is with all messages with specific WPARAM info.
How I can correctly play WM_MOUSEWHEEL message?
Thanks in advance
Petr
|
|
|
|
|
|
Thanks for reply
But I mean to playback with JournalPlaybackProc :
Syntax
LRESULT CALLBACK JournalPlaybackProc( int code,
WPARAM wParam,
LPARAM lParam
);
Parameters
code
[in] Specifies a code the hook procedure uses to determine how to process the message. If code is less than zero, the hook procedure must pass the message to the CallNextHookEx ..........
wParam
This parameter is not used !!!!!!!!!!!!!!!!!!!.
lParam
[in] Pointer to an EVENTMSG structure that represents a message being processed by the hook procedure.
-----------------------------------------------------------------------
The source of data to fill EVENTMSG structure is WM_MOUSEWHEEL message what returns
WPARAM wParam
LPARAM lParam;
Parameters
wParam
The high-order word indicates the distance the wheel is rotated, expressed in multiples or divisions of WHEEL_DELTA, which is 120. A positive value indicates that the wheel was rotated forward, away from the user; a negative value indicates that the wheel was rotated backward, toward the user.
The low-order word indicates whether various virtual keys are down. This parameter can be one or more of the following values.
MK_CONTROL
The CTRL key is down.
MK_LBUTTON
The left mouse button is down.
MK_MBUTTON
The middle mouse button is down.
MK_RBUTTON
The right mouse button is down.
MK_SHIFT
The SHIFT key is down.
MK_XBUTTON1
Windows 2000/XP: The first X button is down.
MK_XBUTTON2
Windows 2000/XP: The second X button is down.
lParam
The low-order word specifies the x-coordinate of the pointer, relative to the upper-left corner of the screen.
The high-order word specifies the y-coordinate of the pointer, relative to the upper-left corner of the screen.
----------------------------------------------------------------------------
As it turns out there is no place in EVENTMSG for data stored in WM_MOUSEWHEEL message wParam.
typedef struct
{
UINT message;
UINT paramL; // place for x-coordinate
UINT paramH; // place for y-coordinate
DWORD time;
HWND hwnd;} EVENTMSG, *PEVENTMSG;
|
|
|
|
|
Petr P. wrote:
UINT paramL; // place for x-coordinate
UINT paramH; // place for y-coordinate
I don't know if what you stated above is correct. Under my system I follow this logic:
WPARAM is defined as UINT_PTR which in turn is defined as unsigned int
LPARAM is defined as LONG_PTR which in turn is defined as long
UINT is defined as unsigned int
And also under my system sizeof(long) == sizeof(unsigned int). This means that you have enough space in the EVENTMSG structure being passed in to store everything. I doubt there would be any conversion nessisary.
I think all you would have to do is store your WPARAM and LPARAM in paramL and paramH.
Greba,
My lack of content on my home page should be entertaining.
|
|
|
|
|
Interesting idea.
I have tried to put contents of wParam words to high-order words of EVENTMSG ParamL/ParamH .
Regrettably it does not work. System works with X/Y coordinates only .
So problem pending.
BR
Petr
|
|
|
|
|
Problem is solved. I don't find better way, than to mix WH_JOURNALRECORD hooks with interseption of WM_MOUSEWHEEL and sinchronising this messages on play.
|
|
|
|
|