|
toxcct wrote: why still wanting to use a function that doesn't fit the best to your needs ?
I agree. Why try to solve a problem that does not need to exist? Nothing like trying to pound a square peg into a round hole!
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
You are right. He wanted a solution to the problem, which you gave him.
I gave an answer to his question.
But still, it's an interesting question: How to use kbhit in an efficient manner?
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
|
It's better than writing code with 100% CPU utilisation...
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
I think no one understood your joke.
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
Link2006 wrote:Let's take it outside of CP
Jeremy : Please don't.I would love to see this.I'm making the popcorn already.
|
|
|
|
|
It's not your kbhit to consume your processor cycles, but your "while" loop.
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
|
|
|
|
|
so no useful ones for program suspension
what about gets() but how to not to print the key you pressed?
9ine
|
|
|
|
|
hey, did you read my answer ?
getch() works perfectly.
|
|
|
|
|
hi all,
CMAPIAdviseSink::OnNotify(...) will give the notification of email, Please let me know the steps to be followed to get the Notification of Messages when a Mail is Send to your computer.
Uday kiran
|
|
|
|
|
What do you want?
When the user receives a mail he should be notified or when he is sending a mail and the mail is sent then he should be notified?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
hi anshuman,
i want to notify when the user receive a mail from enduser.
Uday kiran
|
|
|
|
|
Hello,
I would like to display formatted text from a file (so, with bold, italic, font size, ...) in a control on my application. So far, not a big problem: I can simply use a rich edit control and load a .rtf file and display it in the control.
But, what I need is that this file will be used by the user to specify how he wants the data to be displayed (so he just edit the file to his own taste) and the control need to display information from a class instance (we suppose that the instance is passed to a subclassed rich edit control). So, I was thinking of a kind of tag system: the user specify a tag where he want a class data to be displayed. Something like <GetParam1> . The way it is linked to the member function need still to be defined but it's not the problem here.
So, I will need to parse the string passed to the control, extract the tags an replace them by the 'output' (converted to text) of the member function (or member variable). I was wondering if things like that don't already exist ?
And also, what bothering me is that sometimes the function returns just an integer that need to be displayed in a table. When the user edit the file and has to put a long tag in a table, that could screw the design of the document. Is there a way to put a kind of 'invisible' tags in the rtf document ? They still need to be 'visible' by the user but won't interfere with the layout...
Or maybe somebody has another suggestion ? Any idea is welcome.
Thank you
|
|
|
|
|
It's possible to insert a comment into a RTF file like so:
{\info{\comment ThisIsEmpty;}}
If I remember you can also customize the tags, but it's been a long time since I used RTF.
|
|
|
|
|
Cedric Moonen wrote: Or maybe somebody has another suggestion ? Any idea is welcome.
What about an XML file? Or maybe I do not have a full understanding of what you are after.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: Or maybe I do not have a full understanding of what you are after.
No, I don't think you get it right. What I would like to do is a kind of report that is configurable by the user. By configurable, I mean the user open Word (or such a kind of 'user-friendly' program) and format the text how he wants (put a title, a section in bold, ...).
In this report, he will insert some predefined tags that let him add 'results' (that are in fact results of a class member function). When starting the program, the specific class instance and the name of the file are passed to a certain control (not really like that but it's a schematic view of the thing). At this time, the 'control' read the file and replace the tags by the adequate value resulting in a call of the member function of the class.
My question is related to "how to deal with the formating, tags and control", not really about how to link a tag to a member function (there are plenty of solutions for that).
So, I was thinking of using a rich edit control and a rtf file (that can be edited by word). The rich edit control takes already care of the transformation rtf format to formated text. But I am a little bit stuck on how am I gonna manage the tags (specifically if they need to be placed in small 'cells').
Any idea ? Of course, this must stay user-firendly for the end user.
|
|
|
|
|
hi,
i have develop a small win32 application for reading Partition Boot sector
for NTFS. Actually the structure size is 512 bytes. But during run time, it
generates 528 bytes via sizeof() operator. the structure shows
<pre>
struct BootSector
{
char chJumpInstruction[3];
LONGLONG n64OEMId;
struct BPB
{
WORD wBytesPerSector;
BYTE chSectorPerCluster;
WORD wReservedSectors;
BYTE chReserved[3];
WORD wUnUsed1;
BYTE chMediaDescriptor;
WORD wUnUsed2;
WORD wSectorPerTrack;
WORD wNumberOfHeads;
DWORD dwHiddenSectors;
DWORD dwUnUsed3;
DWORD dwUnUsed4;
LONGLONG n64TotalSectors;
LONGLONG n64MFTLogicalClusterNumber;
LONGLONG n64MFTMirrorLogicalClustNum;
DWORD dwClusterFileRecordSegment;
DWORD dwClusterIndexBlock;
LONGLONG n64VolumeSerialNumber;
DWORD dwCheckSum;
}bpb;
char chBootStrapCode[426];
WORD wEndOfSectorMarker;
};
</pre>
OS: Windows XP
IDE : VC++ 6.0
I am waiting for your valuable reply.
Vichu
|
|
|
|
|
#pragma pack(1)
struct BootSector {
};
#pragma pack()
Maxwell Chen
|
|
|
|
|
That's because of member structure alignment: your compiler will align the members of the structure on some specific boundaries (e.g. on 8 or 4 bytes boundaries). This is done to maximize the speed: if a variable is on an boundary, it will require two instructions to get it from memory instead of one.
If you want to force your compiler to disable alignment, wrap your structure around #pragma:
#pragma pack(1)
#pragma pack // to reset to default
Note: I'm not sure anymore about the syntax, you'll have to check that.
|
|
|
|
|
Thank you Moonen and Chen.The problem sloved using #pragma pack .
Vichu
|
|
|
|
|
hello!! can anyone tell me how to get the Manufacturer's serial number (and not the volume number) of Hard disk using C++? i am trying to retrive the hard disk serial number while using Windows9X. i have seen a code which does the same thing, but it does not work for windows9X. can anyone give me any information about this?? thanks..
-vijay
|
|
|
|
|
|
aroli vijay wrote: i have seen a code which does the same thing, but it does not work for windows9X. can anyone give me any information about this??
So shouldn't we know what this is so as not to suggest something you've already tried?
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
i want to know which windows message is recieved by my Dialog based application that forces it to minmize
as such Show desktop or Windows Logo +D would minimize all the window to the taskbar , But the thing is that i want to handle it differently
So if i could find out which message it sends to me
i.e. in terms of WM_.....
SO THAT I COULD OVERIDE IT
One more thing is that i am able to get the control of the first (indows Logo +D ) i.e. int the handler of
WM_SIZE IN THAT wparam= SIZE_MINIMZED
IT WORKS TOO but as such when i m pressing it the second time without doing any operation than i am not able to handle it
in WM_SIZE with Wparam= SIZE_MAXIMIZE
i don't know how but my application gets popup and is displayed in an unwanted manner.
payal
|
|
|
|
|
payal335 wrote: want to know which windows message is recieved by my Dialog based application that forces it to minmize
as such Show desktop or Windows Logo +D would minimize all the window to the taskbar , But the thing is that i want to handle it differently
So if i could find out which message it sends to me
Did you try WM_SYSCOMMAND with SC_MINIMIZE .
|
|
|
|
|
this does not work as it works only when we try to minimize our application from the task bar by click in on our application area on the task bar
the thing is that the Shell_TrayWnd program sends message to all the application to minimze
val
/*MinAll*/ 415,
/*MaxAll*/ 416,
accordingly
static HWND hShellWnd = ::FindWindow(_T("Shell_TrayWnd"), NULL);
if(hShellWnd != NULL)
::PostMessage(hShellWnd, WM_COMMAND, MAKELONG(415, 0), NULL);//for minimizing
::PostMessage(hShellWnd, WM_COMMAND, MAKELONG(416, 0), NULL);//for maximizing
This stuff will minimize all the window
payal
Developer
|
|
|
|