|
to update applications, use an existing updater...
There are a lot here, but this one is mine. It includes code to close another application (see CInstall::CloseApplication() in Install.cpp). Just copy the code if it does what you need.
Geert
Want to spread the newest version of your software automatically for free? Use Updater!
Visit my website: www.gvhsoftware.org
|
|
|
|
|
DanYELL wrote:
The only thing I cant
figure out is how to close Setup.exe from Update.exe.
So don't bother. Pass the process id of Setup.exe to Update.exe as a parameter, then
a) once Setup.exe has started Update.exe, get Setup.exe to shut itself down
b) the first thing Update.exe does is wait until the process with the passed in process ID is not running (EnumProcesses will help here), then it can do all it needs to.
|
|
|
|
|
Hi
i am trying to migrate my MFC applixcation from VC6 to VC8, i am receiving the following MIDL error does any body have any idea how to resolve this.
.\FNLIST.ODL(106) : error MIDL2072 : inapplicable attribute : [propget] [ Field 'Font' of Dispinterface '_DFnListView' ]
Thanks
Saurabh Gupta
|
|
|
|
|
template <typename T>
inline bool finite(const & T) { return true; }
template<> inline bool finite<double>(double const & d) { return _finite(d) != 0; }
gives an error
error C2912: explicit specialization; 'bool MLib::finite(const double &)' is not a specialization of a function template (VC7)
I guess I have a syntax error here, or a deep misunderstanding of template specialization (or both). What am I doing wrong?
P.S.
would a
template <typename T> finite(T const &) { return true }
inline bool finite(double const & d) { ... }
work as well?
Pandoras Gift #44: Hope. The one that keeps you on suffering. aber.. "Wie gesagt, der Scheiss is' Therapie" boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
template <typename T> inline
bool finite(const & T) { return true; }
template<typename T> inline
bool finite(double const & d) { return _finite(d) != 0; }
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
You have your & in the wrong place. Change the template's param list to (const T& ) . (const & T) means "one parameter named T of type const int& ".
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
You cannot stop me with paramecium alone!
|
|
|
|
|
oah! looks like a typo
Will check tomorrowe (now it's Feierabend )
Pandoras Gift #44: Hope. The one that keeps you on suffering. aber.. "Wie gesagt, der Scheiss is' Therapie" boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
Hi I am trying to migrate my VC6 MFC Application to VS2005 Beta 2
The App. uses a call to AfxLockGlobals but this function seams to be excluded from the new Version of MFC (V8).
Is there any possibility to use this function or there is any alternative for what this function does?
Saurabh Gupta
|
|
|
|
|
I have a .dll that i am writing and cannot use standard MFC classes such as CString to parse a blob of data. So i am using std::string but i have never used this before and am so confused. I need to search a string for a key word. Once i find the keyword, i have to parse the data afterwards to pick out the necessary data that i need.
I am using the find method but just stuck and confused to accomplish my goal. Can anyone offer some examples or help? E.g.
If i have a string that looks like
xxxcdfdftbvbfggbnghghg Name: Todd Shields ccfgfgnfgnrri DOB:091580 hgertrtreggeegegggggggggggg
But i want to get the name and the DOB. There is no standard in terms of how much space is allocated for name or DOB. I just have to find it and get the name and DOB from the string.
Any input is appreciated.
|
|
|
|
|
Something like:
string s = "xxxcdfdftbvbfggbnghghg Name: Todd Shields ccfgfgnfgnrri DOB:091580 hgertrtreggeegegggggggggggg";
int nPos1 = s.find("Name: ");
int nPos2 = s.find("DOB: ");
string name = s.substr(nPos1 + 5, nPos2 - nPos1);
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
typedef std::string::size_type size_type;
std::string name_string = "Name:";
std::string dob_string = "DOB:";
size_type name_index = mystring.find(name_string);
size_type dob_index = mystring.find(dob_string,name_index+name_string.size());
OR
size_type name_index = mystring.find(std::string("Name:"));
size_type dob_index = mystring.find(std::string("DOB:",name_index+4);
Both of the above ass-u-mes all the data is there (no error checking).
You can access indivual characters using operator[], for simple parsing.
// If you need compare
int compare(
size_type p0, // index into mystring
size_type n0, // number of characters to compare
const basic_string& str);
If you want to go back in time, then you can get a C-string pointer by call mystring.c_str().
The just write the parsing code the same as you would in C.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
What would be the return on the find? Would it return -1 if failed?
Where is some decent documentation on this that you would recommend. I have a decent start but i feel i may need some more methods for parsing.
Like for example. If a name is Todd Shields, i have to break up into first name and last name. So i would have to loop through and parse until i get a space and that will be my first name.
How is the operator[] used?
Thanks
|
|
|
|
|
LCI wrote:
What would be the return on the find?
The index/offset of the first character in the string you are searching that matches what you are searching for.
LCI wrote:
Would it return -1 if failed?
It returns std::string::npos, which is -1.
LCI wrote:
How is the operator[] used?
for( size_type i=0; i<mystring.size(); ++i )
char c = mystring[i];
As for parsing; the simpilist method is to use loops, as you suggested.
Documentation:
1) "The C++ Programming Language" by Bjarne Stroustrup (The Creator of C++), whatever the latest vesion is.
2) Search the web for keywords like: "Bjarne Stroustrup", "P.J. PLAUGER" (The guy who (probably) wrote the template library you're using), STL (The Standard Template Library), etc... . There are lots of sights that cover this subject.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Hi,
I have written a class, CWizardSheet, which extends CPropertySheet. It is set to wizard mode. An instance of CWizardSheet, contains several pages, which extend CPropertyPage, so naturally I have to do directive includes for these pages in the CWizardSheetClass. However, CWizardSheet has a variable, info, which I would like each of the pages to be able to access.
I have tried to do a directive include of the CWizardSheet in the pages, but that causes problems because of cyclic redefinition. I have also tried to add a 'set' method in each of the pages so that I can 'send' a pointer to the variable from the CWizardSheet's OnInit() method.
The problem with the second approach is that after I leave a page (clicking next), if I decide to come back to it (clicking back), if I make changes to the variable, it no longer changes the info variable in the CWizardSheet.
To solve this, I have decided that instead of 'setting' the variable in the OnInit() method in the CWizardSheet class, I should do it in another method which is called every time that the wizard changes to another page (set the top level page's variable).
My question is: Is there a method in CPropertySheet that I can override to catch the event when the wizard changes the top page, and if so, how do I use it and is it possible to get a pointer to that page? Other suggestions to solve this problem are also welcome.
Thanks in advance,
-----------------
Genaro
\\\|
_ _
@ @
_\\
--|
_/
|
|
|
|
|
picazo wrote:
However, CWizardSheet has a variable, info, which I would like each of the pages to be able to access.
In the CPropertyPage -derived class, call GetParent() , and cast the result to a pointer to your CPropertySheet derived class.
picazo wrote:
My question is: Is there a method in CPropertySheet that I can override to catch the event when the wizard changes the top page
No, but you can handle OnSetActive in the CPropertyPage -derived class.
|
|
|
|
|
Thank you very much for your response. I had already figured it out, but its good to know that you would have done it the same way.
|
|
|
|
|
Hi,
I'm trying to implement a dialog bar in my MDI application. First, for some reason any ON_BN_CLICKED handler that I add to the CDialogBar derrived class doesn't get handled. The buttons are still greyed out. I have to manually add ON_BN_CLICKED handler to the CMainFrame at which point the function inside CMainFrame never gets called but the one inside CDialogBar does. That's weird.
What I really want is to be able to handle dialog bar commands inside the CDocument. Do I have to route them manually from CMainFrame? I was hoping a DialogBar would behave like a control bar and I could easily add handlers inside the CDocument, but that doesn't look like it.
Thanks.
|
|
|
|
|
Also I have a class that I derrived from CDialogBar. Inside it I have a function to disable my controls that contains something like:
CWnd *test = this->GetDlgItem(IDC_ADDKEYFRAME);
test->EnableWindow(FALSE);
this doesn't disable the button. Why not?
I've also tried adding control variables and initialize them using DDX. The variables get initialized, the HWND value match what I get from GetDlgItem call, but the button never gets disabled.
|
|
|
|
|
I want to get a file name back from the saveFileDialog box and store it as a global variable. What Type should I declare this varialbe as? Seems like the return type for the saveFileDialog file name is String and the compliler is not liking this Type..
Anyone have a simple VC++ .NET example on how to get the user selected file name back from the saveFileDialog box and stored in a variable?
Thanks.
|
|
|
|
|
Here's what I have used:
CString strFile;
CFileDialog fSave(parameters);
if ( fSave.DoModal() == IDOK )
{
strFile = fSave.GetFileName();
}
|
|
|
|
|
For whatever reason, my .NET compiler is not liking the declaration of a variable as CString Type. I wonder if there needs to be included another .h file to be able to use String type?
Compiler does not like this:
CString myFileName;
|
|
|
|
|
I figured out what I was doing wrong.
I did not realize that the return type of the file name is a pointer, so it needs to be declated like this.
String *myFileName;
|
|
|
|
|
I understand what this does, but I was wondering how people felt about it.
Is it better to have incremental linking on or off?
and
Do you, personally, prefer to have incremental linking on or off?
|
|
|
|
|
I have "Incremental linking" on, and "Edit and Continue" off by choice.
Link times are notably smaller (and the only glitch that happens is finding a function that no longer exists). E&C is for veebees.
Pandoras Gift #44: Hope. The one that keeps you on suffering. aber.. "Wie gesagt, der Scheiss is' Therapie" boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
Why is it that when an XML file is has a root node that looks like this:
-(Test xmlns="urn:response"\)
(MyTest)test data(MyTest)
I can't seem to select singlenode on //Test//MyTest to get the text. But if the 'xmlns="urn:response' is removed to look like:
-(Test\)
(MyTest)test data(MyTest)
then i can selectsinglenode and get the text.
How would i read an xml file with root having a namespace definition??
Please Help
|
|
|
|