|
In my program I selected Context Help and MFC gladly included the help mecahnism, but I have found it easily to created my HTML Help Files using HTML Help Workshop; which I have done. But I can't fiquire out how to get my program to forget the Wizzard's Help file and accept mine instead. I've seached MSDN and they just tell you how to create it in HTML Workshop, and if you have VS 6.0 They show how to include it in your program. But nothing on VS2008. Anybody know How?
Help!
A C++ programming language novice, but striving to learn
|
|
|
|
|
I need to be able to copy a User's Electronic Serial Number of the CPU he is installing a program on. Does anyone know how to do this?
I'm programming in MFC VS2008.
Thanks for your help.
A C++ programming language novice, but striving to learn
|
|
|
|
|
What if the user disabled that feature in the BIOS?
|
|
|
|
|
I'm tring to prevent multiple system installations.
A C++ programming language novice, but striving to learn
|
|
|
|
|
Larry Mills Sr wrote: I'm tring to prevent multiple system installations.
Could you elaborate? Do you want to prevent multiple copies of the software on the same machine?
|
|
|
|
|
Larry Mills Sr wrote: I'm tring to prevent multiple system installations.
If you mean multiple installations in the same computer... why don't you use the registry?
If not... can you elaborate a bit more your scenario?
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
In the Oil Field business, it's a common practice for a company to take software and reproduce it(copy the CD) and then install it on one of their other office's computers. I want to prevent that! Or prevent it as much as possible.
I was thinking about having the Electronic "Signature" captured and written somewhere where the program knows of it and check for that "Signature" on startup/
A C++ programming language novice, but striving to learn
|
|
|
|
|
Ok, I undersand, but... I don't know if it is going to be possible without access to the computer where the software is going to be installed. I mean, if you have access to the computer, then yes. You should be able to get a parameter with a tiny app and then include the checking of that parameter in your software, if the software is not installed in the computer you allow then it won't install. But if you are giving your software to a client without having access to their computers... how are you going to know in which computer is going to be installed in order to put the restriction in your software?
Even Microsoft must go through the windows original advantage through internet. If they didn't get how to manage about illegal distribution/copying...
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
parameter is in place in the software and email certification is required for installation. Hence my need to certify that the computer they are trying to install the program on has been pre-authorized by the program. If I'm sent an email for activation then I may be able to capture enough information about their system to verify that when a totally different computer is asking for activation then it won't be allowed. My question is, will emailling me provide me with enough information about their system.? I guess I could log the email address and not accept any other. Of course if the same company uses the same email address accross the country(and world) then I wouldn't be able to recognise it.
A C++ programming language novice, but striving to learn
|
|
|
|
|
I don't know which parameters read or how to make it (I am not so skilled as other replying the post) but if I should have to do that I would make a little app to retrieve some data that are computer dependant (the others will help you better with that) in two different versions (only write and read-write capable), create a file and save the info you need in that file. You can then send them the "write-only" asking them to execute it in the target computer and to mail you back the report-file with the info you need before giving the unlocked version of the software.
To lock/unlock the software in a general way you can use an app-external file (like *.ini, *.dat or something like that) that you sent back with almost the same data asked before, but in other order of appearance (for more security). Then add a function at the start up of your application.
In Pseudo-Code it could be something like...
Open the Unlock file
Get saved ComputerInfo_1
Place it in Buffer_1
Get the computer local info in runtime
Save it in buffer_2
if Compare buffer_1 and buffer_2 is true
continue with the app // unlocked version
else
close app // locked version
I would make it like that, is the same principle as the MD5-encrypted password checking when you want to log in into a CISCO router. You first connect "locally" to the router and gives the admin pass and it is saved with MD5, then when you want to log in... you will be asked for pass another time, it will be encrypted as well and the router compares both encrypted results locally (the saved one and the one you are checking atm)
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Hi All!
I have to write my own app to make a living.
I am not an IT pro, or anything close to it.
I do have a 32 bit app that is absoultely better than anyone else's.
So I want to port my 32 bit app to 64 to stay ahead of the competition.
So I go out and shell out big bucks for that 64 bit compiler.
So I hear all this stuff about C# being the "language of the future".
So I believe it.
So I re-write the entire thing in C#.
Now I have a 64 bit dog that runs 40% slower than my 32 bit app.
Now I am pissed.
So I go to the C# forums for some advice. No one helps. I get chastised.
Now I have come to the conclusion that Bill Gates and all C# touts need their faces slapped.
Rant Over
bigchump
edit: some expletives were "deleted".
modified on Thursday, June 12, 2008 5:20 PM
|
|
|
|
|
C# is almost identical to C++, except that C# is the official NET Framework language. Microsoft is trying to promote the NET Framework in a huge way, which is why you read that kind of thing (language of the future). And with programmers, the NET Framework is not very popular, for a number of reasons, speed being mentioned alot. The fundamental problem is that the NET Framework, still interops most of its functionality through the underlying Win32 APIs, and in the process, creates greater dependency, in addition to alot more conditional code jumps. Still, it's an improvement over COM in a number of aspects (like metadata uniquely identifying each assembly and type, garbage collection and memory allocation).
|
|
|
|
|
Baltoro wrote: C# is almost identical to C++, except that C# is the official NET Framework language. Microsoft is trying to promote the NET Framework in a huge way, which is why you read that kind of thing (language of the future). And with programmers, the NET Framework is not very popular, for a number of reasons, speed being mentioned alot. The fundamental problem is that the NET Framework, still interops most of its functionality through the underlying Win32 APIs, and in the process, creates greater dependency, in addition to alot more conditional code jumps. Still, it's an improvement over COM in a number of aspects (like metadata uniquely identifying each assembly and type, garbage collection and memory allocation).
Thanx Baltoro for responding!
I'll boil my problem down into a nutshell:
With C/C++ writing a struct to file was easy.
Now, I have to use "serialization" which causes datafiles to become HUGE with overblown overhead.
My question is really simple: Can I use native c++ and compile to 64 bits????????
That would be a major fix if possible....
Thanx in advance
bigchump
|
|
|
|
|
I actually didn't know the answer to your question, so I searched over at MSDN, and found this: 64-bit Programming with Visual C++[^]
If I was writing a 64-bit application, I'd probably want to have several versions (both C++ and NET Framework, for compatibility reasons). But, I have absolutely no experience doing this, and typically, my initial concepts often turn out to be completely wrong once I've actually gone through the process. I hope you have a sense of humor about this.
|
|
|
|
|
bigchump, I've posted some suggestions in the c# forum regarding your problem, so I don't want to talk about that here.
What I'm interested in is why you seem to think 64 bit applications should automatically run faster?
Firstly, being 64 bit does not mean faster. a 64 bit app means all your number variables (ints/longs) are twice the size (ints become 64 bits large, longs become 128 bits), so they take up more space. More importantly, all pointers to objects become 64 bits long, so also take up more space. This could mean a potential slow down, as there are lots of hidden issues here related to processing 64 bit pointers.
As I understand it, your app is processing a bunch of data. There is a good chance that on a 64 bit system, this is taking up extra space so can't all fit in memory at one time. This means that the data will be swapped out of memory to the disk. This is a huge time cost. You can investigate this by using a tool such as ProcessExplorer from SysInternals[^]. Try looking at the amount of memory your app is using, and more importantly, the number of page faults that occur during the main processing phase of the app. Compare this to your old c++ version.
The primary reason to switch to 64 bit is that it allows you to address a much larger amount of memory. 32 bit systems are limited to 4GB. 64 bit on the other hand can access 17.2 billion gigabytes. This is of most use on high end database servers. 64 bit does not on it's own give a speed improvement. If anything, switching to 64 bit (using native c++) and not doing anything else is likely to hurt performance.
Finally, real pure 64 bit apps will not run on 32 bit operating systems (not even if you have an 64 bit CPU, the actual operating system must be 64 bit. This means you need windows XP x64 or Vista 64). C# code set to compile to "any cpu" is actually a special case that can change and run as 32 or 64 bit depending on the operating system it is being run on. This is a common misunderstanding. Can you confirm exactly what operating system and compiler settings you are using for your 64 bit app?
Simon
|
|
|
|
|
C# is generally slower than C++ but there are techniques for speeding it up. For example,
1. C# does safety checks that you can skip by running sections in unsafe mode. For example if you're doing an operation on every element of an array, C# will check the array bounds on EVERY array access unless you do it in unsafe mode.
2. When you combine value items and reference items, C# will do "boxing" to convert the value item to a reference item, which is very slow. Avoid this.
3. You can speed up a critical section of your C# by writing a C++ DLL to do it, and calling it from C#.
4. XML serialization in C# is easy, but the SOAP format is insane. It's many times larger than it has to be, and the XML generated is unintelligible. Using a custom format that writes out just the data you need will be faster and more compact.
5. If you're processing bitmaps, look at LockBits to get the bitmap data to work on, which is faster than getpixel/setpixel.
|
|
|
|
|
Hi Alan!
My o/s is Vista 64 Ultimate w/ 8 gigs mem.
I have an identical machine (both are Velocity Micro hotrods) with Vista 32 Ultimate and 4 gigs.
I also have two other machines with XP home.
To load and display a 22meg file takes at least 17 seconds on the 32 bit puters and only 6.4 seconds on the 64.
So, for my purposes 64 is much faster even though the 32 bit apps are written in C with some assy. and the 64 is written in C#.
I have ported all my apps to 64 bit C# and all except the one in question have performance gains.
Using binary serialization to write classes to disk causes the file to become 16x larger than it should be.
I THINK YOU SOLVED MY PROBLEM: write a c++ dll to do file reads/writes.
I've never written a dll so I'm sure I'll have some fun with that.
I could use some tips on writing and calling a c++ dll from a C# program.
Thanx again Alan!
I would have never figured out the problem on my own.
|
|
|
|
|
To create a C++ DLL, create a C++ project and choose Win32 Project as the type (Microsoft probably decided a type named "DLL" would make it too easy), click Next, and select DLL as the application type.
Put the following attribute before your C++ functions so they can be seen from C#:
__declspec(dllexport)
To call a function in a C++ DLL from C#, first declare it like this:
[DllImport("User32.dll")]
public extern static int GetScrollInfo( IntPtr hWnd, int fnBar, IntPtr lpsi );
There's lots of info on the web on doing this. Good luck.
|
|
|
|
|
Hi Alan!
Let me thank you again.
The only question I have left is about this Win32 thing.
Does that mean my dll will run @32 bits (or does it even matter)?
thanx
bigchump
|
|
|
|
|
It means it's a standard Windows application, as opposed to MFC or .NET. I've never tried to run one on a 64-bit platform, but it seems like it would have to work to maintain backward compatibility.
|
|
|
|
|
when i spy the dictionary
why some file create,delete,rename or resize,etc couldn't be spy
and when file update quickly it will miss some of them
this is the code from a filespy demo
static void Action(CSpyDlg* dlg)
{
USES_CONVERSION;
HANDLE hDir = CreateFile( CString("d:"),
FILE_LIST_DIRECTORY,
FILE_SHARE_READ|FILE_SHARE_DELETE,
NULL,
OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS|FILE_FLAG_OVERLAPPED,
NULL
);
FILE_NOTIFY_INFORMATION Buffer[1024];
DWORD BytesReturned;
while(ReadDirectoryChangesW(
hDir,
&Buffer,
sizeof(Buffer),
TRUE,
FILE_NOTIFY_CHANGE_SECURITY|
FILE_NOTIFY_CHANGE_CREATION|
FILE_NOTIFY_CHANGE_LAST_ACCESS|
FILE_NOTIFY_CHANGE_LAST_WRITE|
FILE_NOTIFY_CHANGE_SIZE|
FILE_NOTIFY_CHANGE_ATTRIBUTES|
FILE_NOTIFY_CHANGE_DIR_NAME|
FILE_NOTIFY_CHANGE_FILE_NAME,
&BytesReturned,
NULL,
NULL
))
{
CTime tm = CTime::GetCurrentTime();
CString helper_txt;
switch(Buffer[0].Action)
{
case FILE_ACTION_ADDED: helper_txt = "The file was added to the directory"; break;
case FILE_ACTION_REMOVED: helper_txt = "The file was removed from the directory"; break;
case FILE_ACTION_MODIFIED: helper_txt = "The file was modified. This can be a change in the time stamp or attributes."; break;
case FILE_ACTION_RENAMED_OLD_NAME: helper_txt = "The file was renamed and this is the old name."; break;
case FILE_ACTION_RENAMED_NEW_NAME: helper_txt = "The file was renamed and this is the new name."; break;
}
int i=0;
do
{
m_Sec.Lock();
int item = dlg->m_list.InsertItem(dlg->m_list.GetItemCount(), CString(Buffer[i].FileName).Left(Buffer[i].FileNameLength / 2) + " - " + helper_txt );
dlg->m_list.SetItemText(item, 1, tm.Format("%Y/%m/%d/ - %H:%M:%S"));
i++;
m_Sec.Unlock();
}
while (!Buffer[i].NextEntryOffset);
}
}
|
|
|
|
|
|
you're right
this function dosen't work on NTFS volume
when i tried on FAT32 volume it works well
thank you
|
|
|
|
|
i know Change Journal now
but if i wanna it works on NTFS how should i do
still
|
|
|
|
|
|