|
First of all you can't add two dialogs at the same time to a class. If you try doing the same the message to change the dialog is popped up
SO there is no question that you can invoke two dialogs at the same time through the same class variable.
How ever you can create two dialogs from a dialog
These dialogs can be modeless or one whatever you decide.
now use
Create function and pass the id of the dialog to create the dialog
Create(IDD_DIALOG1,this);
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
|
|
|
|
|
I just tried we can add two dialogs to the same class.
HEllo
|
|
|
|
|
Can you tell me how you did that because the compiler itself asks you to change the id of the dialog when we try to do the same
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
-- modified at 2:35 Wednesday 19th April, 2006
|
|
|
|
|
Just give different ID to the dialogs.
HEllo
|
|
|
|
|
HI ,
Have you tried to add the same class to the two dialogs using the class wizard.
Try doing this
I am using VisualStudio6.0
Create two dialogs and associate a class to any one
Now try to add the second dialog to the same class
The class wizard prompts to change the resource id of the dialog
SO the second dialog is associated to the class and not the first one.
Please try this and tell me what other steps are you using .
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
|
|
|
|
|
yes harshndu,
we can add two dialsgs in one class. for it just create a dialog based project with About box Option. This class is nothing but adding two dialog box in a same class.
good luck.
thanks,
uday.
uday kiran
|
|
|
|
|
please be more specific in your post
|
|
|
|
|
Please tell me the things i need to elaborate.
HEllo
|
|
|
|
|
Explain what you mean by adding two dialogs to the same class. For me, that means this:
class CYourClass
{
CDlgA DlgA;
CDlgB DlgB;
}
Where CDlgA and CDlgB are classes inherited from CDialog. So, I added an instance of each class to the CYourClass class.
|
|
|
|
|
Cedric
I think he wan't to create another files for dialog2 because
I think that codes in Dialog1 and Dialog2 are same maybe a little different
|
|
|
|
|
yes harshndu,
we can add two dialsgs in one class. for it just create a dialog based project with About box Option. This class is nothing but adding two dialog box in a same class.
good luck.
thanks,
uday.
uday kiran
|
|
|
|
|
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;
|
|
|
|