|
signature of the virtual functions in base and derived
class must be same .but their returns types can be different only if both returns have base and derived relation ship
class CBase
{
virtual CBase* func1(int,char);
};
class CDerived
{
CDerived *func19int,char);
};
never say die
|
|
|
|
|
yes,I think you have understand, I want to know it is right that virtual functions's returns types can be different only if both returns have base and derived relation ship,but follow codes is error in Visual C++ 6.0:
class CBase
{
virtual CBase* func1(int,char);
};
class CDerived:public CBase
{
CDerived *func1(int,char);
};
can you tell me why?
your friend:bobi
|
|
|
|
|
pls tell me the error
Also have define function func1 for base and for derived as well.
never say die
|
|
|
|
|
class CBase
{
virtual CBase* func1(int,char);
};
class CDerived:public CBase
{
CDerived *func1(int,char);
};
I complier codes in VC 6.0 and diplay follow error:
error C2555: 'CDerived::func1' : overriding virtual function differs from 'CBase::func1' only by return type or calling convention
because CDerived derived from CBase, I think CDerived::func1 can return CDerived's pointer.do you think so ?
your friend:bobi
|
|
|
|
|
Hello guys,
Do you know any simple report generator control ?
I need it for printing out some data in Grid form.
I have already seen Johan Rosengrens Report Generator[^] and I am having some issues with it.
Any other recommendations would be appreciated
thanks.
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
-- modified at 5:49 Tuesday 24th January, 2006
|
|
|
|
|
Hi Buddies,
I'm working with MFC Application which contains combo boxes and static text controls. ToolTip is given to static text to expose full text due to space constraints. Below the ComboBox i have static text which pop-ups ToolTip when mouse hovered on it. When i get my ComboBox's drop-down window, it's overlapping on the static text control. If you move your mouse from one item to other item in the ComboBox then i'm getting static text's ToolTip blocking the ComboBox item names.
Is there any way to find out that one window(Static text)is overlapped by other(ComboBox) to fix this problem?
Thanks in advance,
Rajan
|
|
|
|
|
If declare a virtual function as inline
what is the effect on the code.
Vikas Amin
Embin Technology
Bombay
|
|
|
|
|
|
Actually, it won't. "virtual inline" makes no sense and the inline specifier will be ignored.
Virtual functions let an object decide at runtime which particular implementation of a method should be invoked. If you have a pointer to the base object and call a virtual method, there is no way to know at compile time what type of object will be present at the actual time of the call. Hence, the compiler won't be able to figure out which implementation of the function to compile inline.
The two most common elements in the universe are Hydrogen and stupidity. - Harlan Ellison
Awasu 2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
|
Taka Muraoka wrote: Virtual functions let an object decide at runtime which particular implementation of a method should be invoked. If you have a pointer to the base object and call a virtual method, there is no way to know at compile time what type of object will be present at the actual time of the call. Hence, the compiler won't be able to figure out which implementation of the function to compile inline
This is of course, correct. However, if you use an object of the class in a non-polymorphic manner (say, create it on the stack), the compiler can figure out which object is used and inline the function.
Therefore, "virtual inline" actually makes sense, and will not be ignored
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
I need a decrytion routine to decrypt the password, since i can get the username but not the password.
void __fastcall TForm1::SQLConnectionBeforeConnect(TObject *Sender)
{
if (SQLConnection1->LoginPrompt == false)
{
SQLConnection1->Params->Values["User_Name"] = "SYSDBA";
SQLConnection1->Params->Values["Password"] =
Decrypt(SQLConnection1->Params->Values["Password"]);
}
}
Many Thanks,
Priya
|
|
|
|
|
Ask the user who is the system adminstrator of the DB.
-Prakash
|
|
|
|
|
Hi there,
I think you did not really get my question. I need to get a decrypt routine to be able to get the password, as shown in the code. I can get the username but i cannot retrieve the password.
And there is no sys admin for the db for the moment.
Many Thanks,
Priya
|
|
|
|
|
Priya dear,
I understood exactly what you asked for.
if passwords can be decrypted then Oracle will be out of business soon.
Its plain not possible and not rite.
-Prakash
|
|
|
|
|
Hi again,
I reformulate my question:
When using a datamodule and a database (Tdatabase) how can I set the User Name and Password by codes?
Eg: DataModule->Database->.......
Regards,
Priya
|
|
|
|
|
if the database security is not urs, then yous should use some API or function provided by the oracle to change or set the password.
-Prakash
|
|
|
|
|
I am not using Oracle but SQL Server, and i need to get the password. I don't think that has anything to do with the database security. The code i sent you before allows me to retrieve the username but not the password. But i need to get the password so that i can set it in Windows Registry. Where i got the code, there was something mentioned about needing a decrypt routine to be able to get the password. That's what i require.
Thanks,
Priya
|
|
|
|
|
I think you should ask in some SQL Server forum, this forum is dedicated for VC++.
-Prakash
|
|
|
|
|
Aren't there any forum on Boralnd C++ in codeproject? Could you guide to one forum on Borland C++ or SQL Server?
Thanks
|
|
|
|
|
|
How to download files from an FTP server using multiple threads in VC++?Please any one help me.....with code for that...
|
|
|
|
|
i dont think anyone is going to give you the code to do that, but here is the clue, some FTP servers have enabled partial download of the file. So you create multiple FTP connection to the server and initiate partial download of the file from different seciont of the file.
Afer downloading all the sections of the fine in your local machine, concatenate the files.
-Prakash
|
|
|
|
|
Look at CFtpConnection MFC class for a start. Nobody will provide you the full code, try to do it yourself, its not that difficult.
|
|
|
|
|
u just try the below link
(it is with source code & explaination)
i belive it will be helpful for u
http://www.codeproject.com/internet/mdftpclient1.asp
Electron *ptr_Electorn;
Electorn->With Best Regrads(learn, Enjoy);
|
|
|
|