Undeclared identifier
-
Hello. I'm having a problem instantiating a COLeVariant object. The snippet of code that fails is: void CMyDoc::CreateIEObject() { m_pIE = new CWebBrowserApp; // this is a COLeDispatchDriver derived class... GOOD m_pIE->CreateDispatch("InternetExplorer.Application"); // GOOD COLeVariant noArg; // this does not work // BAD! m_pIE->Navigate("www.yahoo.com", noArg, noArg, noArg, noArg); // BAD! m_pIE->SetVisible(TRUE); // GOOD } The function is supposed to instantiate an IE browser and go to the webpage specified in Navigate. I get the following compile errors: : error C2065: 'COLeVariant' : undeclared identifier : error C2146: syntax error : missing ';' before identifier 'noArg' : error C2065: 'noArg' : undeclared identifier I have included in file. I have verified that COLeVariant is defined in afxdisp.h. What could I be doing wrong?
manu
-
Hello. I'm having a problem instantiating a COLeVariant object. The snippet of code that fails is: void CMyDoc::CreateIEObject() { m_pIE = new CWebBrowserApp; // this is a COLeDispatchDriver derived class... GOOD m_pIE->CreateDispatch("InternetExplorer.Application"); // GOOD COLeVariant noArg; // this does not work // BAD! m_pIE->Navigate("www.yahoo.com", noArg, noArg, noArg, noArg); // BAD! m_pIE->SetVisible(TRUE); // GOOD } The function is supposed to instantiate an IE browser and go to the webpage specified in Navigate. I get the following compile errors: : error C2065: 'COLeVariant' : undeclared identifier : error C2146: syntax error : missing ';' before identifier 'noArg' : error C2065: 'noArg' : undeclared identifier I have included in file. I have verified that COLeVariant is defined in afxdisp.h. What could I be doing wrong?
manu
manu_2205 wrote:
COLeVariant noArg; // this does not work // BAD!
Because , it must be
CO**l**eVariant
notCO**L**eVariant
.Prasad Notifier using ATL | Operator new[],delete[][^]
-
manu_2205 wrote:
COLeVariant noArg; // this does not work // BAD!
Because , it must be
CO**l**eVariant
notCO**L**eVariant
.Prasad Notifier using ATL | Operator new[],delete[][^]
On previous message he writes
COleVariant
:)
WhiteSky
-
manu_2205 wrote:
COLeVariant noArg; // this does not work // BAD!
Because , it must be
CO**l**eVariant
notCO**L**eVariant
.Prasad Notifier using ATL | Operator new[],delete[][^]
-
manu_2205 wrote:
Still now it generate compile time error
What ? Is the error same as above ?
Prasad Notifier using ATL | Operator new[],delete[][^]
-
manu_2205 wrote:
Still now it generate compile time error
What ? Is the error same as above ?
Prasad Notifier using ATL | Operator new[],delete[][^]
-
Plz help me .My project is near to end .I am just waiting to rectify this error.Plz tell me Either I have to add some another .h file or not ? Or any suggestion . Plz tell
manu
You're surely wrong somewhere. Post the code that you've got currently. Please use the <pre> </pre> tags when posting code.
Nobody can give you wiser advice than yourself. - Cicero ப்ரம்மா
-
You're surely wrong somewhere. Post the code that you've got currently. Please use the <pre> </pre> tags when posting code.
Nobody can give you wiser advice than yourself. - Cicero ப்ரம்மா
void CMyDoc::CreateIEObject() { m_pIE = new CWebBrowserApp; // this is a COLeDispatchDriver derived class... GOOD m_pIE->CreateDispatch("InternetExplorer.Application"); // GOOD COleVariant noArg; // this does not work // BAD! m_pIE->Navigate("www.yahoo.com", noArg, noArg, noArg, noArg); // BAD! m_pIE->SetVisible(TRUE); // GOOD } The function is supposed to instantiate an IE browser and go to the webpage specified in Navigate. I get the following compile errors: : error C2065: 'COLeVariant' : undeclared identifier : error C2146: syntax error : missing ';' before identifier 'noArg' : error C2065: 'noArg' : undeclared identifier I have included in file. I have verified that COleVariant is defined in afxdisp.h. What could I be doing wrong? manu
manu
-
void CMyDoc::CreateIEObject() { m_pIE = new CWebBrowserApp; // this is a COLeDispatchDriver derived class... GOOD m_pIE->CreateDispatch("InternetExplorer.Application"); // GOOD COleVariant noArg; // this does not work // BAD! m_pIE->Navigate("www.yahoo.com", noArg, noArg, noArg, noArg); // BAD! m_pIE->SetVisible(TRUE); // GOOD } The function is supposed to instantiate an IE browser and go to the webpage specified in Navigate. I get the following compile errors: : error C2065: 'COLeVariant' : undeclared identifier : error C2146: syntax error : missing ';' before identifier 'noArg' : error C2065: 'noArg' : undeclared identifier I have included in file. I have verified that COleVariant is defined in afxdisp.h. What could I be doing wrong? manu
manu
#include "afxdisp.h" is what you need. You clearly have not included
afxdisp.h
Nobody can give you wiser advice than yourself. - Cicero ப்ரம்மா
-
#include "afxdisp.h" is what you need. You clearly have not included
afxdisp.h
Nobody can give you wiser advice than yourself. - Cicero ப்ரம்மா
still the problem remains same. I also write a small program that uses 'COleVariant' class. It also have same problem Plz check it to wtite a hello program Plz. I got confused what the problem is . Plz suggest me.If ur code succedd plz send me . Thanx in advance;
manu
-
still the problem remains same. I also write a small program that uses 'COleVariant' class. It also have same problem Plz check it to wtite a hello program Plz. I got confused what the problem is . Plz suggest me.If ur code succedd plz send me . Thanx in advance;
manu
Make sure that you have got the header file afxdisp.h in the default include directory. Try hardcoding the path of the file while including it. I am not able to think of any other reason. Is the compiler warning about afxdisp.h that it is not present?
Nobody can give you wiser advice than yourself. - Cicero ப்ரம்மா
-
Make sure that you have got the header file afxdisp.h in the default include directory. Try hardcoding the path of the file while including it. I am not able to think of any other reason. Is the compiler warning about afxdisp.h that it is not present?
Nobody can give you wiser advice than yourself. - Cicero ப்ரம்மா
-
Ya it is in default include directory. Even i not include the .h file it produce the same error. I have VS2003 and project type is win32 console project. Is this create any problem ?
manu
manu_2205 wrote:
I have VS2003 and project type is win32 console project. Is this create any problem ?
Yes, it will. You need to create porject with
MFC
support.Prasad Notifier using ATL | Operator new[],delete[][^]
-
void CMyDoc::CreateIEObject() { m_pIE = new CWebBrowserApp; // this is a COLeDispatchDriver derived class... GOOD m_pIE->CreateDispatch("InternetExplorer.Application"); // GOOD COleVariant noArg; // this does not work // BAD! m_pIE->Navigate("www.yahoo.com", noArg, noArg, noArg, noArg); // BAD! m_pIE->SetVisible(TRUE); // GOOD } The function is supposed to instantiate an IE browser and go to the webpage specified in Navigate. I get the following compile errors: : error C2065: 'COLeVariant' : undeclared identifier : error C2146: syntax error : missing ';' before identifier 'noArg' : error C2065: 'noArg' : undeclared identifier I have included in file. I have verified that COleVariant is defined in afxdisp.h. What could I be doing wrong? manu
manu
-
Plz help me .My project is near to end .I am just waiting to rectify this error.Plz tell me Either I have to add some another .h file or not ? Or any suggestion . Plz tell
manu
Include afxdisp.h
-
Include afxdisp.h
Hi Cristian, He includes this file but also he gets this error, anyway I dont know why you get vote 1
WhiteSky
-
Hi Cristian, He includes this file but also he gets this error, anyway I dont know why you get vote 1
WhiteSky
Don't bother, is easier to vote 1 than to fix the ***** code, isn't it? :D Anyway, I see a full thread just because COLeVaRIanT is not defined in afxdisp.h or something.