|
I am presuming you used ScerenToClient relative to the PARENT window, and not the picuture window?
This really should work, I think you still have a bug in your coordinates to the InvalidateRect.
Also, I think InvalidateRect on the child window's new position is redundant, as the MoveWindow already invalidates the destination for you, assuming you allowed the paint to occur:
If the bRepaint parameter is TRUE, the system sends the WM_PAINT message to the window procedure immediately after moving the window (that is, the MoveWindow function calls the UpdateWindow function). If bRepaint is FALSE, the application must explicitly invalidate or redraw any parts of the window and parent window that need redrawing.
Any sufficiently gross incompetence is nearly indistinguishable from malice.
|
|
|
|
|
Hi all
I want to get HBITMAP from JPEG/JPG Resource in MFC/ATL/Win32 using IStream.I don't want to use IPicture or IPicDisp interface since they use Picture Control.
Any links or Code snippet would do fine ..
Thanx in Advance
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
Do you need to CImage::Load(IStream* pStream)
|
|
|
|
|
hi all,
how to access a COM component developed in vc++6.0 from ASP.net?
what r the issues need to be considered in this case??
Thanks in advance.
Prashanth.v
|
|
|
|
|
Hello
I am using the STL function for_each as outlined below
<br />
CheckAccount::~CheckAccount()<br />
{<br />
for_each(translist.begin(), translist.end(), del_t);<br />
}<br />
<br />
and I understand the arguements as
translist.begin() = the 1st element of the list called translist
translist.end() = the last + 1 element of the list called translist
del_t = helper function and is defined as
<br />
<br />
inline void del_t(Transaction* tp){ delete tp; }<br />
in the same class.
My question is, why do you not use del_t() in the for_each loop. Since you are invoking a function I would have thought you need the (). I find that the above definition of the for_each loop works fine. But if I define it as
<br />
for_each(translist.begin(), translist.end(), del_t());<br />
I get an error. I have had a look on google and sometimes you use the () and sometimes you don't. Also I think that the 3rd argument of for_each (where there is del_t in this case) can be a class? But I dont understand why. Can you please provide me with an example of that?
Thank you for your time.
|
|
|
|
|
If you add parentheses after a function name, that function will be evaluated, and the result will be the actual parameter. If omitted, it is the function itself that is sent as a parameter.
You can use an object, a functor, in the for_each call. The class needs to implement the operator() accordingly.
|
|
|
|
|
I have been running through my code trying to figure out why my GDI handle count is so high ( best was 400+ ). A point to note here is that there are no GDI leaks. Here is an snippet of the cause
HRGN hRgn = CreateRectRgnIndirect(&rc);
DeleteObject(hRgn); This particular segment is called 5 times on window creation, then 5 times for each WM_SIZE. The region is deleted so the count doesn't keep growing when the window is being sized, but on creation (the first 5 calls), the count never decreases after deletion.
Is this a problem with my code?
|
|
|
|
|
Are the GDI objects still selected into a dc when you delete them?
HRGN hRgn = CreateRectRgnIndirect(&rc);
HGDIOBJ hOldRegn = SelectObject(hdc, hRgn);
...do something with the dc...
SelectObject(hdc, hOldRegn);
DeleteObject(hRgn);
|
|
|
|
|
Most of the objects are HRGN and are only created to calculate various regions. They are never selected into the DC. Those that are, mainly HBITMAP and HPALETTE are removed before being deleted. I'm wondering if this is some functionality of VS8 to aid in debugging or whatever, I never had a problem like this with VC6.
|
|
|
|
|
Hi everybody,
Is it possible to open a CDialog from a MDI Child ( CFormView ) ?
If i open the CDialog, the Create returns always FALSE
WinTEdit Help(this);
if(!Help.Create(IDD_WINTEDIT,this))
int error = 1; // Steps always here in
Help.ShowWindow(SW_SHOW);
WinTEdit is a CDialog derived-class
Thanks
|
|
|
|
|
I think you asked this question did you see my reply?
|
|
|
|
|
Yes, thanks, but the thread is few pages away, so nobody can see it anymore
i wrote :
WinTEdit::WinTEdit(CWnd* pParent /*=NULL*/)
: CDialog(WinTEdit::IDD, pParent)
{
Create(WinTEdit::IDD,pParent);
}
causes the same problem
It's seriously possible to open a CDialog in a MDI-Project, or not?
Or isn't it possible to open a CDialog with a "CFormView"-Parent?
So that only the mainform could open the CDialog...
Thanks
|
|
|
|
|
What happens when you run this code
|
|
|
|
|
ooooooowkay !!
I removed the Rich Edit 2.0 from the Dialog and now i dont have an arror
Does this control has an error ?
Thanks !!
-- modified at 6:33 Monday 30th October, 2006
|
|
|
|
|
baerten wrote: Does this control has an error ?
No, but it does require to call AfxInitRichEdit() first.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
It seems you get your answer AfxInitRichEdit now do you have any problem
|
|
|
|
|
Hello,
I am working with VS2005 and I use in a project a extern lib (MFC dll). In this library there is some template class and wenn I compil my project I get:
unresolved external symbol "__declspec(dllimport) public: void __thiscall MessVorgang<class messpoint="">::AddPoint(class MessPoint)
In my project MFC dll the class declaration is:
#include "stdafx.h"
#include "MessPoint.h"
template<class pelement="">
class AFX_EXT_CLASS MessVorgang
{
public:
MessVorgang()
:m_theIterateurDeList(NULL),m_id(0),m_fsTProjektId(0),m_dbStatus(0),m_type(99)
{
..........
..........
What I have to do or modify to fix my problem or were can I find information for template class in a Dll project?
Thank to help me!
AutreChien
|
|
|
|
|
Normally for development purposes, an external DLL comes with 3 files, a .h header file, .lib and .dll file. If you are using a library "MessPoint", you must include "MessPoint.h" in your source, and link the library "MessPoint.lib" during build time and ensure "MessPoint.dll" is in your compiled .exe directory or windows/system32/ directory during runtime.
The error is because you did not link the file. You can link it under configuration (VS2005) or just add the following code in the source
#pragma comment (lib, "MessPoint.lib")
Where MessPoint.lib is the library you want to link to.
Good luck.
|
|
|
|
|
Thank,
The messpoint.h is allready in the same MFC dll project like MessVorgang class:
declaration:
class AFX_EXT_CLASS MessPoint
{
public:
MessPoint();
...
That mean if I am good understand the messpoint is included in the same lib!
In the project were I am using this lib,dll is allready include in link-input(additional dependencies) to the lib (from MFC dll project)
What can I do to check if the messpoint class is really included or wath I have to change in my declaration.
AutreChien
|
|
|
|
|
If you are creating an MFC dll project, i suggest you to look for some articles in CodeProject. Anyway, if your DLL is structured like this
Project My.dll
class A<br />
{<br />
}<br />
<br />
class B<br />
{<br />
A a;<br />
<br />
}
Then in an application where you will be using Class A and Class B, you must link to my.lib. Just to tell you not to confuse yourself by linking to a.lib and b.lib, because that is not what your project created at the end.
If your DLL project contains template functions or classes, make sure you declare all possible variations that you want to use.
for example if you have this function
template <class T><br />
T GetMax (T a, T b) {<br />
return (a>b?a:b);<br />
}
you need to declare this too in the dll
template <class T><br />
int GetMax (int a, int b);
If you are going to call the int version of the GetMax function in the Dll. Compiling the DLL and later calling a float version (example : GetMax(float a, float b)) will cause an error, that the compiler cannot link to the function (of course, cause you didnot define it, and it doesnt exist).
However, if you just include the source during build time, no errors will be produced, because the compiler will be able to create appropiate functions during compile time. Templates are resolved during compile time. (Because a DLL is compiled earlier, all variation of template functions, classes etc must be declared and resolved too).
Good luck.
|
|
|
|
|
ok, I understand. I will try to change the declaration for my class, I am not very familiar with template ... I have to learn.
Thank you for your help !
AutreChien
|
|
|
|
|
hi,
can ne 1 help me bot how to use filelistbox concept in vc++.
thanx in advance,
zari
|
|
|
|
|
zareee wrote: can ne 1 help me
zareee wrote: filelistbox
This?[^]
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
zareee wrote: can ne 1 help me bot how to use filelistbox concept in vc++.
I cant understand what do you need?
|
|
|
|
|
hi,
i tell u clearly wat i need.i have a folder containing files of the same extension.i want the filenames to be displayed in the listbox and need to raise a event to retreive the contents of the selected file.i am using a mfc application.
can ne 1 help me?????????????
zari
|
|
|
|