|
Nishant S wrote:
I have heard quite a few people refer to overloading as a kind of static polymorphism
Strange - I don't know where they get this. Can you ask them for reference?
I believe there's a distinction between compile-time polymorphism (templates) and run-time polymorphism (inheritance/virtual functions).
Tomasz Sowinski -- http://www.shooltz.com
Free your mind and your ass will follow.
|
|
|
|
|
Alexandrescu says something of the sort somewhere in his book "Modern C++ Desisgn", if my memory serves me well.
If you think it over, the mechanism by which one or other overload of a given function is selected mimics polymorhpism in which it is the type of the objects involved that drives the selection of the right implementation:
class A{...};
class B:public A{...};
void f(A& a);
A a;
B b;
f(a);
f(b); If now we define an additional overload things change:
class A{...};
class B:public A{...};
void f(A& a);
void f(B& b);
A a;
B b;
f(a);
f(b); IMHO this is a very close compile-time equivalent to virtualness.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
PS: Anyway, I totally agree with you polymorphism is commonly used to refer to the run-time kind.
|
|
|
|
|
You're right. Alexandrescu, "Modern C++ Design", page 264
Tomasz Sowinski -- http://www.shooltz.com
Free your mind and your ass will follow.
|
|
|
|
|
|
Thanks, Dominik pal!
Your reply has resolved all my doubts!
Cheers,
George
|
|
|
|
|
This is used in header files that must be compatible with both C and C++. extern "C" tells the C++ compiler that anything inside the curly braces { } must be treated as C language declarations.
|
|
|
|
|
Thanks, markkuk, my old friend!
Your reply has resolved all my doubts!
Cheers,
George
|
|
|
|
|
I want to install hook to detect Win32 function called, eg. ::TextOut(). What type of hook I should use?
|
|
|
|
|
|
This one on Codeguru rocks,
And I swallow a small raisin.
|
|
|
|
|
Hello everyone!
My problem is as follows...
I've created a RichEditCtrl which contains text with various font sizes,
formatting and the total number of lines exceedes the visible window.
I want to calculate the number of visible lines that are in it.
I'd appriciate any suggestions....
Thanks
|
|
|
|
|
Issue a resize message to the control like this:
DWORD dwEventMask=m_richedit_ayuda.GetEventMask();
dwEventMask|=ENM_REQUESTRESIZE;
m_richedit.SetEventMask(dwEventMask);
m_richedit.RequestResize(); Then, have EM_REQUESTRESIZE handled: there you are provided with the new size. It is up to you to do the actual resizing or not:
void CYourDlg::OnRichEditRequestResize(NMHDR* pNMHDR, LRESULT* pResult)
{
REQRESIZE *pReqResize = reinterpret_cast<REQRESIZE *>(pNMHDR);
CRect rect(pReqResize->rc);
m_richedit_ayuda.SetWindowPos(NULL,0,0,rect.Width(),rect.Height(),SWP_NOMOVE|SWP_NOZORDER);
*pResult = 0;
}
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks that was helpful!!
Ioannis Sarris
|
|
|
|
|
Hello,
I'm already programming my parallel port in c++ with inp and outp to control and external device but I would like to programm it in MFC and I'm realy lost...
I need to write data to port 0x378, read and write on port 0x379 and 0x37a (command register)
Anny help will be very apreciate.
Thank's
Yan
Here my email address: yanwxt@hotmail.com
|
|
|
|
|
hi yannick
as per my knowledge
inp and outp routines only work on windows95
anju
|
|
|
|
|
Tool : Vc++ OS : xp
Bios Information - i'm want source code . please
I need Bios Information ( make date )
Go~~
|
|
|
|
|
If you only need general information about the BIOS you can simply read out the following 3 keys of the registry:
The name of the BIOS:
HKEY_LOCAL_MACHINE\\Enum\\Root\\*PNP0C01\\0000\\ "BIOSName"
Version of the BIOS:
HKEY_LOCAL_MACHINE\\Enum\\Root\\*PNP0C01\\0000\\ "BIOSVersion"
Date of the BIOS:
HKEY_LOCAL_MACHINE\\Enum\\Root\\*PNP0C01\\0000\\ "BIOSDate"
Happy coding!
-Dominik
|
|
|
|
|
|
|
RasSetEntryProperties changes an existing Dialup entry or creates it if none exists by the name provided. If you want to make sure the entry you are creating is fresh, use RasDeleteEntry first.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
Hi all..
i have a problem as follows
i created an VB activex dll which is using another 2 VB activx dlls and one c++ dll can any one tell me
how can i use this VB activex dll in vc++
thanks in advance
anju
|
|
|
|
|
if it's registered, and has a typelib, you can add a wrapper class to your VC project. Project menu / Add to Project / Components And Controls. then VC will create a wrapper class for the ActiveX control that you can use.
-c
For men use, if they have an evil turn, to write it in marble:
and whoso doth us a good turn we write it in dust.
-- Sir Thomas More
|
|
|
|
|
Thak u for reply.
still i have problem
i registered my activex vb dll
and followed your steps it is
giving me the following error
"The file you have selected is not a recognizable component"
can u clarify me it needs to me very urgent
thank u
anju
|
|
|
|
|
I have create a .dll which compiles fine that I am trying to call from within VB. It seems like something must be wrong somewhere because when I call the function it actually creates a new file and it just starts getting huge very fast, soon I had a file that was around 200 meg. Does something look goofy with the one function in you dll?
#include "Append.h"
void __stdcall AppendFile(char *pcMainFile, char *pcAppendThisFile)
{
ifstream inFile;
ofstream outFile;
int c;
inFile.open(pcMainFile, ios::in);
outFile.open(pcAppendThisFile, ios::app);
while(! inFile.eof())
{
c = inFile.get();
if(c != inFile.eof())
{
outFile << (char)c;
}
}
inFile.close();
outFile.close();
}
VB portion is declared as such
Private Declare Function AppendFile Lib "C:\Documents and Settings\User\Desktop\file\AppendFile\Debug\AppendFile.dll" (ByVal pcMainFile As String, ByVal pcAppendThisFile As String)
Private Sub Form_Load()
Call AppendFile("C:\Documents and Settings\User\Desktop\file\hello.txt", "C:\Documents and Settings\User\Desktop\file\nick.txt")
End Sub
Thanks in advance.
Nick Parker
|
|
|
|