|
Thanks for u 2.
I am downloading them now.
cheers
==============================================
I modify the message.
InnoSetup is really wonderful!!!!!!!!!!!!!!
thanks a lots.
includeh10
|
|
|
|
|
I am trying to compile my code that was created VC++ 6.0 with MFC into VC++ 7.0. I am having a few problems. Any help will be greatly appreciated.
1. I am having trouble with templates.
I have following template class
template<class base_type="CWnd">
class CColorCtrl : public BASE_TYPE
{
..
..
}
I get an error C2039 : _GetBaseMessageMap is not a member of CColorCtrl<base_type>
BEGIN_TEMPLATE_MESSAGE_MAP(class BASE_TYPE, CColorCtrl<base_type>, BASE_TYPE)
//{{AFX_MSG_MAP(CColorCtrl)
..
..
//}}AFX_MSG_MAP
END_TEMPLATE_MESSAGE_MAP()
2. I have built Regular DLLs using MFC Dlls which I compiled in 7.0 when I use them with an .EXE that does not have threads, they work fine but when I use them with an .EXE that uses many threads, the .EXE fails at run time, at different places depending on how much work I have in each thread. When I block a lot of functionality and have only a few threads running, the application runs fine but the more threads run at the same time, the application fails for no paritcualr reason at any unreasonable points.
Also, can anyone point me to a website that has information about Migrating with no warnings for the size changes of different data types.
Thank you.
|
|
|
|
|
Hi, did you solve the problem with _GetBaseMessageMap in VC7? I ran into the same problem.
|
|
|
|
|
I have Created a simple dialog based application , which contains a Single Cedit control , I have Set the Data of CEdit Control with the SetWindowText supppose "Hello World" in the OnInitdialog( ) , AS I run the Program , the dialog appears containing CEdit control and the CEdit Control has the Text "Hello World" , but this text is highlight which is with Blue BackGround , What I want is to Remain CEdit Control in focus but the Text inside the control should not be highlighted ?
I would be very hwlp ful to you ppl if you help me out of this delimma !
thanx
- Nabil
|
|
|
|
|
Add m_myEditCtrl.SetSel (-1, 0); to OnInitDialog() .
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
BOOL CKillFocusEditBoxDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
CMyEdit* pEdit = (CMyEdit*)GetDlgItem(IDC_EDIT1);
CWnd* pWnd = (CWnd*)pEdit ;
pEdit->SetWindowText("Hello I am back");
pEdit->SetSel (-1, 0);
return TRUE; // return TRUE unless you set the focus to a control
}
Sorry guys , I m still facing the same problem with this Code , but I have find a to do my JOB the Code I have implemented to solve this problem is :
BOOL CKillFocusEditBoxDlg::OnChildNotify(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pLResult)
{
// TODO: Add your specialized code here and/or call the base class
CEdit* pEdit = (CEdit*)GetDlgItem(IDC_EDIT1);
pEdit->SetSel (0, 0);
return CDialog::OnChildNotify(message, wParam, lParam, pLResult);
}
Any ways , I thankful to you guys , you are great help to me .
- Nabil
|
|
|
|
|
when you want the cursor in a certain position, call the CEdit member's SetSel() with the parameters being the same number. For instance, if you want the cursor to be at the first position of the text box,
m_ctlEdit.SetSel(0,0);
if you want it to be at the end of the text,
CString str;
m_ctlEdit.GetWindowText(str);
int nLen = str.GetLength()
if(nLen)
nLen--;
m_ctlEdit.SetSel(nLen,nLen);
while(true)
{
TryToLearn("C++,MFC");
}
My articles[^]
bdiamond
|
|
|
|
|
hi all,
I want to create a application that include the function of a web server(including Https protocol), so can the code of my application invoke
the IIS component object on the PC ? (Assume that the PC don't have IIS installed and also I dont want to install IIS for the application)
Thanks
|
|
|
|
|
How about this one...
"Detect and Plug GDI Leaks in Your Code with Two Powerful Tools for Windows XP"
href="http://msdn.microsoft.com/msdnmag/issues/03/01/GDILeaks/default.aspx
And, if you install the debug kernel of Windows, it oreviously informed you (maybe still does) exactly what you left behind when your program exits.
|
|
|
|
|
Why don't u use resource meter of windows in the system tools catagory
|
|
|
|
|
It might let you know that you have resources leaking, but the GDI Leak tool will tell you what they are, listing out bitmaps, icons, windows, etc.
|
|
|
|
|
When I see Task Manager while excuting my app,
I can see how many GDI objects are being used..
But when I closed my app,
I don't know if GDI object is leaked or not..
beacause it's disappeared in Task Manager..
How to detect my GDI obj leak?
|
|
|
|
|
When your app closes down, Windows takes care of freeing up any memory that was allocated, closing file handles, and releasing GDI objects.
BTW, is this an MFC application?
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
My small app is made with WTL, is only 30kbytes..
But the memory usage that we can see in Task Manager is
around 3MBytes..
What a strange.. Messager's is only around 1.5MB when it is on the tray..
Is there any way to reduce the memory usage?
any documents?
|
|
|
|
|
bektek wrote:
But the memory usage that we can see in Task Manager...
Don't use TM to determine your app's memory usage. Those numbers represent the amount of address space that is in use. They have nothing to do with the amount of that address space your program is actually using.
If you are really interested, use the heap walking functions to track what is going on.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Thanks your reply..
DavidCrow wrote:
Don't use TM to determine your app's memory usage. Those numbers represent the amount of address space that is in use. They have nothing to do with the amount of that address space your program is actually using.
I've got some process monitoring tool for sysinternal.com
It shows private memory usage..
In case of my app which is only 30kbytes, it shows that my app use 800kbytes private memory...
Does that mean real memory usage of my app?
It that same as heap usage?
|
|
|
|
|
bektek wrote:
Does that mean real memory usage of my app?
What do you mean by "real memory usage?"
bektek wrote:
It that same as heap usage?
"Heap usage" is how much memory your progrm has allocated on the heap.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi guys,
I want to write application configuration information to an xml file usind msxml.
Please could somebody help me on how do accomplish this.
|
|
|
|
|
Here I have two problems, I only have two classes, an App and a Window.
1. I want each LETTER a different (random(switch)) color.
2. I don't want the color to change when I resize the Client Area (which it does now...)
All that happens now is that the first letter prints off the M.I.L. ("abc")
or the two menu items ("Katie", "Anna") in a diferent color...
Where have I gone wrong?
-thanks a lot
//////////////////////////////////////////////////////////////////////////////
#include <afxwin.h>
#include <cstdlib>
#include <cstdlib>
#include <ctime>
#include ".\katieapp.h"
#include ".\ckatiewin.h"
#include ".\resource.h"
CKatieWin::CKatieWin(void): m_sText("abc"), m_crColor(RGB(0,255,0))
{
Create (NULL, _T("Katie App"), WS_OVERLAPPEDWINDOW,
rectDefault, NULL, MAKEINTRESOURCE(IDR_MENU1));
CDC* pDC = GetDC();
pDC->SetBkMode(TRANSPARENT);
UpdateWindow();
}
CKatieWin::~CKatieWin(void)
{
}
BEGIN_MESSAGE_MAP(CKatieWin, CFrameWnd)
ON_WM_PAINT()
ON_COMMAND(ID_FILE_EXIT, OnFileExit)
ON_COMMAND(ID_FILE_ABOUT, OnFileAbout)
ON_COMMAND(ID_PERSON_KATIE, OnPersonKatie)
ON_COMMAND(ID_PERSON_ANNA, OnPersonAnna)
END_MESSAGE_MAP()
void CKatieWin::OnFileExit()
{
DestroyWindow();
}
void CKatieWin::OnFileAbout()
{
MessageBox("Copyright: Skunked Works 2004", "Katie App", MB_ICONEXCLAMATION);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////// MY GUESS IS THAT THE PROBLEM IS HERE SOMEWHERE..!!
void CKatieWin::OnPaint()
{
CPaintDC dc(this);
CRect rect;
CFont font;
font.CreatePointFont(2000, _T("Arial"));
dc.SelectObject(&font);
dc.SetBkColor(::GetSysColor(COLOR_WINDOW));
GetClientRect(&rect);
for(int i = 0; i < m_sText.GetLength(); i++)
{
CKatieWin::SetTextClr();
dc.SetTextColor(GetTextClr());
//dc.DrawText(m_sText[i], rect, DT_SINGLELINE);
dc.TextOut((i+1)*200, 0, m_sText.GetAt(i));
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////
TCHAR CKatieWin::GetText(int i)
{
TCHAR c = m_sText.GetAt(i);
return c;
}
void CKatieWin::SetText(CString _m_sText)
{
m_sText = _m_sText;
}
void CKatieWin::OnPersonKatie()
{
SetText("Katie");
Invalidate();
}
void CKatieWin::OnPersonAnna()
{
SetText("Anna");
Invalidate();
}
void CKatieWin::SetTextClr(void)
{
srand((unsigned)time(NULL));
int j;
j = rand() % 3;
switch(j)
{
case 0:
m_crColor = RGB(0,0,255);
break;
case 1:
m_crColor = RGB(0,255,0);
break;
case 2:
m_crColor = RGB(255,0,0);
break;
}
}
COLORREF CKatieWin::GetTextClr(void)
{
return m_crColor;
}
|
|
|
|
|
2. I don't want the color to change when I resize the Client Area (which it does now...)
now, you're resetting(randomizing) the colors at every paint event; try setting the colors elsewhere.
(hint: when you change the text ... )
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Thanks- that sounds like the thing to do...
How about gettig each letter in a random color?
|
|
|
|
|
Hi all,
I really don't know what I'm doing wrong...
I have a simple dialog (MFC), and I want to create a buffer, paint some pixels on it, and BitBlt it onto the dialog's client area.
In my dialog class I've created a new DC member:
CDC m_PicDC;
In my OnInitDialog method I create it to be compatible with my dialogs's own DC, and draw some pixels on it:
{
CDialog::OnInitDialog();
...
m_PicDC.CreateCompatibleDC(GetDC());
... draw some pixels inside m_PicDC using CDC::SetPixel ....
}
Finally, in the OnPaint method I do this:
CPaintDC dc(this);
dc.BitBlt(0,0,100,100,&m_PicDC, 0, 0, SRCCOPY);
Each and every SetPixel call returns -1 (as if I'm trying to draw outside the clipping area). All other GDI functions return TRUE. It's worth noting that if I draw directly onto the dialog's DC, everything's great, so it's unlikely that my pixel drawing routine is bad or something... but why isn't the DC big enough to hold my pixels? How can I change its size? I've trying using the SetBoundsRect method, but I'm not sure which flags to use. In any combination I tried, the SetPixel calls still returned -1..
Any ideas?
Thanks...
/=/=/=/= Sagmam =\=\=\=\
|
|
|
|
|
You need to create a bitmap of appropriate size to draw onto. The code below may help
CDC* pDC = GetDC();
ASSERT(pDC != NULL);
CRect rc(0, 0, 100, 100);
CDC memDC;
memDC.CreateCompatibleDC(pDC);
CBitmap bitmap;
bitmap.CreateCompatibleBitmap(pDC, rc.Width(), rc.Height());
CBitmap* pOldBmp = memDC.SelectObject(&bitmap);
...Draw some pixels
memDC.SelectObject(pOldBmp);
ReleaseDC(pDC);
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Hi there!
My project looks like this:
#1 - libiupwin.lib - library written completely in C
#2 - app.exe - application written in C++ - depends on libiupwin.lib
The problem:
I can compile #1, and a .lib file is generated
I can compile #2, but linker fails with plenty of messages like:
Unresolved external '_iupDlgNext' referenced from (...)\libiupwin.lib|itraverse
"itraverse" is one of C files included in library, and iupDlgNext is of course a function (placed in library, too). I found one instance of 'iupDlgNext' and one instance of '_iupDlgNext' in a .lib file (using a text search).
I guess this has something to do with differences between C and C++ function calls, but since I have little experience with "linking problems" I could use some help with this one.
Thanks in advance.
[ CoY0te ]
Coyotus incrediblus...
|
|
|
|
|
If you have a header file for this library, you might need to add some lines like this at the top:
#ifdef _cplusplus
extern "C" {
#endif
and lines like this at the bottom
#ifdef _cplusplus
}
#endif
rebuild your C++ components, then see if it links okay.
|
|
|
|
|