|
and i get a error
|
|
|
|
|
Congratulations. Since you do not offer anything about that error, and my ESP is down for maintenance, I guess my work here is done.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
i only saw now that i havent finished it, i sent you a reply but seems like it didnt go thru , i get a (textbox8)login form does not exist in current context
|
|
|
|
|
sorry i only see now that i didnt finish it uhm i get a (textbox8) login form not part of current .....
|
|
|
|
|
You can't directly refer to controls on another Form from within a Form. You must expose a method or property on the other Form by which to retrieve the value of the control.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
ok makes sense , how do i do that
public form 1
|
|
|
|
|
Go back to your study guides and learn how to expose properties of your class objects.
|
|
|
|
|
I am struggling for some while to coloring a control scrollbar, with DrawThemeBackground . (any control, no matter what) ... here is the trial:
void CMyControl::OnDraw(CDC* pDC)
{
HTHEME hTheme = OpenThemeData(m_hWnd, L"WINDOW");
if(NULL != hTheme)
{
if(WS_VSCROLL & GetStyle())
{
SCROLLBARINFO si;
si.cbSize = sizeof(SCROLLBARINFO);
GetScrollBarInfo(OBJID_VSCROLL, &si);
CRect rect(si.rcScrollBar);
pDC->FillSolidRect(&rect, RGB(255, 0, 0));
HRESULT hResult = DrawThemeBackground(hTheme, pDC->GetSafeHdc(), SBP_LOWERTRACKVERT, SCRBS_NORMAL, &rect, NULL);
if(S_OK == hResult)
TRACE("ok\n");
else
TRACE("not ok !\n");
}
CloseThemeData(hTheme);
}
}
And I always get not ok ! ... What I'am doing wrong here ? The scrollbar rectangle are ok, I verified ... can you help me ? Thank you.
|
|
|
|
|
Print the HRESULT code upon failure. It may help to identify the error source (e.g. by printing the corresponding error message using FormatMessage or searching for the code in WinError.h).
|
|
|
|
|
I cheked:
E_FAIL Unspecified failure 0x80004005
I am stuck
P.S. But I would try FormatMessage too ...
modified 15-Jul-15 9:05am.
|
|
|
|
|
Flaviu2 wrote: But I would try FormatMessage too That would not help because it will print something similar ("Unspecified error") in the current Windows system language.
I'm sorry, but I have no other ideas.
|
|
|
|
|
Thank you for your interest, it's weird that I haven't see any example of how to use DrawThemeBackground function ...
|
|
|
|
|
I have tried also:
HTHEME hTheme = OpenThemeData(m_hWnd, L"SCROLLBAR");
if(NULL != hTheme)
{
if(WS_VSCROLL & GetStyle())
{
SCROLLBARINFO si;
si.cbSize = sizeof(SCROLLBARINFO);
GetScrollBarInfo(OBJID_VSCROLL, &si);
CRect rect(si.rcScrollBar);
pDC->FillSolidRect(&rect, RGB(255, 255, 0));
HRESULT hRes = DrawThemeBackground(
hTheme,
pDC->GetSafeHdc(),
SBP_UPPERTRACKVERT,
SCRBS_NORMAL,
&rect,
NULL);
TRACE("HRESULT: %d|%d: OK ? %d\n", hRes, S_OK, hRes == S_OK);
}
CloseThemeData(hTheme);
}
And the result are S_OK now, which is good, however, I have seen nothing colored ... strange ...
|
|
|
|
|
|
I have checked for the first time, but I formatted as int (%d), that's why I saw noise there, not real error returned ... so tricky this DrawThemeBackground function ...
|
|
|
|
|
Hello there. I have this project which compiles fine but VS IDE shows that it can not find identifier. Under these identifiers are red lines. WHY is it so ??? Is there some setting I need to check??
This world is going to explode due to international politics, SOON.
|
|
|
|
|
It is only the VS tool Intellisense that produces the red lines. Intellisense is not as clever as the compiler, so it may have trouble identifying some symbols. This is less of an issue in newer versions of VS (you didn't say which version you have), but it can still happen in code that requires multiple passes to interpret, e. g. code involving #define macros and/or templates.
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|
|
I am using VS Ultimate 2013.
Stefan_Lang wrote: but it can still happen in code that requires multiple passes to interpret
Did you mean compile ? If not, what do you mean by multiple passes to interpret ??
This world is going to explode due to international politics, SOON.
|
|
|
|
|
I meant interpret in the sense to figure out what a line of code means. Maybe analyze is a better term. Both the compiler and Intellisense need to do this, although for the compiler that's just an intermediate step.
E. g. in a first pass, all preprocessor commands are interpreted, such as #include, #define, and #pragma. After that, most of the code should be plain C/C++, except template definitions: template code is not complete until you specify the template arguments, and that may only happen much later in the code, or, possibly, not at all in the current compilation unit. The purpose of Intellisense (or one of its purposes) is to give you instant feedback on the correctness of code as you type. But it can't give you that feedback for code that requires other code from an entirely different part of the solution.
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|
|
The underlining is done by the editor which is part of the IDE. It parses the source files and tries to find the definitions of variables, functions etc., in the source file itself and the included files. Stefan called this process "interpretation".
The parser (the part of the IDE that does this job) is not a compiler. But it is somewhat similar to a compiler by performing identical or similar tasks to check the source code.
A compiler processes his input files not in one go but uses multiple "passes". The parser might not do this or might not perform always similar to a compiler. This may then lead to the behaviour you are seeing.
|
|
|
|
|
It dependes on the identifier, where in the code it occurs, and what results you get from the build. Without more information it's difficult to make any other comments.
|
|
|
|
|
I am building a small database app on SAM3x8e hardware and decided that C++ will do.
I basically need to find a matching record and have an idea how to do it.
I don't see any timing issues.
I was just curious how the "big boys" do search on VERY large database.
I have heard about hash tables etc.
OK, I can Goggle , but some pointers would be appreciated.
Cheers
Vaclav
|
|
|
|
|
I'm unclear on what you are asking. Are you using an existing database product? Or are you trying to create your own database system?
|
|
|
|
|
It is almost impossible to search a database without an SQL like query language, unless you know the exact structure of the data held inside it.
|
|
|
|
|
Vaclav_Sal wrote: I am building a small database app on SAM3x8e hardware...I was just curious how the "big boys" do search on VERY large database.
First part of that is basically incompatible with the second.
In general the solution for your problem is similar in a very broad way in that one must:
1. Understand the data
2. Understand the searches needed.
The solution(s) are then based on that.
So for example it is pointless to use a hash if you are doing regular expression searches on free form text.
|
|
|
|