|
Hi
I copied source files and its interfaces from one project to another , and even I've copied the Dialog resource.When I compile it gives errors
error C2065: 'IDC_MASS_RANGE_PANEL' : undeclared identifier
'IDC_MASS_RANGE_MIN_BOXES' : undeclared identifier
The source code is
m_rangeLabelsPanel->Create("", WS_VISIBLE | WS_CHILD, rect, this, (IDC_MASS_RANGE_PANEL));
The only solution I do is to modify the resource.h file each time I get this error with some random numbers.Is it the correct way? Is there anything I must change ? any help is highly appreciated..
|
|
|
|
|
Did you copy or cut and paste the needed entries from resource.h?
Dave
|
|
|
|
|
I copy it but chnage the number as the number sometimes clashes with other..!
|
|
|
|
|
sunguy wrote:
I copy it but chnage the number as the number sometimes clashes with other..
Do u check our Identifier is defined in your header or cpp file or not?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Did you #include "resource.h" in the source or header file?
|
|
|
|
|
Hi there!
I have a derived class from CFormView, and sice this form needs to load lots of data, I would like to show a progress bar that is already in the form.
If I do the load and show the progress in the OnInitialUpdate(), I cannot see the progress going!
I've tried to do a PostMessage in the OnInitialUpdate, and manage the message afterwards... but no progress in sight!
I also tried to do a PostMessage in the OnShowWindow when the bShow is TRUE. Again not yet visible!
Does any one knows what message should I catch after the form is visible?
I'm using a variable to count if its the first time I have a Paint... but it seems that its not the way to do it...
Thanks for your time in advance.
|
|
|
|
|
why not use a splash screen?
|
|
|
|
|
Yes it could be. And I also could use a dialog with a progress, which I already have.
But, I don't want them! Besides, the problem remains, and I don't want a workarround (wich I already have, via the WM_PAINT).
The real problem is: why do I get a WM_SHOWWINDOW message and the form is not visible? What message sould I expect after the form is shown?
I don't want a workarround, just to understand the message sequence...
ALMC
|
|
|
|
|
Hello everybody,
I am writing a simple application in MFC , similar to Spy++ Utility , that displays different information about chosen window.
I want to draw that black rectangle(like in Spy++) over windows ,when mouse is over that window. I manage to draw it , but when i move mouse to another window the rectangle stays on the previous window and on the new also.
I used to store previous windows handle and when the mouse was over another window i used to call the Invalidate() function for the previous window.
For some strange reasons this worked on 90% of the windows , there were some windows where the rectangle stayed partialy.
Can anyone suggest me any another way of achieving this??
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|
|
Look here:
http://www.codeproject.com/dialog/windowfinder.asp
Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about about mission statements. -- Peter Gibbons
|
|
|
|
|
I've seen this article already , but this program is written in with Win32, and i could not implement the technique Lim is using there in MFC
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|
|
Giorgi Moniava wrote:
...this program is written in with Win32, and i could not implement the technique Lim is using there in MFC
Why not?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
|
thanks alok
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|
|
Giorgi Moniava wrote:
thanks alok
Mention Not Buddy
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Here is a server that receice UDP visit.
The parameters of socket include the destination IP address and port.
Moreover, how to get the source IP address and port?
Thanks!
|
|
|
|
|
If you're using accept , the second parameter is an optional pointer to a structure that contains source information.
|
|
|
|
|
Hi folks!
I'm working on a MFC project and i've got a question to make. The project i'm involved in, is a dialog based aplication. So, the Wizard took the first steps of the work. I'm basing the program on an example that has been created entirely programming, and it makes reference to a HWND handle variable that is necessary to pass to one of the methods.
The code is like this:
Code:
HRESULT CText::BlendText(HWND hwndApp, TCHAR *szNewText)
{
LONG cx, cy;
HRESULT hr;
CSubtitlesDlg dialog;
// Create a device context compatible with the current window
HDC hdc= GetDC(hwndApp);
HDC hdcBmp = CreateCompatibleDC(hdc);
// Write with a known font by selecting it into our HDC
HFONT hOldFont = (HFONT) SelectObject(hdcBmp, g_hFont);
// Determine the length of the string, then determine the
// dimensions (in pixels) of the character string using the
// currently selected font. These dimensions are used to create
// a bitmap below.
int nLength, nTextBmpWidth, nTextBmpHeight;
SIZE sz={0};
nLength = (int) _tcslen(szNewText);
GetTextExtentPoint32(hdcBmp, szNewText, nLength, &sz);
nTextBmpHeight = sz.cy;
nTextBmpWidth = sz.cx;
// Create a new bitmap that is compatible with the current
//window
HBITMAP hbm = CreateCompatibleBitmap(hdc, nTextBmpWidth,
nTextBmpHeight);
ReleaseDC(hwndApp, hdc);
// Select our bitmap into the device context and save the old one
BITMAP bm;
HBITMAP hbmOld;
GetObject(hbm, sizeof(bm), &bm);
hbmOld = (HBITMAP)SelectObject(hdcBmp, hbm);
...
I make a reference to this method in another class like this:
Code:
hr = Text.BlendText(___________, Text.g_szAppText);<- I need to know what to put in here
Does anybody know which method do i need to use in order to get this handle to the window i'm working with? I wonder if the question is clear, but i'll try!! Many thanks. Serj.
|
|
|
|
|
Did you try
AfxGetMainWnd()->m_hWnd
John
|
|
|
|
|
In continuation with Mr John... , you can use this tooo
AfxGetMainWnd()->GetSafeHwnd
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I am trying to get the text from a control in another process. I know the handle for the control and I know the afx class name. It is as follows:
Class Name : Afx:400000:20
This control is part of a chatbox in an external application. I have tried several different things but I have so far failed to get the text from it.
Any ideas or help would be greatly appreciated.
Thanks.
Dave
|
|
|
|
|
cats8199 wrote:
I have tried several different things...
Such as?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
I have tried sending the messages EM_GETLINECOUNT and WM_GETTEXT. Both return zero. This is a multiline text box. I have tried treating it as a CListBox, a CComboBox and a CListCtrl. All to no avail.
Dave
|
|
|
|
|
cats8199 wrote:
This is a multiline text box. I have tried treating it as a CListBox, a CComboBox and a CListCtrl. All to no avail.
It's no surprise! Why haven't you tried CEdit instead? That, however, is not the problem here. If neither EM_GETLINECOUNT nor WM_GETTEXT worked, using an MFC class is just added complexity.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Send the WM_GETTEXT message to that control.
Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about about mission statements. -- Peter Gibbons
|
|
|
|