|
yes... i used ShellExecute.
G.Paulraj
|
|
|
|
|
I am getting this message:
"This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information."
I see there's a fix for Windows XP, can that be applied to a windows nt/2003 server or is there another fix for this machine?
|
|
|
|
|
Do you have source code for this program?
or Are you getting this error in specific build ( Debug Vs Release)?
|
|
|
|
|
I have source code for the program and am getting the error in the release build. Actually I haven't been able to build a debug version. I get link errors and as yet haven't made the effort to get the debug build to work.
|
|
|
|
|
What's the linker error you are getting in your debug build?
Thx
AL
|
|
|
|
|
Actually, after I responded to your last post I took the time to fix the linker errors. Now it builds and runs. But more generally I seem to get this effect recently when I have a bug in my app. Then when I go to debug, it traps to some debug hook location. Since I've been working with VS for about a year now, this is new to me. So I'm not sure what to do next to debug since it's not breaking in a way that I can see a trace of how the program got to this point. The old tried and true approach is to scatter printf statements around and try to zero in on the trouble spot. That generally seems to work. Any suggestions are welcome.
Thanks
|
|
|
|
|
Hey
I have a variable,
char * p
which could sometimes have a string or sometimes
it will be empty.
How to check whether "p" has a string in it or not?
I see that its not possible to do something like,
if(p != "")
{
}
Thanks
|
|
|
|
|
Perhaps you could use
if(*p = 0); But then this assumes you initialize the pointer when it is emptied.
char* p = NULL;
p = &some_char_array;
p = NULL;
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
krmed wrote: if(*p = 0);
Don't you mean == there?
|
|
|
|
|
Yes, of course! Just typed too fast.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
If you set p equal to NULL and then dereference it with *p, you'll get a crash. Maybe if you set *p = '\0' or *p = "\0".
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
you may check for an empty string with
if (strlen(p)==0)
{
}
the above check, of course, assumes p pointing to a valid string (empty string is a valid one).
i.e. such code doesn't check if p is a valid pointer, to spot the difference, try:
char *p, *q;
p="";
q=NULL;
printf("strlen(p)=%d\n", strlen(p));
printf("strlen(q)=%d\n", strlen(q));
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Why not use a string type?
There you can check easily.
However, if you have to use a char *, then you have to care about setting the pointer to NULL or to a '\0' char. this would be the end of a string. As you like.
The cleaner version, I would say, would be to use a string object.
Cheers
You have the thought that modern physics just relay on assumptions, that somehow depends on a smile of a cat, which isn’t there.( Albert Einstein)
|
|
|
|
|
In my PropertyPage header I have this declaration:
#include "CookItDBDoc.h"
// CSpecial2Page1 dialog
class CSpecial2Page1 : public CBCGPPropertyPage
{
DECLARE_DYNAMIC(CSpecial2Page1)
public:
CSpecial2Page1();
//CWnd* pParent = NULL, int nDlg = 0, CString csDlgName = ""); // standard constructor
virtual ~CSpecial2Page1();
void RetFromGetSpecialMealDlg(CString csFileName);
// Attributes
public:
CCookItDBDoc* GetDocument() const;
...
}
============> in .cpp file <========================
void CSpecial2Page1::RetFromGetSpecialMealDlg(CString csFileName)
{
m_csFileName = csFileName;
FileReadCatMenuXML(m_csFileName);
FileReadSpecialMenuXML(m_cMenuData.m_csFullFilePath);
CSpecial2* pPS = (CSpecial2*)GetParent();
pPS->SetSpecial(m_cSpecialData);
pPS->SetMenuData(m_cMenuData);
SetDlgItemText(IDC_SELDRINKS,m_cSpecialData.m_csSpecialOccassionName);
FileReadDrinkMenuXML(m_cSpecialData.m_csDrinkFilePath);
InsertItemsDrink();
GetDocument()->OnNewSpecialDrink(m_vDrink, m_cSpecialData.m_csSpecialOccassionName);
}
the error is this:
1>Linking...
1>Special2Page1.obj : error LNK2019: unresolved external symbol "public: class CCookItDBDoc * __thiscall CSpecial2Page1::GetDocument(void)const " (?GetDocument@CSpecial2Page1@@QBEPAVCCookItDBDoc@@XZ) referenced in function "public: void __thiscall CSpecial2Page1::RetFromGetSpecialMealDlg(class ATL::CStringT<char,class StrTraitMFC<char,class ATL::ChTraitsCRT<char> > >)" (?RetFromGetSpecialMealDlg@CSpecial2Page1@@QAEXV?$CStringT@DV?$StrTraitMFC@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z)
1>C:\Users\Larry A Mills Sr\Documents\Visual Studio 2008\Projects\CookItDB\Debug\CookItDB.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://c:\Users\Larry A Mills Sr\Documents\Visual Studio 2008\Projects\CookItDB\CookItDB\Debug\BuildLog.htm"
1>CookItDB - 2 error(s), 0 warning(s)
I thought maybe I had mispelled something so I checked:
in Doc header:
void OnNewSpecialDrink(CDrinkDataVec vData, CString csMealPlan);
in Doc cpp:
// CCookItDBDoc commands
void CCookItDBDoc::OnNewSpecialDrink(CDrinkDataVec vData, CString csMealPlan)
{
m_vDrink = vData;
CDrinkData cData;
int nIndex = 0;
int nTotal = m_vDrink.m_vDrinkData.size();
.....
}
the problem is with this:
GetDocument()->OnNewSpecialDrink(m_vDrink, m_cSpecialData.m_csSpecialOccassionName);
specifically this:
CCookItDBDoc* GetDocument() const;
I do NOT understand why this is so does anyone else?
A C++ programming language novice, but striving to learn
|
|
|
|
|
Your CSpecial2Page1 is apparently derived from a class you derived from CPropertyPage, and that class does not have a GetDocument method.
Unless you've defined that method in your CBCGPPropertyPage class, it doesn't exist and that's why you get the error.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
I thought by my putting the #include CCookItDBDoc.h in the prpopertyPage header that I would be able to jump to a function(Non-static) within the CCookItDBDoc class. I guess you can't do it that way. How would you do it?
A C++ programming language novice, but striving to learn
|
|
|
|
|
Including the header only provides the declaration of the class. Non-static members do not actually exist except within an instance of the class itself.
You probably already have a document instance (CYourAppDoc) somwhere, so you need to provide a pointer to that existing instance in order to use its methods. The existing instance contains all of the variables (with their appropriate values), so if you were to create a new instance in your propert page class, it would be a different instance with different values.
One way this is done with a dialog box would be to have a button that you click to create the dialog and the handler for that button is in the document. The dialog header file might contain something like
CYourAppDoc* m_pMyDocPtr; Then when the button is clicked the handler (in the doc class) might have something like this:
CMyDialog myDlg;
myDlg.m_pMyDocPtr = this;
myDlg.DoModal()
Now in the dialog, you can access the doc data and methods by using
m_pDocPtr->DocFunction1();
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Yes, I know that, but how would I do that with a CDocument and a CPropertyPage?
A C++ programming language novice, but striving to learn
|
|
|
|
|
The principal is still the same - pass a pointer to your document into your property pages. You may want to pass it to the property sheet and then have the sheet pass it to the pages. If you create your pages/sheet from a view, your view probably also has a pointer to the document.
Good luck.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Thanks
A C++ programming language novice, but striving to learn
|
|
|
|
|
Can any one tell me what is the mistake i have did in below line of code?
int iPrimaryLang[4]={LANG_ENGLISH, LANG_BENGALI, LANG_ORIYA, LANG_HINDI};
I am getting compiler error C2059, C2334.
Regards,
lg
lgatcodeproject
|
|
|
|
|
|
Hi,
You might also post the code above.
I think (based on error C2334 ) you missed ': or {'; somewhere.
At least google tells you that: http://msdn.microsoft.com/en-us/library/f0swb231.aspx[^]
Cheers
You have the thought that modern physics just relay on assumptions, that somehow depends on a smile of a cat, which isn’t there.( Albert Einstein)
|
|
|
|
|
It might be an idea to quote more of the error than just its code. Not all of us have comitted them to memory. Make it easy for people to answer your question and more people are likely to reply.
Steve
|
|
|
|
|
Actually the only reply he needs is: ask google
Cheers
You have the thought that modern physics just relay on assumptions, that somehow depends on a smile of a cat, which isn’t there.( Albert Einstein)
|
|
|
|