|
What you're thinking of is an app bar. Check out MSDN as there are a few pages on writing them. I've also seen articles in past MSDN magazines with MFC code for writing them too.
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Pinky, are you pondering what I'm pondering?
I think so Brain, but if we shaved our heads, we'd look like weasels!
|
|
|
|
|
My project needs to split a 20 page pdf file to 20 single page pdf files, I don't have any clue in doing it, could anyone help me in accomplish it, thanks in advance.
|
|
|
|
|
or: is it a bug?
We develop with .net 2003 & develop services.
Services run a long time, and occasionally crash.
We are having a heck of a time getting DrWatson to work for us. He was our friend, before we moved onto C++ .NET2003 but seems not to like us anymore.
Anyhow, we're clueless on the matter.
I'd like to know your strategy for dealing with an application that needs to be up and running all the time, and when it crashes we need to record it and restart it.
Anyhow, once we started to use .net/2003 we lost this. We never used the first .net either.
We need to automagically record dump files and be able to interpret later.
Help!
Thanks in advance.
P.S. Ship day in 2 days.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
|
|
Hi,
In this situation I would use the SetUnhandledExceptionFilter API to set up an exception filter and then within your exception filter function you can use MiniDumpWriteDump to write a dump of your problem service. You can then open the mdmp file up in VS.NET press F5 and you will be at the point where your program crashed.
Hope this helps
Ceri
|
|
|
|
|
Hey y'all....
Thanks for the info. We ended up going for the auto-minidump thingy. We like this since it doesn't matter whether DrWatson is installed....
Anyhow, thanks, 2 days to ship, and we've got one more weapon for finding crashes!
Thanks.
P.S. If you wanna beta test our stuff -- High-class audio/video/text/appsharing from a windows client -- come visit our beta site www.videomonkeys.com[^]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
Does anyone know how to make this in assembler, you know using the asm partialy in the c++ file:
#include <iostream>
#include <iomanip>
#include <ctime>
using namespace std;
main()
{
int a = 1;
int b = a+1;
int c = b+1;
int d = c+1;
int e = d+1;
int f = e+1;
time_t start;
time_t end;
time(&start);
for (a=1;a <= 47;a++)
{
for (b=a+1;b <= 48;b++)
{
for (c=b+1;c <= 49;c++)
{
for (d=c+1;d <= 50;d++)
{
for (e=d+1;e <= 51;e++)
{
for (f=e+1;f <= 52;f++)
{
// cout << setw(8) << a << setw(8) << b << setw(8) << c << setw(8) << d << setw(8) << e << setw(8) << f <<endl;
}
}
}
}
}
}
time(&end);
system("cls");
cout << "started:" << ctime(&start);
cout << "ended:" << ctime(&end);
system("pause");
return 0;
}
I only need the looping in assembler.
NOTE: DON'T DO THIS IF YOU DON'T WANT TO!!!
OR IF YOU DON'T HAVE TIME!!!
Old United Airlines Brochure:
If you cannot read this please ask a superintendent to help you... LOL, for real!!!
|
|
|
|
|
Why Assembler?
The performance problem is the endl. They are very slow since they also flush the IO stream.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
I just want to know how much faster is assembler.
Old United Airlines Brochure:
If you cannot read this please ask a superintendent to help you... LOL, for real!!!
|
|
|
|
|
Due to the i/o, any performance increase in assembler will be negligable. For simply logic like you're doing, a performance increase is unlikely. It may actually be slower due to lack of pipeline optimization.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Well, doing the looping in assembler isn't that hard, and here's a tip: to see how to do new things in assembler, just write what you want in C++, run it in the debugger with a breakpoint on the first line, right-click and select "View Disassembly". Then you can see what the compiler does. But anyways, here's how to do a basic loop in inline assembler (x86):
int main( int argc, char * argv[] )
{
int i = 0;
int j = 1;
__asm
{
mov i, 0
loopstart:
cmp i, 5
jge loopend
mov eax, [dword ptr j]
imul eax, 2
mov [dword ptr j], eax
inc i
jmp loopstart
loopend:
}
return 0;
}
Anyways, the other guys are probably right. Don't try to optimize what you don't need to, but if you are just curious about assmebly, then by all means keep learning. I just wanted to actually answer your question.
Chris Richardson
|
|
|
|
|
Thankyou very much, I wanted to see which one would be faster just for fun since I never got to learning assembler and would just see if I would have missed anything but I guess not, I just wanted to see for real if assembler was as fast as it was supposed to, thankyou for taking the time to answer the question. :p
Old United Airlines Brochure:
If you cannot read this please ask a superintendent to help you... LOL, for real!!!
|
|
|
|
|
Snyp wrote:
I just wanted to see for real if assembler was as fast as it was supposed to, thankyou for taking the time to answer the question
The endl is certainly the problem, as has been said. I just wanted to add that ALL code is assembler, it just gets generated by the compiler. So it's only faster when a human can write assembler better than the compiler can.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
How can you make a start up program?? I just don't know where to start...
Old United Airlines Brochure:
If you cannot read this please ask a superintendent to help you... LOL, for real!!!
|
|
|
|
|
Hmm..
I can't really understand what you mean. If you want to create a program that runs automatically at start-up, you just build the program and add it's shorcut to the 'Startup' folder of your Start->Programs.
Alternatively you can write a registry entry to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run. See the example entries in that key and create a new key for your program.
If you are planning to create a Win32 service, which starts on an NT/2k/XP (or networked 98/Me) machine before the user logs in, then I can point you to a starting location. The easiest way is to follow the guidelines of Xiangyang Liu's article Start Your Windows Programs From An NT Service[^]
Otherwise, you might want to look up other articles in the MFC/C++->System->Services section of CodeProject.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
No I'm trying to make a startup manager program. You know a program to manage which program starts up and which doesn't, I know you do this through the registry though and the startup folder in the main menu.
Old United Airlines Brochure:
If you cannot read this please ask a superintendent to help you... LOL, for real!!!
|
|
|
|
|
Ahh, ok..
Following the same ideology: create a program that accesses the registry, reads and alters the values of the key mentioned in my previous post.
To utilize the registry, you can either use Platform SDK's registry functions (Search 'Registry Functions' from MSDN), or alternatively, use ATL and it's CRegKey class.
You don't need to fiddle with the StartUp folder if you use the registry entries. Remember that doing this may cause your program to function funnily, so always take a backup of your registry before using the registry functions
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
i wanna get the first sector of hard disk ? which function can i use to appoarch this.
thanks.
|
|
|
|
|
Check out CPhysicalDiskFile, part of the Win32 Foundation Class (WFC). See links below.
www.samblackburn.com/wfc/CPhysicalDiskFile.htm
www.samblackburn.com/wfc/
Mike
|
|
|
|
|
i wanna create 100 buttons in dialog with code and when clicking one button, it will display a message with the content is the id of the button.
help me please
|
|
|
|
|
can you please explain a bit furthur...
Old United Airlines Brochure:
If you cannot read this please ask a superintendent to help you... LOL, for real!!!
|
|
|
|
|
Creating code-wise buttons requires several steps:
1. Add CButton (or derived) member variables to the dialog class's header file. You can use an array here if you want.
2. For each member variable/array member, call it's Create member method. See MSDN and CButton for parameters of this function.
3. When all buttons are created, you need to show them by using ShowWindow method.
4. Either add a message-map entry to your application for every button ID (ON_BN_CLICKED) or overwrite the window procedure of the application. Now display a message box using AfxMessageBox global method. If you want to map all control IDs to a single handler, you need to use a ON_CONTROL_RANGE message map entry. See MSDN for more details.
To customize the message of the message box, create a CString object and call it's 'Format' to do printf-style formatting for the string. You need to get the ID from the message. Buttons, when clicked, send BN_CLICKED message to the parent. In this message, the control ID is in the low-order word of wParam. See MSDN for more details.
I hope this'll help you get started
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
How do I copy/convert a character array to a std::string?
Thanks for any insight.
William
Fortes in fide et opere!
|
|
|
|
|
1. Create a string object
2. Use it's member method 'operator +=' to append characters to string, specifying the start of the array as the parameter.
Example:
#include <string>
using namespace std;
<DIV>
... Later in the code...
<DIV>
<DIV>
string myString;
<DIV>
myString += &charArray[0];
<DIV>
Not completely sure if this will work, haven't tested it. But according to the Standard C++ Library Reference, it should go like this
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|