|
sorry, i'm lost too...
maybe with more explanation, but nop, can't help you man
TOXCCT >>> GEII power
|
|
|
|
|
I've found it!!!
The problem is that IDD_ESTAD_CE_GENERAL value cannot be accesed by my class (I don't know why)
Maybe is not a good solution but I've substituted IDD_ESTAD_CE_GENERAL for his value and all is working correctly.
This value is always the same,isn't it?
Thanks pal for your time.
Doc
|
|
|
|
|
as you say, not a very good solution !
try to find out why this was nos accessible....
TOXCCT >>> GEII power
|
|
|
|
|
doctorpi wrote:
error C2065: 'IDD_CE_GENERAL' : undeclared identifier
C:\Whatever...\MyDialog.h(25) : error C2057: expected constant expression
IDD_CE_GENERAL will be defined in your resource.h file. Make sure that you #include "resource.h" in your include tree. You can place it in your MyDialog.h header.
Michael
But you know when the truth is told,
That you can get what you want or you can just get old,
Your're going to kick off before you even get halfway through.
When will you realise... Vienna waits for you? - "The Stranger," Billy Joel
|
|
|
|
|
Thanks Michael
Just tried and... working
|
|
|
|
|
The best soluton when you have such cross references is to declare in one of the class a pointer to the other (like CMyDialog* m_pMyDialog in CListCtrlEx.h) and to add the following line at the top of this file:
class CMyDialog .
This will tell the compiler that the class will be declared after (in the cpp file for example). This works only for pointers because when you declare a class, the compiler needs to know the exact size of the object (for a pointer, ths size is always the same).
So, you will have to include MyDialog.h in the ListCtrlEx.cpp file.
You'll have to include also ListCtrlEx.h in the MyDialog.h header file.
Hope this is clear enough
|
|
|
|
|
the program is below: IDC_STATIC is a static control ID,i want replace the static text with a black rectangle.
void CMy06aDialog::OnPaint()
{
CWnd *pWnd=GetDlgItem(IDC_STATIC1);
CDC* pControlDC=pWnd->GetDC();
pWnd->Invalidate();
pWnd->UpdateWindow();
pControlDC->SelectStockObject(BLACK_BRUSH);
pControlDC->Rectangle(0,0,10,10);
pWnd->ReleaseDC(pControlDC);
}
but although it runs ,to my disappointed ,the black rectangle is frequently flash .how to solve this problem,what is the reason for it?
|
|
|
|
|
Your problem is the following lines with the WM_PAINT method:
pWnd->Invalidate();
pWnd->UpdateWindow();
These cause a WM_PAINT message to be sent. Therefore you are forcing a redraw within a redraw!
Removing these lines should have the desired result.
Ant.
|
|
|
|
|
yes ,you are right,i do it in your advice,thank you . ;P
|
|
|
|
|
..on a MFC Dialog Title Bar, i have tried copying from the char map and pasting doesn't work.
i can't even remember what my point is now, but anyway, i'm correct
Barring unforeseen acts of God and Adminstrators, my server will be up tomorrow. I'm more worried about the Adminstrators.
|
|
|
|
|
you must be sure you are unicode-working.
TOXCCT >>> GEII power
|
|
|
|
|
I think you need to select the appropriate font as well ???
just a guess(if no one could give you the exact ans).
|
|
|
|
|
Hello,
at the moment I'm working on a DLL (swlib.dll) at my company and I use the code very often at home. The problem is that the project paths are different:
The application called Renamer3 is in the path
f:\vc++\renamer3 <- at home
f:\programmieren\_code\renamer3 <- at work
so I had the ideo to configure the output path of the dll in the stdafx.h to prevent editing the project settings every day.
I put this code to the stdafx.h
#define HOME // --> when I'm not at home this line will be commented
#ifdef HOME
#define __SW_LIB_OUTPATH "\"f:\\vc++\\Renamer3\\"
#else
#define __SW_LIB_OUTPATH "\"f:\\programmieren\\_code\\Renamer3\\"
#endif
#ifdef _DEBUG
#define __SW_LIB_CONFIG "Debug\\"
#else
#define __SW_LIB_CONFIG "Release\\"
#endif
#pragma comment(linker, "/out:" __SW_LIB_OUTPATH __SW_LIB_CONFIG "SWLib.dll\"")
#pragma comment(linker, "/implib:" __SW_LIB_OUTPATH __SW_LIB_CONFIG "SWLib.lib\"")
#pragma comment(linker, "/pdb:" __SW_LIB_OUTPATH __SW_LIB_CONFIG "SWLib.pdb\"")
Well, but now I'm flooded by 49 Linker warnings and 1 Linker error (when I'm only trying to compile the DLL, not the Renamer3 which depends on it):
warning LNK4070: The directive /OUT:f:\vc++\Renamer3\Debug\SWLib.dll in .EXP does not match the output filename "f:\vc++\Renamer3\debug/SWLib.dll"; directive will be ignored
and
fatal error LNK1104: File "f:\vc++\Renamer3\Debug\SWLib.lib" can't be opened
(I tried to translate the linker messages to English because I'm from Germany, so they could defer from the correct messages )
What's wrong with this code? I think it might be correct...What's strange too is that the fatal error only appeared when I deleted the SWLib.lib in the Folder f:\vc++\renamer3\debug. Before that I was able to compile the Renamer3 but at startup I got a windows message box telling "The application or DLL "f:\vc++\Renamer3\Debug\SWLib.dll" is no valid Windows-File. Check this with the installation disk" ???
I really have no idea what this should mean, the dll ist definitely working!
|
|
|
|
|
I had the same issues, different paths to the project directory on different machines. The solution is used was to add the project directory to the list of include directories and then use #include <> notation.
e.g. (using VC6)
On home machine add 'f:\vc++' to list of include directories in Tools-Options-Directories-Include
On work machine add 'f:\programmieren\_code' to ...
Then in all your code use
#include <Renamer3\...> type sytax.
There shouldn't be any need to mess with the Debug/Release directories.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
great, that's the solution and it's fairly easy! i had another approach -> i used different configurations but that's more complicated...
thank you very much!
|
|
|
|
|
Glad to help.
It's also worth looking at the other directories to set as well i.e. executable, library and source.
For all directory settings make sure the order of the paths is correct, usually yours should be last.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
right, i forgot something: how can i say my main application (the exe) the path of the dll? when i build the program the dll will be placed in
f:\vc++\swlib\debug
and the exe is in
f:\vc++\renamer3\debug
the very issue is that i have more than one program which depend on the dll and the dll isn't complete so i edit one program and the dll, build it and everytime i changed the program i had to change the ouput folder of the dll as well...very annoying
|
|
|
|
|
What i do is have a bin directory where a copy all exe's lib's and dll's get copied when they are created. I also separate my binaries, from my build files, from my source files ... after much trial and error i have found this the most flexible setup.
For the common dll's or static lib's :
e:\lib32\bin\lib\[Release & Debug] - bin\lib gets copy of all static .lib
e:\lib32\bin\dll\[Release & Debug] - bin\dll gets copy of all .dll & .lib files
e:\lib32\bld\mod_1\dll - mod_1 being compiled as a dll, creates .dll & .lib
e:\lib32\bld\mod_1\lib - mod_1 being compiled as a static lib, creates .lib
e:\lib32\src\mod_1 - source for mod_1, #pragma's take care of lib/dll build diffs
As mentioned in previous post i then add e:\lib32\src to Tools-Options-Directories-Include Files and then use #include <mod_1/...> syntax.
I then add e:\lib32\bin\dll\Debug to my system PATH.
You could probably use it for Project-Settings-Debug-Working Directory instead.
Or maybe, Tools-Options-Directories-Executable Files.
For the project specific exe's dll's and static lib's :
e:\prj\prj_1\bin\[Release & Debug] - bin gets copy of all prj_1 .dll, .lib, .exe files
e:\prj\prj_1\bld\mod_2\dll
e:\prj\prj_1\bld\mod_2\lib
e:\prj\prj_1\bld\exe_1
e:\prj\prj_1\src\mod_2
e:\prj\prj_1\src\exe_1
Although it makes more sense to use e:\prj\src\prj_1, i wanted all project files together - up to you.
As for the common libraries, i have added e:\prj\prj_1\src to Tools-Options-Directories-Include Files and then use #include <exe_1/...> syntax.
Now becuase e:\lib32\bin\dll\Debug is in the path i can go into e:\prj\prj_1\bin\Debug and run my program and it finds both project specific dll's (with exe) and common dll's (through PATH).
For my common dll's or lib's i add to Project-Settings-Post-build Step (last page) the following for All Configurations :
copy .\$(OutDir)\$(TargetName).dll ..\..\..\bin\dll\$(OutDir)
copy .\$(OutDir)\$(TargetName).lib ..\..\..\bin\dll\$(OutDir)
or,
copy .\$(OutDir)\$(TargetName).lib ..\..\..\bin\lib\$(OutDir)
For my project specific exe/dll/lib settings it's similar.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
that was a great explanation, thank you very much! now i think i get away with this stuff
|
|
|
|
|
Well I've read several articles about timers and I still don't quite get how to use them. What I'm trying to do is hide(<-I can do this part) a dialog box for X minutes(<-I can't do this part). I don't understand what I need to do to get it to work. Thank you to any who helps and to those who have helped.
|
|
|
|
|
while using the timers after the particular time (ie in millisecends specifed in the triggering function ) Timer Function will be triggered.
In the OnInitDialog() function add the following ,
OnInitDialog()
{
CDialog::OnInitDialog();
.........
SetTimer(1000,5000,NULL);
ShowWindow(SW_HIDE);
return TRUE;
}
Implement the WM_TIMER using classWizard and add the following code
OnTimer(...)
{
ShowWindow(SW_SHOW);
KillTimer(1000); // 1000 is the Timer ID given in the SetTimer function
}
Here the OnTimer will be called after 5 seconds.
|
|
|
|
|
Hi Friends,
I want to know how to stretch the Icons like we do for the BItmap by using StretchBlt(...) function in MFC. and I also want to know how to Display the mouse cursor. and stretch the mouse cursor.
Salman
Live and Let live
|
|
|
|
|
For icons you can use ::DrawIconEx()
Roger Allen - Sonork 100.10016
Strong Sad:
Clever I am? Next to no one.
Undiscovered and soggy.
Look up. Look down. They're around.
Probably laughing. Still, bright, watery.
Listed among the top. Ten.
Nine. Late night. Early morn.
Early mourn. Now I sleep.
|
|
|
|
|
The DrawIcon(Ex) functions can also be used to draw cursors. If you want to stretch/scale them, then I recommend that you create a Memory DC, draw the icon/cursor onto the memdc, get the bitmap from the memdc and use StretchBlt to scale it onto the real DC.
onwards and upwards...
|
|
|
|
|
please have a look at my programm below:
BOOL CMy06aDialog::OnInitDialog()
{
CBrush m_redBrush(RGB(255,0,0));
CBrush m_yellowBrush(RGB(255,255,0));
.........
}
HBRUSH CMy06aDialog::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{ if(nCtlColor==CTLCOLOR_DLG )
{pDC->SetBkColor(RGB(255,0,0));
return m_redBrush;
}
if(nCtlColor==CTLCOLOR_EDIT)
{pDC->SetBkColor(RGB(255,255,0));
return m_yellowBrush;
}
return CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
}
but the result is :only the edit control ,their background color is yellw as i expected,but dialog background color is still gray,why?
|
|
|
|