|
ky_rerun wrote: if you use intelisence you will notice that intelisence will only show you two variable associated with class test m_sUserId and m_sUserID if you break the program before it exits and use the hover over feature or the watch window the debugger thinks the members have the same value.
Yup, a defect, I can reproduce it too.
|
|
|
|
|
Hello,
I'm receiving some linking errors while attempting to build my Visual C++ program. Here is an example of one such error: "nafxcw.lib(apphelp.obj) : error LNK2001: unresolved external symbol __mbctype". Any help is appreciated.
Mike
|
|
|
|
|
See Q166504 maybe its some helpful for you
|
|
|
|
|
After viewing http://support.microsoft.com/default.aspx?scid=kb;en-us;166504, I checked my project settings. In
Project, Settings, General, Microsoft Foundation Classes: "Use MFC in a Static Library"
Project, Settings, C/C++, Category, Code Generation, Use run-time library: "Multithreaded"
Project, Settings, Link, Input, Ignore Libraries: "libcmt"
Perhaps I'm missing something.
Mike
|
|
|
|
|
mla154 wrote: Use run-time library: "Multithreaded"
Try Multithreaded DLL, see if that solves the problem.
|
|
|
|
|
Multithreaded DLL gives me a different set of linker errors:
--------------------Configuration: Icdm - Win32 Release Windows 95--------------------
Linking...
nafxcw.lib(apphelp.obj) : error LNK2001: unresolved external symbol __mbctype
nafxcw.lib(timecore.obj) : error LNK2001: unresolved external symbol __mbctype
nafxcw.lib(dcprev.obj) : error LNK2001: unresolved external symbol __mbctype
nafxcw.lib(filelist.obj) : error LNK2001: unresolved external symbol __mbctype
nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv
nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc
D:\code\Visual C++ Projects\!Work\ICDM - Mike L\HC-Release\Icdm.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.
Icdm.exe - 7 error(s), 0 warning(s)
|
|
|
|
|
See here[^] I think its helpful for you
|
|
|
|
|
How would ichange the color of text written in an edit box?
I use the following to write the text
CEdit m_mycontrol
m_mycontrol.SetWindowText("my control text");
If it is possible to change the color of the text, how would i do that using the above?
|
|
|
|
|
|
Here's a way...
Add a handler in the parent window/dialog for the WM_CTLCOLOR
message.
For example, to set the text of an edit control with an ID of
"IDC_MYEDITCONTROL" to light blue:
<br />
HBRUSH MyDialogOrWindowClass::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)<br />
{<br />
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);<br />
<br />
if (pWnd->GetDlgCtrlID() == IDC_MYEDITCONTROL)<br />
pDC->SetTextColor(RGB(0, 0, 255)); <br />
<br />
return hbr;<br />
}<br />
Mark
|
|
|
|
|
|
Im working with MFC in VC6.0
I have a button which sets a edit box some stuff, then waits, then sets it again and waits three times:
on click:
set box "3"
sleep 1000
set box "2"
sleep 1000
set box "2"
sleep 1000
//stuff
set box "done with stuff"
it counts down, but then ignores setting the box... it only sets the last one, done with stuff...
ive tried with SetDlgItemText, UpdateData(FALSE) [and the rest of that one] and manualy hiding/showing dlg items.. it allways just skips the ones withing waits...
why/how can i fix it?
thanks!
/Johannes
Johannes
|
|
|
|
|
code snippet
"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
Support CRY- Child Relief And you
|
|
|
|
|
Johannes,
Calling Sleep() in your UI thread prohibits the Windows messages
required (WM_PAINT) to update the control from being processed.
Try this:
on click:
set box "3"
box.Invalidate()
box.UpdateWindow()
sleep 1000
set box "2"
box.Invalidate()
box.UpdateWindow()
sleep 1000
set box "2"
box.Invalidate()
box.UpdateWindow()
sleep 1000
Keep in mind, calling Sleep() like this effectively freezes your
user interface for 3 seconds...not always the desired effect
Hope this helps,
Mark
|
|
|
|
|
Yea it kinda frezes but thats OK,
Im not exactly sure how thoes functions are to be used, the dlg box is called status, and the variable to it (add member variable) is m_status, so normaly i use:
m_status = "Two!";
UpdateData(FALSE);
To set it to "Two!". But how would i use th ones you said?
ive got loads to learn..
thanks!!
/Johannes
|
|
|
|
|
m_status = "Two!";
UpdateData(FALSE);
That's fine. UpdateData() will set the text of the control.
But still, if you are going to sleep, you need to make sure the
text is redrawn on the screen beforehand, otherwise it won't be repainted
until after the Sleep()s.
Mark
|
|
|
|
|
How do i make it repaint?
thanks!
/Johannes
|
|
|
|
|
Force it to repaint immediately (after setting the new text)
by using these two functions:
Invalidate();
UpdateWindow();
Mark
|
|
|
|
|
Works perfectly!
thanks a million!
/Johannes
|
|
|
|
|
The thread that is doing the sleeping is also the thread that would be 'painting' the new text. When your method is complete, there will be four paint messages that are handled one right after the other in to quick a fashion so that you see only the final result.
As to how to 'fix' this, you can implement a timer instead of sleeping and repond to the timer messages.
Chris Meech
I am Canadian. [heard in a local bar]
Nobody likes jerks. [espeir]
The zen of the soapbox is hard to attain...[Jörgen Sigvardsson]
I wish I could remember what it was like to only have a short term memory.[David Kentley]
|
|
|
|
|
It sounds like you need a separate thread to do the work so that the main thread can respond to the UI messages. Without more details, however, I can't say for sure.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Problem is resolved using:
Invalidate();
UpdateWindow();
thanks to MSalsbery and the rest whom replied
thanks all!
/Johannes
|
|
|
|
|
I just installed VC8 and am in the process of integrating my projects. There are many errors I have never seen before, also the layout of VC8 is somewhat confusing.
Two errors are my main concern right now:
1. error C2058: constant expression is not integral
Comes from an enum declared within a class
enum Keys
{
classesRoot = HKEY_CLASSES_ROOT,
};
and:
2. cannot convert parameter 1 from '_single_tile *' to 'std::_Vector_iterator<_Ty,_Alloc>'
tiles.erase(&tiles[p2]);
where tiles is a vector of structs. This works well in VC6, I can't understand why VC8 throws an error.
|
|
|
|
|
With the first one, locate the definition of HKEY_CLASSES_ROOT. As the error message indicates, it must be integral, so wherever you have it defined, it is likely not integral. As to your second one, I'm guessing that the changes implemented to the STL that ships with VC8 are considerable when comparing it to the STL that shipped with VC6. There is likely a standards conformance reason for some change that is causing your code to now produce that error. Someone with more STL knowledge might provide better insight though.
Chris Meech
I am Canadian. [heard in a local bar]
Nobody likes jerks. [espeir]
The zen of the soapbox is hard to attain...[Jörgen Sigvardsson]
I wish I could remember what it was like to only have a short term memory.[David Kentley]
|
|
|
|
|
I don't mean to sound stupid, but what does integral mean?
|
|
|
|