|
ya it works for me perfectly.. thanku 
|
|
|
|
|
Hi Friends
I have function, show below coded in "Test.h"
void Msg()
{
....
}
I copied "Test.h" to include folder of VC++
Can i use Msg function in a project without adding "Test.h" in project solution ?
Just like below
In stdafx.h file
#include <test.h>
thanks in advance
-kk.tvm-
|
|
|
|
|
You have to include Test.h.
You can either include it directly in the file in which you're going to call Msg or you can include it in stdafx.h and then include stdafx.h in the file in which you're going to call Msg.
|
|
|
|
|
|
HI all,
in dialog box i m using GotoDlgCtrl to set focus on button,but this not working in formview.
even i use setfocus from button variable but its also not working.
please tell me what can i use for set focus on button control in formview.
please help me foe this.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Hello, in my aplication there are two dialogs CCalibracionDlg and DlgMap1 both derived from Cdialog, when I press a button in DlgMap1 i have to send a message to CCalibracionDlg, how can i do this?
I've been trying to do this with PostMessage(hWnd, WM_MYCUSTOMMESSAGE,(WPARAM) wParam,(LPARAM) lParam ); or SendMessage , but in DlgMap1 how can i get the hWnd to CCalibracionDlg?
Thanks in advance.
|
|
|
|
|
How and where in the code are you creating CCalibracionDlg?
You must be having the object of CCalibracionDlg in your appplication. Why cant you share it with DlgMap1 class?
|
|
|
|
|
well i dont think sendMessage is a good option if they are belonging to the same application and thread.
one method will be use FindWindowEx, that give you the handle if you specify the name of the dialog.
Величие не Бога может быть недооценена.
modified on Thursday, October 22, 2009 12:53 AM
|
|
|
|
|
CCalibracionDlg and DlgMap1 both derived from Cdialog, when I press a button in DlgMap1 i have to send a message to CCalibracionDlg, how can i do this?
I've been trying to do this with PostMessage(hWnd, WM_MYCUSTOMMESSAGE,(WPARAM) wParam,(LPARAM) lParam ); or
Better to have an 'object' or pointer of CCalibracionDlg in DlgMap1.U can get handle through object.GetSafeHWND(). Or Simply u can call object.SendMessage(..) or object.PostMessage()
--Cool_Dev--
|
|
|
|
|
The objet from i'd like send the message is CDlgMap1 to the objet CCalibracionDlg, so you say that i have to put this code in the apropiate function in CDlgMap1 : CCalibracionDlg.PostMessage(...)?
|
|
|
|
|
yeaa.. exactly. As you want to send message to a window from another window in same application, u can simply use a Callback or a direct function call. But if the situation needs, such as you need to call the function many times, its better to use PostMessage or sendMessage.
--Cool_Dev--
|
|
|
|
|
Well , thanks to all, finaly i get the solution with:
GetParent()->PostMessage(WM_MyMessage,NULL,NULL);
|
|
|
|
|
timbk wrote: ...when I press a button in DlgMap1 i have to send a message to CCalibracionDlg, how can i do this?
Are they both visible? Are they modal or modelsss?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Ies they are both visible, the one from class CCalibracionDlg is modal and the one from CDlgMap1 is no modal, why?
|
|
|
|
|
timbk wrote: ...the one from class CCalibracionDlg is modal and the one from CDlgMap1 is no modal, why?
Because modal dialog boxes "block" other windows from processing messages. Your topmost dialog would need to be modeless if you want it to be able to communicate with the dialog below it.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
oh, I didn't know it , so it's imposible send and recive messages between a model and modeless? ok supose that i change the main dialog to modeless , how can i do te send or post a message between the two modeless? with PostMessage?
|
|
|
|
|
timbk wrote: so it's imposible send and recive messages between a model and modeless?
No, it IS possible.
timbk wrote: ok supose that i change the main dialog to modeless...
The main dialog should stay modal. Any subsequent dialogs that you want to communicate with it should be modeless.
timbk wrote: ...with PostMessage?
That's a different topic altogether, and at this point does not matter to you.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Thanks. But , wich is the correct syntax? i wrote the following code in CDlgMapa1
<code>CCalibracionDlg.PostMessage( ? , WM_MYCUSTOMMESSAGE,(WPARAM) wParam,(LPARAM) lParam);</code>
Two questions:
1-What have i put in'?' ? , the handler to CCalibracionDlg (is the object that recives the message) ? in this case , how can obtain it? if you could put some code like an example , would be nice.
2- at that line of code the compiler says : error C2143: syntax error : missing ';' before '.' , sounds like the compiler doesn't recognizes that line. thanks again.
|
|
|
|
|
Well , thanks to all, finaly i get the solution with:
<code>GetParent()->PostMessage(WM_MyMessage,NULL,NULL);</code>
|
|
|
|
|
Hello,
I am trying to get started with some programming, but I'm getting nowhere with an actual interesting sort of a project.
I can do console examples fine, and follow the instructions on the MSDN, but what I want to do is work on editing and creating modules for a program called SynthEdit.
SynthEdit creates Music software synthesizers, and the software has an SDK released.
So if I can figure out how to load a project/solution file from the SynthEdit SDK and actually successfully compile it, I will be able to actually start working on something.
But I am getting nowhere, because I always get errors when trying to compile.
It should be as simple as installing Visual C++ and the Microsoft SDK, then just loading a file from the SynthEdit SDK and compiling it. But something is not working right.
Visual C++ 2008 installs with Windows SDK version 6.0A already installed and ready to go, right? But it doesn't work. I added the file paths to the VC++ directories for Executable files, Library and Include files, it still doesn't work.
I downloaded Windows SDK v 7.0 and added the paths to the VC++ directories, it still does not work.
So What do I need to do to get a Windows SDK integrated into my Visual C++ 2008, so that I can compile something?
I have seen the Microsoft Blog about using the Microsoft Windows SDK configuration tool, it is no help. It fails to be a straightforward step by step guide, and goes into setting directories using the command prompt window without explaining how exactly to do that. So it is useless for a beginner such as myself.
I am pasting the log for my attempt to compile a project called "AGain" below. If anyone sees exactly what the problem is, that would be great. Please don't spend more than a minute or two, I'll have to eventually figure this out, even if it takes weeks.
Build Log
Rebuild started: Project: AGain, Configuration: Debug|Win32
Command Lines
Creating temporary file "c:\Program Files\se_sdk3\AGain\Debug\RSP0000023362984.rsp" with contents
[
/Od /I "..\se_sdk3" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /Fo"Debug\\" /Fd"Debug\vc90.pdb" /W3 /c /Wp64 /ZI /TP "..\se_sdk3\mp_sdk_common.cpp"
"..\se_sdk3\mp_sdk_audio.cpp"
".\AGain.cpp"
]
Creating command line "cl.exe @"c:\Program Files\se_sdk3\AGain\Debug\RSP0000023362984.rsp" /nologo /errorReport:prompt"
Creating command line "rc.exe /d "_UNICODE" /d "UNICODE" /fo"Debug/AGain.res" ".\AGain.rc""
Output Window
Compiling...
cl : Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release
AGain.cpp
mp_sdk_audio.cpp
mp_sdk_common.cpp
Generating Code...
Compiling resources...
Microsoft (R) Windows (R) Resource Compiler Version 6.1.7600.16385
Copyright (C) Microsoft Corporation. All rights reserved.
.\AGain.rc(10) : fatal error RC1015: cannot open include file 'winres.h'.
Results
Build log was saved at "file://c:\Program Files\se_sdk3\AGain\Debug\BuildLog.htm"
AGain - 1 error(s), 1 warning(s)
|
|
|
|
|
Hi,
Your source code seems to be compiling correctly according to your logs. Its the resource compiler that is failing. Your AGain.rc resource file is including a file named winres.h but the compiler cannot find it. You may be missing an #include path... locate this file and add the path into the projects 'Additional Include Directories'
Best Wishes,
-David Delaune
|
|
|
|
|
Thanks!
I have the VC++ 2008 express edition, which I guess does not include the MFC library.
Perhaps winres.h is in this library, which I don't have.
Anyway, I renamed the winresrc.h file which is included in the Windows SDK, and I got the module to compile! So at least I'm getting somewhere.
|
|
|
|
|
|
See the link here[^] that David posted, it should help you.
|
|
|
|
|
Hi friends,
Thanks in advance.
I am using Acrobat Reader Browser document to show PDF file in my application.
But as I drag drop PDF file into internet explorer, it shows page count of PDF file.
How can I get page count in PDF file through C++/VC++.
Thanks,
Subhash Madhukar
|
|
|
|