|
I have one excel file on my system . Is there any api to connect my MFC application with
the excel file so that I update particular cell from my MFC application and that takes place
in the excel file .also vice versa is true i.e any change in excel file cell I get the event in
my MFC application.
Trioum
|
|
|
|
|
trioum wrote: Is there any api to connect my MFC application with the excel file so that I update particular cell from my MFC application and that takes place in the excel file
That can be accomplished by automating Excel through COM interfaces, even if you don't know the file format.
trioum wrote: also vice versa is true i.e any change in excel file cell I get the event in
my MFC application.
In that aspect the file with the Excel spreadsheet is just a file, i.e. anything you can do with a file you can do with the Excel document.
This means that cannot be asynchronously notified if a file has changed without a filter driver. Even if you had such a filter driver the only thing it could do would be polling whether the data that correspond to the cell you desired has changed or not, or be as basic as telling "the file has changed".
What you can do is tag the modification time of the Excel document and check the file time yourself. If the file has been modified you can open it in Excel, again through automation, and investigate the desired cell for changes.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
trioum wrote: Is there any api to connect my MFC application with
the excel file so that I update particular cell from my MFC application...
See here and here and here and here.
trioum wrote: ...also vice versa is true i.e any change in excel file cell I get the event in
my MFC application.
See the first part of this article.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi,
I need to use EnumDisplayMonitors at my class.
BOOL EnumDisplayMonitors(
HDC hdc, // handle to display DC
LPCRECT lprcClip, // clipping rectangle
MONITORENUMPROC lpfnEnum, // callback function
LPARAM dwData // data for callback function
);
there is MONITORENUMPROC - pointer to a function
BOOL CALLBACK MonitorEnumProc(
HMONITOR hMonitor, // handle to display monitor
HDC hdcMonitor, // handle to monitor DC
LPRECT lprcMonitor, // monitor intersection rectangle
LPARAM dwData // data
);
here is my code.
MONITORENUMPROC pEnumMon;//pointer to my function
//my function
BOOL CALLBACK MyPaintEnumProc(HMONITOR hMonitor,HDC hdc,LPRECT lprcMonitor, LPARAM data){
return true;
}
and now
this->pEnumMon = &MyClassName::MyPaintEnumProc
But it doesn't work.
Error 1 error C2440: '=' : cannot convert from 'BOOL (__stdcall MyClassName::* )(HMONITOR,HDC,LPRECT,LPARAM)' to 'MONITORENUMPROC'
What am I doing wrong?
Thank you very much.
|
|
|
|
|
daavena wrote: Error 1 error C2440: '=' : cannot convert from 'BOOL (__stdcall MyClassName::* )(HMONITOR,HDC,LPRECT,LPARAM)' to 'MONITORENUMPROC'
What am I doing wrong?
Have you declared the member function as static , as I suggested here[^]?
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
You are right.
I forgot declare it as a static function.
It's working.
THANK YOU VERY MUCH.
|
|
|
|
|
initially i am displaying 1 dialog box with two buttons. if user clicks 1st button it will some dialog box and if user clicks 2nd button then it should display the another dialog box.
May i know how to switch from 1 dialog box to another dialog box accordingly?
Thanks in advance
|
|
|
|
|
you are probably talking about the functionality of creating a Wizard using CPropertySheet and CPropertyPage...
Read about CPropertySheet and CPropertyPage these two classes and see if they match your needs.
I hope they will
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Anjali Patil wrote: May i know how to switch from 1 dialog box to another dialog box accordingly?
By clicking the other button, I presume.
Your description is a bit unclear. "Switching from 1 dialog box to another dialog box" implies that both are on the screen simultaneously. This would require one of them to be modeless. Otherwise, as has already been mentioned, a property sheet with two pages seems like your best bet.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi,
Using C++ code, I could not place the flashing caret at the beginning of the Single Line Edit Box after selecting the whole text in it.
In the function
void SetSel(int nStartChar,int nEndChar,BOOL bNoScroll = FALSE );
of CEdit class, the start and end character positions can be given to select some part of the whole text. For full selection, we need to use as SetSel(0, -1);. In both cases, the flashing caret is always at the end of the selection irrespective of the order of the start and end positions in the above function.
In the description of EM_SETSEL Message, I found the below mentioned point.
"The control displays a flashing caret at the end position regardless of the relative values of start and end."
Could anyone help me in this regard.
Thanks,
Kishore
modified on Friday, October 10, 2008 6:54 AM
|
|
|
|
|
What's your question?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
In the Edit Box of MFC, I need to place the cusor at the beginning of the text after selecting the whole text. But by using the SetSel function of CEdit class, I could not get this solved.
So, please suggest me an approach to obtain this behaviour.
Thanks.
|
|
|
|
|
The docs you quoted state that's not the way it works.
You'll have to write your own edit control.
It doesn't make much sense since as soon as you type
all the selected text is going to disappear anyway.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
M Kishore wrote: In the description of EM_SETSEL Message, I found the below mentioned point.
"The control displays a flashing caret at the end position regardless of the relative values of start and end."
Could anyone help me in this regard.
So what do you want us to do about that?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
So, Could anyone help me how to select the whole text and the caret to be at the starting position of the text and the text to be scrolled to the beginning in the single line edit box.
|
|
|
|
|
What happens if you use SetSel(num, 0) where num is the number of characters in the edit control?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I tried in that way also. Even then the whole text is selected and the caret is at the end position.
Reason might be
"Edit controls: The control displays a flashing caret at the end position regardless of the relative values of start and end."
Refer: "ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.WIN32COM.v10.en/shellcc/platform/commctls/editcontrols/editcontrolreference/editcontrolmessages/em_setsel.htm"
So only I asked in my previous message about other procedure without using that message.
Please sugget any other method if you come across.
|
|
|
|
|
Hi All
I want to run my application in background.I set application in startup folder through regeedit.But i want to set visible false for user.I am uesing dailog application.How can i do plz help me?
Thanks in advance
|
|
|
|
|
|
Do you want to hide it of Task Manager?
|
|
|
|
|
Yes i want to hide exe name from task manager.
modified on Monday, October 13, 2008 6:35 AM
|
|
|
|
|
|
how do i display menu bar on a dialog box?
|
|
|
|
|
Create a menu in your resource editor and then add it to your dialog (in "Dialog Properties"). That's how it works in VC6. Pretty sure it's similar in other versions.
|
|
|
|
|