|
I want to know : what's the meaning and concept of implementation and interface in the c++ programming?
I have read it but I have not understandit.
Thank you for your help.
|
|
|
|
|
Maybe you should try another book. Have you checked Bruce Eckel's Thinking in C++[^], which is freely downloadable?
That said, I can try to roughly explain what interface and implementation mean. Consider some class, for instance std::string . The interface is the public contract made between you and the class, by which you know wich member functions are exposed and how to use them. Implementation comes to the actual code the author of the class has written to honor this interface: so, std::string::apend is precisely defined for you to use, but is can be implemented in a number of different ways.
This general concept of interface vs implementation is applied in many contexts. You'll probably find it when dealing with abstract base classes, a very similar concept to that of interface in Java, in case you know that language.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
C++ is a very powerful programming language in the fact that it supports the object-oriented paradigm including the interface/implementation.
Essentially, the client only seens the interface of an object class. The implementation is not visible and should not matter in regard to the client.
Kuphryn
|
|
|
|
|
Hi Guys,
In My application i have to create a List control with Each column having different Fonts.Well I have subclassed the control and im Able to ownerdraw the subItems...Its works fine..But now my problem is that I have to display Icon in reportstyle..
But when im Using LoadIcon to load from resource and then displaying using pDC->DrawIcon(, the icon size is very large....I want 16*16 size icon...
Anyidea how to do in Ownerdraw list ctrl
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|
|
Perhaps it's not the fastest solution, but the Windows API function DrawIconEx lets you specify the size of the icon.
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Hi,
is there any way to create forms with c++ insert this forms to the programm Outlook, so that a user can call this form from a menu.
I know that in Outlook is a way to do this, but I have to do it from another programm.
For this themes I found concepts as automation and COM but no
background for this.
Chris
|
|
|
|
|
In my 'Globals' folder, i've got a global object MyObj that i want to use by all classes. I get the link error:
error LNK2005: "struct MyStruct MyObj" (?ssObj@@3UStkStruct@@A) already defined in Calculations.obj
Debug/Enum01.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
This error occurs if i #include "GlobalVariables.h" in each class.
any ideas ???
thanx in advance
|
|
|
|
|
#if !defined MYHEADER__H<br />
#define MYHEADER__H<br />
<br />
int gnMyvar;<br />
<br />
#else<br />
<br />
extern int gnMyVar;<br />
<br />
#endif
if MYHEADER__H, the name of the header file changed slightly , a unique name, is not set, set it and declare the global variable, if it is set then use the extern keyword.
"The greatest mistake you can make in life is to be continually fearing you will make one." - Elbert Hubbard
|
|
|
|
|
that's because you probably have something like
MyStruct MyObj;
in the header - that means compiler generated as many instances as you have cpp files where you included this header (directly or indirectly) and then he cannot decide which one he have to use.
You can either use microsoft specific way (hope it will work for classes, I never tried it)
__declspec( selectany ) MyStruct MyObj;
or define it specifically in one cpp (can be special for that or stdafx.cpp can also help) and just refer to this in header (extern)
or you can look to the singleton pattern - if it is what you really want.
hope this helps
|
|
|
|
|
Anonymous wrote:
This error occurs if i #include "GlobalVariables.h" in each class.
I have NEVER found it a good practice to declare variables in a header file. Sure, you can be clever and use a set of #ifdef... statements in a header, but this ends up hiding your true intent, although syntactically it works just fine.
I would suggest (as a regular practice) to declare your global vars at the beginning of some main file outside the scope of anything (to make them global) and then explicitly use extern in all the other source files where you know you need that global variable.
That makes it very specific as to what you are doing, and when you (or someone else) ever needs to read that file and try to find something, they won't have to trace through a set of header files looking for the proper setting of the #defines.
Dave
"You can say that again." -- Dept. of Redundancy Dept.
|
|
|
|
|
In my application there is a Progress Bar in the main Dialog , which needs to be updated when a process is running, its working fine if single thread is running, but updation is not happening incase of multiple Threads. (Main Thread should update the Progress Ctrl, and the counter will be updated by worker thread).
What could be the reason for this behaviour. Any suggesstions.
Thanks in advance.
Warm Regards,
KKR
|
|
|
|
|
One solution is messages. Send messages to the main thread and have it update the progress control.
Kuphryn
|
|
|
|
|
I have problem in Changing the tray icon.I am using two class.
1.CTrayMenu and 2.CConnectionMgr.
In WinMain(server) I create an instance of CTrayMenu Icon and started the trayicon when program begins
But I can't change the tray icon when client connected to server.I want to modify the tray icon.
here is some part of my code...
Main Program
----------------
HANDLE mainHandle;
mainHandle = CreateSemaphore(NULL,0,1,NULL);
CTrayMenu *TrayMnu = new CTrayMenu(hInstance);
TrayMnu->start();
TrayMnu->m_pConnectionMgr = new CConnectionMgr(hInstance, mainHandle);
CTrayMenu Class
-----------------
void CTrayMenu::SendTrayMsg(DWORD msg, BOOL flash)
{
// Create the tray icon message
m_nid.hWnd = m_hwnd;
m_nid.cbSize = sizeof(m_nid);
m_nid.uID = IDI_WINTRAY; // never changes after construction
m_nid.hIcon = flash ? m_flash_icon : m_tray_icon;
m_nid.uFlags = NIF_ICON | NIF_MESSAGE;
m_nid.uCallbackMessage = WM_TRAYNOTIFY;
if (LoadString(hAppInstance, IDI_WINTRAY, m_nid.szTip, sizeof(m_nid.szTip)))
{
m_nid.uFlags |= NIF_TIP;
}
// Send the message
if (Shell_NotifyIcon(msg, &m_nid))
{
// Set the enabled/disabled state of the menu items
}
}
What will I do?
Help me...........
Thanks
boby
|
|
|
|
|
Hi!!!
I am trying to load a jpeg file as a resource.For that I need to read a .jpg file into a buffer. I am using Win32 API and VC6.Any suggestions r welcome.
|
|
|
|
|
CxImage class has a LoadResource() method.
|
|
|
|
|
|
Thanx guys. I managed to do it with OleLoadPicture() with the help of a article from Dr. Yovav.
http://codeguru.earthweb.com/bitmap/CPicture.html
|
|
|
|
|
Is there any expert who can answer this question in this world?I am frustrated for i have posted this in so many forums and no answers.
Sir i need to develop a software where i have to change the ascii character into extended ascii character and send to the active application. say if a user type A from the keyboard it should be converted to say € irrespective of whatever the application is running may be it is visual studio or word or notepad or photshop u name it.
Sir i need the codings for this project and if anyone can provide or suggests ideas it is greatly appreciated.
|
|
|
|
|
this may be possible if you use some system-wide hook.
|
|
|
|
|
u can do that using a WH_KEYBOARD hook as a system hook (placing it in a dll)
bye bye
marconi (jca)(ecc) - inocram@yahoo.com
lo normal es aburrido
http://mwin32asm.cjb.net/
|
|
|
|
|
Project Description
________________________
Keyboard
________________________
|
V
--------------------------------------------
Keyboard Hook (I have done this part)
--------------------------------------------
|
V
--------------------------------------------
Getting the Key Pressed or (I have done this part)
combination of the key pressed
---------------------------------------------
|
V
___________________________
problem i have is changing this
character into extended Ascii
character and sending to the
active application (system Wide)
???????????????????????
???????????????????????
___________________________
Is any expert there who can help me on this???
|
|
|
|
|
I have good at math. But now I am a Network Administrator, I knowlege about OS and TCP/IP and security. Iwant to faster become a good C++ programmer. Please help me ? what will I do ?
Thank you !
Ngo Hong Quyet
|
|
|
|
|
READ CODE WRITTED BY OTHER MAN.
|
|
|
|
|
i agree with him. I don't have any CS background but reading other poeple's code and some books i am active coder now.
Good suggestions. Worked for me
paracha3
|
|
|
|
|
Thanh you !
Can you give me some template code or some link !
Ngo Hong Quyet
|
|
|
|