|
I am using CWinThread to process data. The processing is working great, but the graphs that I am loading don't display fast enough to keep up with the data processing. How can I get my thread to wait for the graphics to finish displaying??? right now I am using Sleep statements, but I know that this is not a good idea. Any advice is appreciated.
Thanks.
|
|
|
|
|
You can use the standard synch objects, probably an event would be the best for your situation. Look up CreateEvent() in MSDN, and go from there.
--Mike--
http://home.inreach.com/mdunn/
your with and
|
|
|
|
|
Thanks for your reply... I have been messing around trying to get this to work with a CreateEvent, but I can't get it. Do you happen to have some example code, or know where I can find an example of this working. Thanks in advance.
|
|
|
|
|
|
[client]->[com]->[DLL] function calls
[DLL]->[com] window message
[com]->[client] function retvals and events
I have a com object where i use loadlibrary,
i want to recive windows message to the com from the dll
is that possible?
Christer
|
|
|
|
|
I am wondering if anyone has installed STLPort-4.5 on their VC++ installation?
I have downloaded it (after being introduced to it by Christian Graus) and read through the doco. If I want to use the iostream that comes with STLPort-4.5 I use installation method 1. If I don't want the iostream then I use method 2.
I am wondering what I lose/gain by using the STLPort-4.5 versions?
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
"Don't belong. Never join. Think for yourself. Peace"
- Victor Stone
|
|
|
|
|
>I am wondering what I lose/gain by using the STLPort-4.5 versions?
Are you talking in general or specific to the 4.5 version ?
I have been told by a friend who had installed it, that it is general a better version of STL implementation, and that it had a few extra's like hash_map and so on. As I recall I have also browsed the code and I remember thinking it was much more readable than the crap the comes with VC.
|
|
|
|
|
I think I am talking about the iostream stuff that comes with 4.5. Also if I will break anything else in VC++ if I install it.
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
"Don't belong. Never join. Think for yourself. Peace"
- Victor Stone
|
|
|
|
|
Yes, it does better with compliance, although definitely not perfect. (Use C++ Builder or CodeWarrior for that. I don't even recommend GCC for compliance -- it fails for me on bitset operations.)
From what's been posted on the site, I hear the Dinkumware upgrade is better with VC, but I can't attest to this -- I got BCB for less than Dinkumware's STL upgrade.
CodeGuy
The WTL newsgroup: 940 members and growing ... http://groups.yahoo.com/group/wtl
|
|
|
|
|
When I was debugging a multi-threaded program, it generated a unhandled exception and I got the following call stack:
NTDLL! 77fcbaac()
KERNEL32! 77e665d6()
CNoTrackObject::operator new(unsigned int 4) line 84 + 12 bytes
CThreadLocal<_AFX_CTL3D_THREAD>::CreateObject() line 190 + 34 bytes
CThreadLocalObject::GetData(CNoTrackObject * (void)* 0x5f496dc0 CThreadLocal<_AFX_CTL3D_THREAD>::CreateObject(void)) line 404 + 3 bytes
CThreadLocal<_AFX_CTL3D_THREAD>::GetData() line 173 + 13 bytes
CThreadLocal<_AFX_CTL3D_THREAD>::operator _AFX_CTL3D_THREAD *() line 183 + 15 bytes
AfxInitThread() line 272 + 10 bytes
_AfxThreadEntry(void * 0x0235fc78) line 73
_threadstartex(void * 0x1ab86af8) line 212 + 13 bytes
KERNEL32! 77e6758a()
Could anyone tell me why it got into those functions?
Law is meaningless without chaos.
Chaos without Law is equal to destruction.
Chaos and Law create our rich and colorful world.
|
|
|
|
|
Hi.
I was wondering if there are any sites or resources that talk about multiprocessor programming or has code snippets etc for this. With this, you should be able to get very close to semi hard realtime I am assuming. Does anyone also have any ideas of where to find any clues about writing somesort of driver or something that can constantly do lets say data acquisition and such at a hard realtime rate while the GUI works when it can?
Thanks
|
|
|
|
|
Here is a function:
void Foo(CFtpConnection *pFtpConnection)
{
CFtpFileFind finder(pFtpConnection);
CString currentDir;
BOOL bFlag=FALSE;
bFlag=finder.FindFile(NULL);
pFtpConnection->GetCurrentDirectory(currentDir);
while(bFlag) {
bFlag=finder.FindNextFile();
if(!finder.IsDots()) {
pFtpConnection->SetCurrentDirectory(finder.GetFileName());
pFtpConnection->SetCurrentDirectory(currentDir);
}
}
finder.Close();
}
When I call this function with a valid CFtpConnection object's address, will it generate some errors? If so, could you explain something to me?
Law is meaningless without chaos.
Chaos without Law is equal to destruction.
Chaos and Law create our rich and colorful world.
|
|
|
|
|
HI.
I have done everything I know of to try to get rid of the blasted title bar in a CFrameWnd derived Frame with CFormView views. I would think that if you get rid of the WS_CAPTION in the Precreatewindow that should do the job but nope. I also got rid of the MENU OK in there by setting it to NULL.
Any clues?
|
|
|
|
|
In the mainframes OnCreate() function :
ModifyStyle(WS_CAPTION,0,SWP_FRAMECHANGED); // removes title bar
ModifyStyle(0,WS_CAPTION,SWP_FRAMECHANGED); // brings it back
|
|
|
|
|
Hi,
I have a CListCtrl, which doesn't seem to refresh properly. All is well until i call a dll which opens a window, when the window is moved over the CListCtrl it refreshes fine. But if the window is closed whilst covering the Clistctrl the covered region doesn't refresh. But all other controls seem to refresh fine under these circumstances
Cheers
Richard
|
|
|
|
|
Hi,
Did you come up with a solution to this problem cause I have reached the exact same situation?
/Tommy
|
|
|
|
|
I have declared the class CMyDoc like this :
"class CMyDoc : public COleServerDoc, public CMyClass"
Definition of class CMyClass :
"class CMyClass {
protected :
double mAge;
COtherClass mOtherClass; //(not derived from a CObject
class)
}"
the serialization of members like mAge works correctly, but when I want serialize class members like mOtherClass, the compiler send me the following error :
"error C2678: binary '<<' : no operator defined which takes a left-hand operand of type 'class CArchive' (or there is no acceptable conversion)".
How can serialize such members, must I make the class COtherClass serializable ?
thank in advance for your help.
Fred.
Fred
|
|
|
|
|
You have two options:
1) create an operator<< which accepts a reference to COtherClass as 2nd parameter
2) 'manually' serialize data members of COtherClass in CYourClass::Serialize. In this solution, CYourClass needs an access to COtherClass members, directly or through accessor/mutator methods.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thank for your fast response, but can you be more explicit in your soluces.
I have joined here fragments of my aplication :
//class CMyDoc :
void CMyDoc::Serialize(CArchive& ar)
{
COleServerDoc::Serialize(ar);
if (ar.IsStoring()){
ar << mAge;
ar << mOtherClass;
}else{
ar >> mAge;
ar >> mOtherClass;
}
}
//*********************************************************
class CMyClass
//**** operator << ****
ostream& operator << (ostream &os, CMyClass &pClassTest )
{
os << "Classe " << pClassTest.mAge << endl
<
|
|
|
|
|
I have a property sheet with several pages present in it.
On one of the pages, it is necessary to update another 2 pages if I make a certain change, to have it reflected on the other pages if I tab to them.
This seemed like a candidate for a user defined message to all the pages of the sheet, so each page could either notice or ignore the action and take whatever action is required.
My first attempt was in the propertypage code, a new message handler
#define UWM_NEWROWCOL (WM_USER + 1)
ON_MESSAGE(UWM_NEWROWCOL, OnNewRowCol)
implementation
LRESULT CDragDataPage::OnNewRowCol(WPARAM wparm, LPARAM lparm)
{
TRACE("Drag New Row/Col %d %d\n", wparm, lparm);
return 1;
}
then to send the message I've tried:
CWnd *parent = GetParent(); // parent of the propertypage is the propertysheet??
parent->PostMessage(UWM_NEWROWCOL, UWM_NEWROW, cell.row);
and
parent->SendMessageToDescendants(UWM_NEWROWCOL, UWM_NEWROW, cell.row, TRUE, TRUE);
The 2nd version occasionally succeeds, in calling the handler for the page its being sent from (but not always), but not usually for the other pages of the sheet with similar registered handlers. If I set a breakpoint on the SendMessageToDescendants it sometimes works, but it pretty random.
I'm sure I'm doing something stupid here. Question is what
Julian.
|
|
|
|
|
Other property pages may have not been fully constructed when you send the message. By default, property sheet creates a window (HWND) when you activate given page. If you want to create all HWNDs for property pages during initialization, use PSP_PREMATURE flag.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Brilliant - thats what the problem was. Many thanks!!!
Julian.
|
|
|
|
|
Hi,
I'm developing an application and I would like it to utilise a WebBrowser control. I would like to control the scroll bars and border styles programatically, only the Microsoft control does not appear to allow access to these properties.
Are there any alternative controls out there?
Matthew
|
|
|
|
|
Hello everybody,
I have a big problem.
I can't execute an executable file in witch i call class import
from two dll.
When i launch my exe the error:
0xC000000FD:Stack overflow
appear.
What can i did for such a problem?
Thanks for help.
|
|
|
|
|
Stack overflow usually means that you have infinite recursion in your program. Have a look at Call Stack debug window when your program crashes - you'll see where's the problem.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|