|
you guys are so evil
|
|
|
|
|
Jedi stuff. Don't try it at home...
|
|
|
|
|
Actually,
#define PROGNAME "myapp"
#define HELPFILE PROGNAME##".hlp"
const TCHAR *helpFileName = HELPFILE;
that works.
|
|
|
|
|
Actually, actually , the last two lines you added does not affect
PROGNAME".HLP" at all.
|
|
|
|
|
Well duh.
The intention was to illustrate how one could accomplish that effect of token pasting correctly. I guess you missed it.
|
|
|
|
|
Sorry mate!
I was reading "that works" as if my reply didn't.
|
|
|
|
|
Hello everyone !
The test dialog will showing ,when the mouse double clicked on the MDIView.
Now I want to get the CMDIView's pointer in test dialog member function,and then to call "CMDIView::OnDraw" to update the windows.
the code like this:
/////////////////////////////////////////////////////////////////
// MDIView.h
#include "TestDlg.h"
class CMDIView : public CView
{
public:
CTestDlg *m_pTestDlg;
CWnd *m_pWnd;
}
CMDIView::CMDIView()
{
m_pTestDlg = new CTestDlg();
m_pTestDlg.Create(IDD_TEST_DLG,this);
m_pTestDlg.ShowWindow(SW_HIDE);
m_pTestDlg.UpdateWindow();
}
void CMDIView::OnLButtonDblClk(UINT nFlags, CPoint point)
{
m_pTestDlg.InitDlg("Hello",this);
m_pTestDlg.ShowWindow(SW_SHOWNORMAL);
}
CMDIView::OnDraw(CDC *pDC)
{
//Here will get the document pointer to draw the element.
GetDocument()->DrawAllItem(..);
}
// MDIView.h over.
/////////////////////////////////////////////////////////////////
now here is the dialog's member function:
/////////////////////////////////////////////////////////////////
class CTestDlg : public CDialog
{
public:
CWnd *m_pWnd;
//......
}
CTestDlg::InitDlg(CString strTitle,CWnd *pWnd)
{
SetWindowText(strTitle);
m_pWnd = pWnd;
ASSERT( m_pWnd != NULL);
}
void CTestDlg::OnBtnEdit()
{
//Now I want to get the CMDIView's pointer,and then to call CMDIView::OnDraw
//Then how to write?
......
}
I try to use this way ,but failed too,please help me...
m_pWnd->Invalidate();
m_pWnd->UpdateData(FALSE);
Thanks for you reply !
Best Regards !
|
|
|
|
|
Just set the parent in the dialog construction :
class A;
class B
{
A* m_pA;
public:
B(A* pA) { m_pA = pA; }
bool TestParent() {
if (m_pA) m_pA->CallMe();
return (NULL != m_pA);
}
};
class A
{
B* m_pB;
public:
A() { m_pB = new B(this); }
~A() { if (m_pB) delete m_pB; }
void CallMe() {}
};
virtual void BeHappy() = 0;
|
|
|
|
|
I know the mean.
Thank you !
|
|
|
|
|
Hi all,
I'm using Visual Studio 2005 with MFC application. Is there a coding method to obtain Application Window's handle and rect with a mouse click?
Let's say I have a transparent window with WS_EX_TOPMOST attribute and there are other window applications such as Microsoft Word, Mozilla Firefox and Window Explorer. I was told to obtain the rect and the handle of the window application with a mouse click while the transparent window on TOPMOST.
Example:
I click on Mozilla Firefox while all other windows are opened and on top of mozilla and yet the transparent window is on TOPMOST of all. How do I obtain the RECT as well as the handle??
By the way, I'm trying to BitBlt that Mozilla with a mouse click with all window including my own created MFC window on top of it.
You smile at me and I smile at you,
And so one smile makes two~
|
|
|
|
|
I think EnumWindows and GetWindowRect functions can be used.
|
|
|
|
|
Thanks for the reply. Even though I can get handles from there. How do I actual press with my mouse to get the coordinate (POINT) on any position of the Window Application to obtain corresponding handle of that Window Application since I got a transparent window at TOPMOST and other Window Applications before it?
To code or not to code, that is the question~
|
|
|
|
|
Hi,
I am using GDIplus library in my project to draw images etc.
Gdiplus is the part of windows so initially I planned not to give this library with application. But I got complain that application is trowing some error saying "application failed to initialized properly.."
If I place the gdiplus.dll with application then this problem will not come.
If gdiplus is part of window why shell I packed this with my application?
|
|
|
|
|
There are 2 versions of GDI+ .
GDI+ 1.0 comes with Windows XP and can be redistributed to older version of Windows.
GDI+ 1.1 comes with Windows Vista and later, and you cannot legally redistribute it.
According to MS if you are using GDI+ 1.0 your code should work on any machine that has this version or higher.
For additional information refer to this[^] MSDN thread.
|
|
|
|
|
your maen to say that I can use GDI+ 1.0 on windows viats and windiws 7, correct ?
I am developing application on WIndows XP SP3 and I checked gdiplus verison that us 5.1.3
But you mentioned only 2 type of gdi+.
I am confused, please make me clear :
1. Is it manadetory to give gdi+ with application to run on any version of window (above XP), if application is developed on windows XP (SP3).
2. Which version need to give with application?
3. I did not get any redistribute issue with gdi+, please give link?
Thanks,
JM
modified on Wednesday, August 18, 2010 10:12 AM
|
|
|
|
|
john5632 wrote: your maen to say that I can use GDI+ 1.0 on windows viats and windiws 7, correct ?
Yes. Windows 7 even ships with both versions of GDI+.
If your program is GDI+ 1.0 based then it should work for later versions of GDI+,
so it is normal to work on Windows Vista and Windows 7.
But in case of problems you can redistribute GDI+ 1.0 to Windows Vista.
This[^] is a link for redistributable package for GDI+ 1.0 .
john5632 wrote: I checked gdiplus verison that us 5.1.3
This is a file version of the DLL file, not the version of the GDI+ library.
john5632 wrote: 1. Is it manadetory to give gdi+ with application to run on any version of window (above XP), if application is developed on windows XP (SP3).
Yes. GDI+ 1.0 can be redistributed, I've already provided a link for the redistributable package.
john5632 wrote: 2. Which version need to give with application?
You can only give GDI+ 1.0 , this version is used by Windows XP. GDI+ 1.1 is not redistributable according to EULA of Windows Vista.
john5632 wrote: 3. I did not get any redistribute issue with gdi+, please give link?
Once again here[^] is the MSDN link.
Also for additional details see the documanetation[^] of GDI+ (this link was already given to you by signor Pallini).
|
|
|
|
|
Nuri Ismail wrote: john5632 wrote:
1. Is it manadetory to give gdi+ with application to run on any version of window (above XP), if application is developed on windows XP (SP3).
Actually no, it is NOT mandatory, in fact there may be no reason to redistribute GDI+.
Did you develop and test your application on a Windows XP system? If so, and you have not tried to force the 1.1 issue, then your application is limited to GDI+ 1.0 functionality. Therefore, you can redistribute your application to Windows XP, Vista, and Windows 7 systems without needing to redistribute the GDIplus.dll. That dll is already on those systems. On the other hand, do you want to distribute your application to downlevel systems like Windows 98? If so, then you provide the redistributable 1.0 version of GDIplus.dll for those downlevel computers and only them, not for ones where gdiplus.dll is provided with Windows.
Do you want to use some of the advanced functionality in GDIplus 1.1, such as effects? If so, you must define switches so that the added 1.1 functionality will be available when you compile. You must also add a manifest so that gdiplus.dll version 1.1 will be loaded when your programme executes. You can use this version of your programme on XP, Vista, and Windows 7. Again, you do not provide the dll, it is part of Windows.
Finally, in Windows 7 and beyond, GDIplus.dll version 1.1 is the default version used. This means that your programme, developed under and for Windows XP, without a version 1.1 manifest, will load and use the GDIplus.dll version 1.0. Under Vista, the 1.0 version will also be used. But, on Windows 7, GDIplus.dll version 1.1 will be loaded by that same application. As it is a full superset, you should not see any differences.
|
|
|
|
|
Here [^] some info:
Run-time Requirements
Gdiplus.dll is included with Windows XP. For information about which operating systems are required to use a particular class or method, see the More Information section of the documentation for the class or method. GDI+ is available as a redistributable for Microsoft Windows NT 4.0 SP6, Windows 2000, Windows 98, and Windows Millennium Edition (Windows Me). To download the latest redistributable, see [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
|
Hello All,
I made an API Hook using mHook Library and successfully hooking NtSetInformationFile , I then made an DLL which loads the DLL into the process using CreateRemoteThread, It's working fine in my PC, But when checked on windows server 2003(32 bit) the application won't start and gives me the message that "This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix the problem." .
Now i googled about the error and found so many answers, One of them was to check the "Code generation" setting under C/C++ property, if it is Multi-Threaded DLL (/MD) then change to Multi-Threaded (/MT) , Changing the setting works in windows server 2003, But now the problem is when i recompile my code with (/MT) the anti virus won't let me build the exe and delete the exe, I can only build and run the exe after i uninstall or stop the anti-virus. Could anyone throw some light on this problem.
Thanks
|
|
|
|
|
Do not change the property to multithreaded.
Please follow the steps:
1) Go to Project Menu -> Properties
2) Select Configuration Properties ->general
There are two properties
Use of MFC :if you have "Use MFC in a Shared DLL" than change this property to "Use MFC in a Static Library".
Use of ATL :if you have "Dynamic Link to ATL" than change this property to "Static Link to ATL".
than check.
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
The value under "Use of ATL" is "Not Using ATL"
|
|
|
|
|
If your setting is "Not using ATL" than dont change the setting if your setting is "Dynamic Link to ATL" than change it to "Static link to ATL" and what about MFC setting.
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
MFC Setting is "Use Standard Windows Libraries"
|
|
|
|