|
You need to define a variable in the first dialig that will hold the value that you want to pass to the second dialog. In the second dialog, define a variable that will receive the value from the first. For example:
class CMyDlg1
{
public:
int m_x; // this is going to be passed to other dialogs
};
class CMyDlg2
{
public:
int m_x; // this is going to be received from CMyDlg1
}
Somewhere in CMyDlg1, you have a button or menu item that when pressed CMyDlg2 is displayed:
CMyDlg1::OnButton1()
{
CMyDlg2 dlg;
dlg.m_x = m_x; // passing a value from CMyDlg1 to CMyDlg2
dlg.DoModal();
}
|
|
|
|
|
Mel:
Thank you very much,Your help is very valuble for me,Ilike to program in VC at my amature time,I like to do something I interesting.
thanks.
|
|
|
|
|
How about doing it the other way around? Ex. using a settings dialog that will change a variable in the main window?
|
|
|
|
|
I'm analyzing the possibility of using RegisterWindowMessage in order to establish communication between two applications.
Is this the best way to accomplish such task? It looks like the easiest one.
rechi
|
|
|
|
|
Registered message or PostMessage(HWND_BROADCAST, ...) are the most simple ways to communicate between GUI applications, if information you need to send can be placed to wParam, lParam.
|
|
|
|
|
I have just created a DLL that has a CreateDisplay funtion that I wanted to be able to pass a time-out value to. When the CreateDisplay function is called, everything is ok BUT the timer functionality. The CreateDisplay function calls a modal dialog that contains 2 text fileds and a hidden button. The dialog created in an MFC App with the same code works fine. (meaning, I know that the settimer and ontimer code is ok). I have thrown in MsgBoxes during the dll's settimer and ontimer code. If the timer message is thrown BEFORE the dialog is drawn, then I get OnTimer hits, however, once it is displayed, I get nothing (spy++ shows nothing as well). And, from the message trick, I know the settime is getting set when I want it to.
So what is my problem???
If it is a message pump thing due to the dll, can someone point me as to what I need to do. (relizing I have never done it)
Thanks.
|
|
|
|
|
After adding the application library to the same folder under which the application itself is located, from Project->Settings->Link under 'Object/library modules', I entered the directory and subdirectory path information. However, when I tried building the program, it produced an error stating it couldn't open one of the files.
The file to which the error is referring, is right there in the library, and is under the same directory as the program itself.
Because this is a local library used only for this application (and one other), I don't want to use Tools->Options->Directories to enter path information for an application I won't be using too often.
Might someone know why the program isn't seeing the file? (No ".dll's" are involved here.)
Running VC++ 6.0
Thanks.
William
|
|
|
|
|
We have all probably had that identical problem. It usually caused either mispelling the name of the *.lib or entering the wrong path to it.
1. If the *.lib is located in the project's root directory you do not need to provide the path.
2. Make sure you spelled it correctly.
3. If you want to include the path, make sure the path is correct.
|
|
|
|
|
Your reply reflects the experience of someone who has walked that path before. However, take my word for it, they are not applicable in this case since they were the very first set of things I checked.
The file the application says it cannot open, is actually in the 'Include' folder which is a subdirectory of the same directory under which the application subdirectory is located. IOW, library folder, 'Include' folder, and application folder, are all subdirectories of the same directory (which is a subdirectory of the root directory).
I even did a Build->Clean to ensure no leftover baggage is what might be responsible for what's happening. It didn't solve the problem.
Something else I noticed. No matter how many times I changed Project->Settings under "Settings For:" from Win32 Release to Win32 Debug (and press OK), after I run the application, Win32 Debug gets changed right back to Win32 Release.
Because I didn't write all of the code, I'm wondering whether in some obscure place, somebody left something in it that's causing this.
I sometimes use terminology which I do purely for the convenience of communication. For example, I named the folder "DaoLib" where I have the 'Include' folder defined under, then another folder (likewise defined under) containing the "*.lib" file, and thirdly, the application folder (likewise defined under) that contains the dozen or so '.h' files, '.cpp' files, and resource files (etc.). My use of the word "library" was meant to indicate the "DaoLib" folder.
Thanks.
William
|
|
|
|
|
Since I don't know your directory structure, lets assume it is like this:
c:\DaoLib
c:\DaoLib\include
c:\DaoLib\lib
c:\DaoLib\ProjectFiles (*.cpp, *.h *.rec, *.dsw, etc)
When you compile, the current directory is actually c:\DaoLib\ProjectFiles, So in Project | Settings | C++ Tab | Cateroy "Preprocessor", "Additional Include Directories" you should have "..\include". And in Project | Settings | Link Tab, Category "Input", "Additional Library Path", you shoud have "..\lib"
Whenever you open Project | Settings, the dropdown for Settings For always reflects the Current Active Configuration, either Release or Debug (or some other configuration you may have added to the project).
|
|
|
|
|
Thanks Mel, I've gotten passed all that already. I had to do the physical hardcoding of the path (e.g. "..\DaoLib\Include" etc.) for each of the '#include' statements the compiler was saying it couldn't find the file.
I've done all that already, and it works. (To be honest, I'm not a big fan of hardcoding directory information in the '#include' statements, and was looking for a simpler way through using Project->Settings->etc.) But those problems are now history.
The one that's happening now is coming from the linker which says it cannot find the *.obj file.
Thanks for any help.
William
|
|
|
|
|
I gave up in the end and hard-coded the shortened form of the directories in each "#include" statement for which the compiler was saying it couldn't find the '.h' files. This got me through the compile part of the build, but now I have a new error which says the linker cannot find the *.obj file.
William
|
|
|
|
|
I've set the Active Configuration to Win32 Debug, but still have the linkage problem.
William
|
|
|
|
|
Does anyone know the maximum possible size of a std::string ?
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
Theoretically at least, std::string::max_size() is such value.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
You can call max_size function to check this. On my computer this function returns maximum value for UINT type.
|
|
|
|
|
What's a good book for building multithreaded applications in windows specifically and C++ generally?
i came across this book "Object-Oriented Multithreading Using C++
Author: Cameron Hughes, Tracey Hughes "..is this worth it? or is there any other ones out there that could be better?
thanks
|
|
|
|
|
Check out www.amazon.com. They usually have book review by its readers and have references to other similar books.
|
|
|
|
|
Does anybody know how to navigate the controls which over a TabControl by TAB key? I can tab on tab header most but never tabbing through the controls over it. I created main dialog, tab pages dialogs and main dialog with a resource editor. Looking well and can successfully change pages, nice working but... What is the magic codes for solution? (if possible with only api codes. But suppose,if possible, not much diferent)
Note: all controls and SysTabControl32 also has WS_TABSTOP style. But in fact I didnn't saw any example that can do this(CodeGuru, CodeProject) except one but that was a PropertySheet inherited ownerdrawn tab cotrol, this means any but why?
|
|
|
|
|
any idea? please...anybody did? hard?
|
|
|
|
|
Hi there,
I loaded a bitmap file in a HDC ...
Now, i want to get a copy of the HDC to another HDC variable !!!
How could i do it ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I think you mean you want to create another HDC, another HBITMAP, and copy the one bitmap to the other.
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
I need to connect to some BODY object events as soon as possible. WHEN I must do it, check BODY availability by timer? Events like OnDonloadComplete comes too later...
|
|
|
|
|
I want my program to have the option of starting automatically at system start-up. How can I have the program add and remove the necessary shortcut from the Start Menu's startup folder?
|
|
|
|