|
Then what is the class that is added for with the name of CAboutDlg in the class view of your application.
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
|
|
|
|
|
hi
u can't include more than one dialogs in a class. wat is ur requirement? whether u want to use same variable in two dialogs or u want to do a perticular work on two different ways? Can u explain ur requirement?
|
|
|
|
|
harshandu wrote: an we add two dialogs to the same class?Consider two dialogs A and B of class clz.now if i make a call as clz obj;obj.DoModal();here which dialog is invoked.
yes, you can create so! you just have to pass the Dialog ID dynamically, and you have to create there variable on HEAP, i.e. use new
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi,
I am puzzled here. I believe a header file (.h) contains the definations of the functions. but what is the difference between .lib and .dll files. Do both these files have the function implementation? Is .lib for static linking and .dll for dynamic linking? If I use the .lib file, do I need the .dll file to execute the function?
I am really puzzled here. Can anyone help?
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
A DLL, or Dynamic Link Library, contains compiled code that is ready to run and can be used by EXEs or other DLLs. A DLL can be imported either statically or dynamically. If it is imported statically a .LIB file is used which is known as an import library (only used at link time, not runtime) - It contains binding information. When a DLL is statically linked it must be present or the importing module will not be loaded by the OS. If a DLL is dynamically linked no import library is needed and the importing process can still be loaded by the OS if the DLL is missing - In this case the code in the importing module can handle failure explicitly.
LIB files also have uses that are not DLL related. In this case the LIB file is conceptually just a collection of .OBJ files. These contain compiled code and symbolic information. Unlike a DLL the code in these is not ready to run and mean nothing to the OS - they can not be loaded. The linker links together .LIB files .OBJ files and produces a finished executable (a DLL or EXE). A LIB file - in this context - is known as a static link library.
Steve
|
|
|
|
|
So what you mean is, .lib files contain only the binding information so that a dll can be statically linked to an application? Did I get this right? So, if I use a .lib file and compile my appilcation, there is no need for me to deploy the dll along with the application coz it gets statically linked. Is it?
Thanks for your reply and hope to get another reply soon.
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
An import library is a .lib file the contains binding information for a DLL. It is used when building (the linker uses it) a module (.exe or .dll) that imports a .dll statically. It is not needed to run the application.
A .lib file can also be used as a container of .obj files. Object files (.obj files) are what to get when you compile a .c or .coo file. This is an older usage of .lib files. This kind of .lib file is called a static link library - It has nothing to do with DLLs as such.
Steve
|
|
|
|
|
a .lib and a .dll are both basically the same thing, with one exception, a dll is dynamic. This means if you use a dll in your project, you will have to distribute the dll with your exe. But if you use a lib, the code inside the lib is added inside the exe.
dll's have two good uses - 1) if you find a bug in the code, you will only need to re-distribute part of the program instead of the whole bundle. 2) You can easily re-use parts of your code in several applications.
The Boy's in blue will always rule :p
|
|
|
|
|
waldermort wrote: a .lib and a .dll are both basically the same thing, with one exception, a dll is dynamic. This means if you use a dll in your project, you will have to distribute the dll with your exe. But if you use a lib, the code inside the lib is added inside the exe.
So what you mean to say is that a dll and lib file is the same. They both contain the implementation of the functions declared in a header file?
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
yes, if you use .dll file you need to have .lib file. when you can use funtion or some class in this.succesfull!
thanhks!
|
|
|
|
|
Not so. If you dynamically link to the library (using the LoadLibrary and GetProcAddress APIs) you don't need one.
Steve
|
|
|
|
|
Can anyone tell me what is the difference between the following implementations.
CMyClass cmCls ;<br />
cmCls.myfunction() ;
or
CMyClass *cmCls ;<br />
cmCls = new CMyClass() ;<br />
cmCls->myfunction() ;<br />
delete cmCls ;
Thanks...
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
The frst declaration tells that u already created memory. so u can use the object with out creating memory.
Second one is a pointer to that class. So u have to create memory before using the object.
|
|
|
|
|
In First object is created in Stack.
In Second object is created in heap;
|
|
|
|
|
manish rastogi says :In First object is created in Stack.
What is that Object is global?
|
|
|
|
|
vikrams wrote: What is that Object is global?
Is There is any difference? when ever you allocate the memory using new, AFAIK, it always allocated in HEAP otherwise STACK
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
As far as my reading..Globals goes into data segment of a program.
-- modified at 1:14 Thursday 20th April, 2006
|
|
|
|
|
vikrams wrote: As far as my reading..Gloabals goes into data segment of a program.
Thats why i use AFAIK term
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi,
I have a problem while resizing the window. Suppose if i am using a SDI application to draw two rectangles in the client area and if i do any of the operations like moving the window or resizing the window i am getting blank on the client area.
Can any one help me on this.
Do i need to store whatever the operations i did on client area somewhere and use the same for redrawing in View's OnSize function?????
Thanks in advance..
-kiran
|
|
|
|
|
what code you have used to draw the said stuff ?
|
|
|
|
|
Thanks for reply. I am using DrawText and Rectangle with the view's device context.
Thanks in advance.
-Kiran
|
|
|
|
|
Can you show code in OnDraw ?
Normally OnDraw gets called when view resized.
|
|
|
|
|
Sorry. I am not doing anything in the function OnDraw().
Currently i am repainting the window with the help of another function which will access a linked list to get the drawn objects.
Is there any another method??? to implement this?
-Kiran
|
|
|
|
|
any special reason for not using OnDraw() ?
B'coz thats the best method to implement drawing applications.
|
|
|
|
|
can anybody plz assist me as to how to design a front end... basic mouse click on certain buttons and another window p[ops up type application in vc++
AnubhaV
|
|
|
|