|
Is there some problem in declaring a pointer to the first class in the second one:
ex :
class second : public base
{
void DoSomething()
{
first *pFirst=new first();
pFirst->DoSomethingElse();
DoSomethingElse();
}
}
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
_AnShUmAn_ wrote: Is there some problem in declaring a pointer to the first class in the second one:
Yes because then I would have to pass the pointer into the class. Creating a new instance of the object will only lead to problems. But you did give me an idea, static !
Declaring the function and a few members as static has solved the problem.
|
|
|
|
|
waldermort wrote: Is it at all possible for one class to call a function in another class?
Sure, if those methods (in the other class) are static.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
Can u plz help me to rectify the error.
1)If i write the code as shown below I am getting the correct results
SQLCHAR SQL[] = "SELECT EmployeeID,Salary FROM EMPLOYEE WHERE EmpName='tejaswini'";
2)If I write the code as shown below I am getting an error saying that error in execution.
What is the wrong with my code?
CStirng Str="tejaswini";
SQLCHAR SQL[] = "SELECT EmployeeID,Salary FROM EMPLOYEE WHERE EmpName=Str";
Plz help me.
Thanks in advance;
|
|
|
|
|
tejaswini.g wrote: CStirng Str="tejaswini";
SQLCHAR SQL[] = "SELECT EmployeeID,Salary FROM EMPLOYEE WHERE EmpName=Str";
CString Str;
Str.Format( _T( "SELECT EmployeeID,Salary FROM EMPLOYEE WHERE EmpName=%s" ), _T( "tejaswini" ));
SQLCHAR SQL[] = Str;
|
|
|
|
|
tejaswini.g wrote: What is the wrong with my code?
tejaswini.g wrote: "SELECT EmployeeID,Salary FROM EMPLOYEE WHERE EmpName=Str";
because the SQL engine is executing such query, as is. it is then searching Str as the Employee name...
|
|
|
|
|
Si Str va en el texto entrecomillado el ordenador lo interpreta como texto y no como tu variable.
Desconozco como funciona un SQLCHAR, si el texto fuera un CString deberías ponerlo así...
"SELECT EmployeeID, Salary FROM EMPLOYEE WHERE EmpName='" + Str + "´";
En este caso si cambiará Str por el valor de tu variable, además recuerda que en la sentencia Where EmpName= algo, ese algo tiene que ir entre comillas simples.
Espero haberte ayudado.
|
|
|
|
|
Hablamos inglés aquì señor...
|
|
|
|
|
nave
|
|
|
|
|
i told him that we were speaking english here !
|
|
|
|
|
toxcct wrote: i told him that we were speaking english here !
Quite obviously.
|
|
|
|
|
but which language was that?
nave
|
|
|
|
|
spanish buddy
|
|
|
|
|
gracias
nave
|
|
|
|
|
Thank you.
I tried it and am getting error Cannot convert from class CString to unsigned char[];
I tried to convert 'Str' to char variable as shown below;
CString csStr(Str);
char* pbuff = csStr.GetBuffer(csStr.GetLength());
SQLCHAR SQL[] = "SELECT EmpID,Salary FROM Employee WHERE EmpName='"+pbuff +"'";
Now i am getting the error as "Can not add two pointers"
Plz help me to solve the problem.
Thanks in advance.
|
|
|
|
|
tejaswini.g wrote: SQLCHAR SQL[] = "SELECT EmpID,Salary FROM Employee WHERE EmpName='"+pbuff +"'";
change into this :
SQLCHAR SQL[] = CString("SELECT EmpID,Salary FROM Employee WHERE EmpName='") + csStr + "'";
|
|
|
|
|
I get this error message when i compile and run the CHtmlEdit HTML Table sample application ( http://www.codeproject.com/samples/CHtmlEdit.asp?print=true ) in my VC++ Enterprise edition 6.0 at
BOOL CHtmlView::GetTheaterMode() const
{
ASSERT(m_pBrowserApp != NULL);
VARIANT_BOOL result;
m_pBrowserApp->get_TheaterMode(&result);
return result;
}
Please help.
Regards,
Roxy
|
|
|
|
|
I'm writing a plugin for an application and I don't have the HINSTANCE for my DLL when it's loaded as the application does this in the background. Is there a function within the win32 SDK that allows me to grab the current HINSTANCE? (question refers to non-MFC applications)
|
|
|
|
|
Sydes wrote: HINSTANCE for my DLL when it's loaded as
Try GetModuleHandle()
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Does your DLL not have a DllMain() function?
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi,
i just want to know is there any possibility to include vcl header file in vc++ as that of borlands c++
thanks in advance,
zari
|
|
|
|
|
If you have the header files, you could try it. If they are just standard C++, they may well work.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi all,
I am designing a Dialog Based application using MFC. Now i have created a Edit box dynamically. I want to diaplay some text in it, also dynamically. For which i need the id of the edit box created. How can i set the control id?
Plz help me solve this problem
With Kind Regards
Kenny
|
|
|
|
|
CEdit* pEdit = new CEdit;
pEdit->Create();
pEdit->SetWindowText( "Text" )
|
|
|
|
|
How can we use the SetDlgItemText( ); When you create a Edit box Dynamically?
How are we supposed to create that Control ID.
Regards
Kenny.
|
|
|
|