|
I just check the memory address.
When I called rect/pt value in the function it reads a new memory address location?!? And it doesn't do that with int.
The View contructor was only called once.
|
|
|
|
|
Disregard. I figured out why. I feel very stupid right now
When I chaged declaration to header, I forgot to clear the declaration in the function(I thought I did).
I am surprise the compiler didn't raise flag about the overlap. Hmm I remember there was a declaring function to tell the program which overlap variable to use.
|
|
|
|
|
I am getting these linking errors. i would appreciate if someone has already had these errors and let me know how he or she resolved them.
Linking...
LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/FORCE' specification
Creating library ..\mmig\m3.lib and object ..\mmig\m3.exp
vld.lib(vld.obj) : error LNK2019: unresolved external symbol __CrtDbgReport referenced in function "public: __thiscall VisualLeakDetector::VisualLeakDetector(void)" (??0VisualLeakDetector@@QAE@XZ)
vld.lib(vld.obj) : error LNK2019: unresolved external symbol __CrtSetAllocHook referenced in function "public: __thiscall VisualLeakDetector::VisualLeakDetector(void)" (??0VisualLeakDetector@@QAE@XZ)
vld.lib(vld.obj) : error LNK2019: unresolved external symbol "void __cdecl std::_Xran(void)" (?_Xran@std@@YAXXZ) referenced in function "private: class std::basic_string,class std::allocator > __thiscall VisualLeakDetector::buildsymbolsearchpath(void)" (?buildsymbolsearchpath@VisualLeakDetector@@AAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
vld.lib(vld.obj) : error LNK2019: unresolved external symbol "void __cdecl std::_Xlen(void)" (?_Xlen@std@@YAXXZ) referenced in function "private: void __thiscall VisualLeakDetector::reportleaks(void)" (?reportleaks@VisualLeakDetector@@AAEXXZ)
..\mmig\m3.dll : fatal error LNK1120: 4 unresolved externals
Jay
|
|
|
|
|
|
How to display ohm sign, 'Ω', on the screen using VC++, VC++ .net and VB.net? if possible?, What is the project setting?
|
|
|
|
|
ds feng wrote:
How to display ohm sign, 'Ω', on the screen...
Is this a console or a GUI application?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
The console does not support it, and a GUI application will need unicode for that sign because the ANSI converts it to 0x4F and that is 'O'.
Don't try it, just do it!
|
|
|
|
|
Why did you delete your answer??
The unicode data for L"Ω" is 0xA9 0x03 0x00 0x00.
=> WORD wOhm = 0x03A9;
Don't try it, just do it!
|
|
|
|
|
Hi ds feng,
#ifndef UNICODE
#define UNICODE
#ifdef UNICODE
//ur code for display ohm goes here
#endif
This might solve your problem.
Cheers,
Vishal
|
|
|
|
|
Hi everybody, i have a problem with CEdit, for example
CString s1="Hello World";
CString s2="This is a Test";
//and we have CEdit variable m_edit
m_edit=s1+"\n"+s2;
as you see i want the result to be
Hello World
This is a Test
but CEdit shows :
Hello World This is a Test
though CEdit is marked in properties as "Multiline"
Can anybody help??
Regards
m0n0
|
|
|
|
|
replace \n with \r\n
it will work... even today (April, 1st)
ps: is your EditBox declared as MultiLine ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
|
|
Hi gurus
I'd like to know how I can brutally kill a running thread created via AfxBeginThread ?
The core of the function looks like this:
while (!m_dwBytesRead && (nRetries < 2600))<br />
{<br />
m_pReadThread=AfxBeginThread(ReadThread, this, THREAD_PRIORITY_NORMAL);<br />
<br />
nRetries++;<br />
::Sleep(600);<br />
<br />
if (!m_dwBytesRead)<br />
{<br />
}<br />
}
Thanks.
Best regards.
There is no spoon.
|
|
|
|
|
To end the thread, call AfxEndThread from within the thread, or return from the controlling function of the worker thread.
MSDN is your answer.
Don't try it, just do it!
|
|
|
|
|
no, not from inside the thread... The creator of the thread, kills its created thread.
<br />
while (!m_dwBytesRead && (nRetries < 2600))<br />
{<br />
m_pReadThread=AfxBeginThread(ReadThread, this, THREAD_PRIORITY_NORMAL);<br />
<br />
nRetries++;<br />
::Sleep(600);<br />
<br />
if (!m_dwBytesRead)<br />
{<br />
}<br />
}<br />
There is no spoon.
|
|
|
|
|
|
I wish the creator of the thread kill his created thread:
while (!m_dwBytesRead && (nRetries < 2600))<br />
{<br />
m_pReadThread=AfxBeginThread(ReadThread, this, THREAD_PRIORITY_NORMAL);<br />
<br />
nRetries++;<br />
::Sleep(600);<br />
<br />
if (!m_dwBytesRead)<br />
{<br />
}<br />
}
There is no spoon.
|
|
|
|
|
ok, i so repost my question :
don't SendMessge() work with the correct argument ? (i don't remember which, but it might be something like WM_KILL or WM_END)... of course, sent to the correct thread, ie. m_pReadThread
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
no, the owner of the thread is not a window. the owner of the thread is a CObject derived class. There must be a way for the owner of the thread to kill its own created thread without condition.
There is no spoon.
|
|
|
|
|
where did you see that SendMessage() was a member of CWindow or CDialog or i don't even know what else... there's a global one ...
but if you don't want (and you ahve the right to), don't do it ...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hi,
I have explained the purpose of the thread a little bit late. So I repeat the purpose:
the thread just call the ReadFile API. So, if nothing comes, the ReadFile API waits indefinitly. Thus, I can't use OVERLAPPED because it is not supported by the driver. So, I can use only synchronous IOs in my thread. The way I want to handle the ReadFile timeouts (it's not serial IOs) is to use the ReadFile API in a thread and the caller create and destroy the thread after an amount of time while nothing comes. If something comes, the thread finish itself naturally.
I can create the thread, but I don't know how I can destroy the thread FROM the caller. not inside the thread itself.
so, you understand, that if I try to exit FROM the created thread, once it waits for data from the ReadFile , I can wait forever and the thread never exits because it is blocked by the ReadFile API. That's why I need to kill the thread from outside without condition. see what I mean?
thanks.
There is no spoon.
|
|
|
|
|
Hain Tox!!!
Actually Worker thread don't have any message handlling capability! So how it's going to handle SendMessage(...) Thread.
Same thing is possible with UI threads where you can use PostThreadMessage(..)to send message to the thread!
[Vote One Here, Complete my Survey....]
Alok Gupta visit me at http://www.thisisalok.tk
"I Think Believe this Will Help"
|
|
|
|
|
why can't you use global flag and in your child thrad put the code in a loop,like this(Exit is boolian veriable from CTestDlg class):
void CTestDlg::OnTest()
{
while (!m_dwBytesRead && (nRetries < 2600))
{
Exit = false;
m_pReadThread=AfxBeginThread(ReadThread, this, THREAD_PRIORITY_NORMAL);
nRetries++;
::Sleep(600);
if (!m_dwBytesRead)
{
Exit = true;
}
}
}
UINT ChildThrad(LPVOID lpvoid)
{
CTestDlg *dlg = (CTestDlg *)lpvoid;
while(!dlg->Exit)
{
}
return 0;
}
|
|
|
|
|
the thread just call the ReadFile API. So, if nothing comes, the ReadFile API waits indefinitly. Thus, I can't use OVERLAPPED because it is not supported by the driver. So, I can use only synchronous IOs in my thread. The way I want to handle the ReadFile timeouts (it's not serial IOs) is to use the ReadFile API in a thread and the caller create and destroy the thread after an amount of time while nothing comes. If something comes, the thread finish itself naturally.
I can create the thread, but I don't know how I can destroy the thread FROM the caller. not inside the thread itself.
Best regards.
There is no spoon.
|
|
|
|