|
Try below code.
Word::_ApplicationPtr wdPtr;<br />
Word::_Application::get_Application( &wdPtr); <br />
if ( NULL == wdPtr ) wdPtr.CreateInstance(__uuidof(Word::Application)); <br />
<br />
for (int i=0; i<wdPtr->Documents->Count; i++) {<br />
Word::_DocumentPtr dPtr = wdPtr->Documents->Item(i);<br />
if ( dPtr->Name == "whatever you are looking for" )<br />
dPtr->Close(); <br />
}
cheers ..milton kb
|
|
|
|
|
Hi guys!!
Have a trouble with the dialog bar!! I created a dialogbar in my application!! But I can't put a bitmap on button on that dialogbar!! Who can show me how!? I thanks very much
|
|
|
|
|
See Here:[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
once a socket is bound to a port...say 2000...how can u check if its freed at the end of the application...is there a command u can use in the command prompt?if it is still bound can u free it from there?
|
|
|
|
|
shuchigo_jane wrote: once a socket is bound to a port...say 2000...how can u check if its freed at the end of the application.
Once you close the socket the port is automatically freed...So take care of closing of socket.
shuchigo_jane wrote: is there a command u can use in the command prompt?
you can check it while tring to bind to the specific port(i mean 2000) is free or not if it is free you can able to bind it.
shuchigo_jane wrote: if it is still bound can u free it from there?
You just can't because the port is available only if it is free and is free after closing the socket binded to that port or killing the application which uses that port.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
is aborting a VC++ app equivalent to killin it?or does it have to be executed till d end?
|
|
|
|
|
shuchigo_jane wrote: is aborting a VC++ app equivalent to killin it?or does it have to be executed till d end?
It terminates the execution forcefully whatever going on
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
what im trying to do is in a listbox when i left click my menu pops up and that allows me to open my other dialog below is the code to get the string i want
CString temp, temp1;
int nIndex = m_list.GetSelectionMark();
temp = m_list.GetItemText(nIndex, 0);
temp1 = m_sBaseFolder;
temp1 += "\\";
temp1 += temp;
i want to pass that string from one class to the other i just cant get it to pass everything ive tryed when my second dialog trys to open it errors so i dont know what im doing wrong. i just need a function that will return temp1.
ps. what is the right way to open a dialod from a menu?
-- modified at 0:23 Thursday 15th June, 2006
|
|
|
|
|
Create the pointer of sencond dialog in the first first dialog so that all the member varbales of seocnd dialog can be initialised from first dialog.
Now when you show get the string pass it to the member varibale of Second Dialog CString varibale and with the same object you can display the dialog.
For eg.
You have two dialogs
CFirstDialog and CSecondDialog and you are having CString varibale in Second Dialog class as m_frstDlgString
In first dialog IMplementation file write:
CSecondDialog *m_sDlg;
<br />
m_sDlg = new CSecondDialog();<br />
m_sDlg->m_frstDlgString = temp1;<br />
m_sDlg->DoModal();<br />
<br />
<br />
Cheers
"Peace of mind through Technology"
-- modified at 0:35 Thursday 15th June, 2006
|
|
|
|
|
You will have to declare a pointer of the first class in the header file of the second dialog(assuming you have a class associated to the dlg's).
Now when you are calling the second dialog do this :
CMySecondDlg *mySec=new CMySecondDlg();
mySec->oldPtr=this;
mysec->DoModal();
(Do not forget to include the header files)
Now if your string is defined as CString myString in the first class:
AfxMessageBox(oldPtr->myString);
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
maybe it is some helpful to you
Main Class is CMain and one child dialog CLocal now you declare this code in child dialogCMain* m_Main = (CMain* )GetParent(); and ues m_Main->(variable)(function)... in main dialog
whitesky
|
|
|
|
|
Hi,
I have an old project at hand and I would like to add some new things to it and compile it into the release file with different name. For example, the old release file is named testing.exe, and I would like to change it to be testnew.exe. What do I need to change in the project to realize it? Is it the only to change project/property/linker/output file?
Thank you very much!
David
-- modified at 0:08 Thursday 15th June, 2006
|
|
|
|
|
David L.S. wrote: I have an old project at hand and I would like to add some new things to it and compile it into the release file with different name. For example, the old release file is named testing.exe, and I would like to change it to be testnew.exe. What do I need to change in the project to realize it?
Just Go into Linker settings of the Project Settings
and change the Output file as $(OutDir)/testnew.exe
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Thanks for your reply. Is it possible to change some code to realize it?
|
|
|
|
|
David wrote: Is it possible to change some code to realize it?
Have you tried the suggestion what given in my previous post..??
no idea... for changing the name of the exe through code.
if you want more accurate so that your exe property pages also revert the changes of the new exe then
go to Resource>Version in case of Windows application.
and modify the internal file name and Original file name
but changes the exe information not actual exe name.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Thanks a lot! It seems the method in your first post is so far the only solution I could find. Thanks again.
David
|
|
|
|
|
David wrote: It seems the method in your first post is so far the only solution I could find.
why we can't change the exe file through code??
Reason may be as follow..
The Exe which is in execution mode is locked,so that no one can change the file/exe name hold br Exe (Here exceptional case is shared resources)..even you can't delete the directory under which your exe reside and is in execution.
When the execution completes then the resources hold by the exe released and you can do whatever you want.
Conclusion is you can change the name of the exe through code of other executable not the same executable which is executing your code of changing the exe name.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
In Menu Project->Settings->Link Tab->In outputFile Name,enter new EXE name.
|
|
|
|
|
A_Laxman answered to the post earlier. You should be reading the post's before posting a new solution to it. Please do not repeat.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
_AnShUmAn_ wrote: You should be reading the post's before posting a new solution to it. Please do not repeat.
Do us all a favour and shut up.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
_AnShUmAn_ wrote: A_Laxman answered to the post earlier. You should be reading the post's before posting a new solution to it. Please do not repeat.
Posting the same information from more than one person does not warrant such a response. In many cases, those posts to which you refer have not been made at the time of responding. For example, I may have a dozen browser windows open, each with a different thread, sometimes to the same thread. If I am replying to several at once, it may be 5-10 minutes between the time I clicked Reply and the time I click Post.
In any case, if the OP receives several responses with the same solution, s/he can be assured that the given solution must be correct.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Yes David,
I acknowledged that .
Thanks for your guidance.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hello everyone,
What is the convenient way to calculate the execution time of a function? The function may be not a long and time consuming function -- only 10 lines in some situation.
thanks in advance,
George
|
|
|
|
|
One of the ways could be to use QueryPerformanceCounter()
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thank you _AnShUmAn_!
I have tried the method, and the results are in LARGE_INTEGER structure. Do you know how to calculate the difference between two LARGE_INTEGER structure variable (the difference of begin time and complete time)? I have tried to use '-' sign, but there are compiling errors.
regards,
George
|
|
|
|