|
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
|
|
|
|
|
payal335 wrote: 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
I guess you quoted this from my own article...
Well the shell tray window has to somehow communicate with your window, so I guess it will send a message to your window and that should be minimize.
Try out WM_SHOWWINDOW , WM_SYSCOMMAND . These should help.
|
|
|
|
|
Try out WM_SHOWWINDOW, WM_SYSCOMMAND.
no it is not working
|
|
|
|
|
payal335 wrote: Try out WM_SHOWWINDOW, WM_SYSCOMMAND.
no it is not working
I guess its WM_SIZE with SIZE_MINIMIZED as WPARAM value.
|
|
|
|
|
Hi everyone !!
I've a dialog based application in which I've added a context menu. I had previously defined a menu similar to file menu which works fine.
Recently I added a context menu for one of the dialogs. It is not working
I checked the resource file for any duplicate id's and corrected that also but nothing seems to be helping me.
Here is what I did.
1. Added a context menu in Resource->Menu.
2. Added a context menu command handler for that dialog.
3. Added command handler for each of the ID in this menu.
When I compile, build and run the application it gives no errors but the commands from this context menu are not working.
When I try implementing a context menu with another project it works fine.
Please help
Thanks,
Gajendra
|
|
|
|
|
Can you show a snippet code
|
|
|
|
|
This is in message maps:
ON_COMMAND(ID_DIR_REVN_MENU, On_Dir_Revn_Menu)
-----------------------------------------------------------------------
I've customised the display of context menu to deligate to another function. The context menu code is loaded properly and displayed.
// called from the original OnContextMenu
void CFPLN_PAGE_Dialog::On_Fpln_Revn_Menu(CPoint point)
{
point.x = 90;
point.y = 95;
ClientToScreen(&point);
CMenu m_Fpln_Revn_Menu, *m_Ptr_ContextMenu;
m_Fpln_Revn_Menu.LoadMenu(IDR_FPLN_REVN_MENU);
m_Ptr_ContextMenu = m_Fpln_Revn_Menu.GetSubMenu(0);
ASSERT(m_Fpln_Revn_Menu);
m_Ptr_ContextMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON, point.x, point.y, AfxGetMainWnd());
}
-----------------------------------------------------------------------
Then the command handler code is:
void CFPLN_PAGE_Dialog::On_Dir_Revn_Menu()
{
// TODO: Add your command handler code here
AfxMessageBox("dir revn menu");
}
Is this ok for you to guess something...?
Let me know if you want to know more about the problem. You can mail to me: "gajendra.kashyap@valtech.co.in"
Thanks,
Gajendra
|
|
|
|
|
Whats problem with this code it work,when you run this code you see a contextmenu in 90x95(create a menu in resource and event handler and run ...not problem)but you need to use
CPoint point;<br />
GetCursorPos(&point);
instead point.x&point.y=value.<br />
|
|
|
|
|
The problem is that the commands from context menu are not working. The corresponding mapped function is not called when something is selected in the menu.
Gaj
|
|
|
|
|
Are you sure ids are unique it seems you code doesnt has a problem
|
|
|
|
|
Yes the IDs are unique. I've ResOrgAddin tool to check that. I got the problem just a few mins back.
I don't know if I can load an image here but the I'll try to explain the design.
I've a main dialog for the application, lets call this parent. I've several child dialogs which are displayed overlayed on this parent dialog.
I implemented context menu only for one of the child dialog... it did not work as expected. Although the context menu was displayed the commands were not getting generated ... Surprising.
Now I implemented the contextmenu on the parent dialog and it works as expected jst need to control the display on right dialog. I don't think it is the right way to do... but it is working.
If i could send and handle the commands from the right dialog on which context menu is displayed would be the best situation.
Let me know your valuable opinion.
Thanks,
Gaj
|
|
|
|