|
No, it is software for viewing medical images. The application actually uses all the monitors to display the images! The problem is when the user wants to run other applications at the same time such as Internet Explorer or Word.
Chris Hafey
|
|
|
|
|
How do I update the status text on the StatusBar?
Will the process be different, if I have to do it from a worker thread?
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
No, process is your application which can have many threads, so same process but other thread. I'd suggest to use messages, sending a message to main window (AfxGetMainWnd() ) from any location and catch it and change the text in Status bar by using SetMessageText(LPCTSTR) of your frame window.
Philip Patrick
Web-site: www.saintopatrick.com
"Two beer or not two beer?" Shakesbeer
Need ASP hosting? Check out 123HostNow.com
|
|
|
|
|
SendMessage from a worker thread is usually a very bad idea as it can lead to deadlocks. Use PostMessage instead.
The Status Bar is usually updated by CMainFrame::OnUpdateStatusBar() so you shouldn't need to do anything much from your worker thread except set the value of whatever it is you want displayed.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Uhmm, who said to use SendMessage ? Yes, right, only PostMessage , though I wasn't clear by writing "send a message"
But this is not a point. I didn't know about any OnUpdateStatusBar , where it is declared? I know some handlers in CHtmlView for status bar though
Philip Patrick
Web-site: www.saintopatrick.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
Philip Patrick wrote:
Uhmm, who said to use SendMessage?
Sorry, you didn't actually say this. But as soon as I saw "send a message" my brain automatically converted this into SendMessage().
I made a small mistake with OnUpdateStatusBar(). It isn't an MFC function. This is what I do:
BEGIN_MESSAGE_MAP(CMainFrame, CEDMDIFrameWnd)
//{{AFX_MSG_MAP(CMainFrame)
....
ON_UPDATE_COMMAND_UI_RANGE( ID_INS_OVR_PANE, ID_SB_LAST_PANE, OnUpdateStatusBar )
....
And in the CEDMDIFrameWnd class:
afx_msg void OnUpdateStatusBar( CCmdUI *pCmdUI );
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Ah well, you are right at the end, I wrote "send a message" meaning exactly what I wrote without thinking about SendMessage and PostMessage, but yeah, right actually I was getting it as SendMessage too if I were reading my post
Hmm, that's nice, better then catching some custom message like WM_MY_VERY_UGLY_MESSAGE_FOR_STATUS_BAR and processing it I'll write it down to use when I need it.... Small tips makes big products, lol
Philip Patrick
Web-site: www.saintopatrick.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
I am trying to create an OLE module for PCAnywhere 10.0 that will do what the scripting used to do. I have included all the files required according to their documentation. When I compile, I get C2065 messages on all the functions that should be included in the project from the PCAnywhere modules. I have checked and rechecked and it appears all declarations are correct. Has anyone run into this and how did you fix it? Any help would be appreciated. I am using Visual C++ rel 6.0 and PCAnywhere rel 10.0.
|
|
|
|
|
I have a MDI project that allows the user to open and close different views.
What I would like to do is have the menu change based on which views are
currently open. I have read that MFC keeps a common copy of the menu for
each template. Therefore changing the menu will causes all document menus
to also change.
So, do I have to update the menu each time a different view is active,
including being sensitive to the document, or is there a trick to modifying
the menus. If no trick exists, then where is the best place to do the
changing of each menu. Should this be done in MDIActivate or in MainFrame?
Any suggestions would be helpful.
Thanks in advance.
Eldon Zacek
Czech-Mate Enterprises, LLC
|
|
|
|
|
Check this:
http://www.njnet.edu.cn/info/ebook/c++/vc524h/ch23/ch23.htm
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Thanks for the response. This example is how I have been doing it. This works
OK but everytime you make a change to the menu structure, you have to
duplicate it for every menu resource. What I would like to do, is have the
core menu resource and add the each view's unique menu's resource as needed.
This desire appears to be the problem. You are no longer changing a unique
menu ID but one shared by more than one view/document.
If you have any other insite, please let me know.
Thanks.
Eldon Zacek
Czech-Mate Enterprises, LLC
|
|
|
|
|
Eldon Zacek wrote:
What I would like to do, is have the
core menu resource and add the each view's unique menu's resource as needed.
As I remember this example,it use tow different menu,I think you have to take a look at again.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Yes, the example uses two different menus. They both have an unique resource
for each menu. What I want to do is have a common resource ID for all menus
and add/delete from the menu as different views are opened and closed.
This is also a passage from the "C++ Users Guide" about menus and MDI
applications:
"Multiple MDI child windows of the same document type share menu resources. If several MDI child windows are created by the same document template, they can all use the same menu resource, saving on system resources in Windows."
As you can see this presents an interesting problem. If I change the menu
for one document. Those changes will be reflected in all the opened documents.
This is the other problem I am trying to solve.
Thanks.
Eldon Zacek
Czech-Mate Enterprises, LLC
|
|
|
|
|
I am trying to make a win32 PE program perform
a CRC check on itself when executed, and quit
if the check fails.
I know how to implement a CRC check, but how should
I make the program read the bytes of its own executable?
Is it possible to just open the exe using ReadFile or will this cause an error?
Also, the program is non-MFC, so I require a solution that
does not make use of MFC.
Any help appreciated!
Thanks.
|
|
|
|
|
You can open the file with shared read only access.
I use a separate program to open the exe, compute the crc and then write the value to the end of the file. When the exe runs it can compute a crc of itself, minus the last few bytes of the file where the crc is stored, to make sure the file hasn't been modified.
Todd Smith
CPUA 0x007 ... shaken not stirred
|
|
|
|
|
Thanks for the advice, v. helpful
|
|
|
|
|
I would suggest doing it another a seperate thread if the .exe is large. If you are doing it to check if your program has been hacked then using a separate thread also makes it more difficult to hack. Don't do it the second the app starts, but after a while. I'd also look at using something stronger than a CRC, such as MD5.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
I have a SMTP mailer component with 8 worker threads sending mails. The problem is that I want to fire event when mail issent and I want to fire event when all mails are sent. The problem is that one of my worker threads has to fire event by asking main thread to fire event. But this doesnt work that way it gives error in kernel32. What seems to be the problem and how can i solve it. I can only fire event when I dont have any thread working.
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
Did you marshal the interface to the worker thread?
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Well here is the deal. I pass pointer to worker thread of Control Class so they can communicate. Everything works fine untill I call the COntrols public Function to call Private Event firing function and there I get Access violation and VS shows me assembler code. I am using MFC not ATL. I just want my each thread to be able to fire event telling the container that it just sent an email. SO in your opinion what should I do to make things go right. Thanks in advance
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
What are you using to fire an event? There are several ways to communicate between worker threads and your main thread.
Todd Smith
CPUA 0x007 ... shaken not stirred
|
|
|
|
|
I am simply giving each thread a pointer to my Control class. The point is it works fine every way except when I call Control's Public function to call its private function to fire event. The problem is there. ACCESS VIOLATION. I am using MFC. What do you suggest me to do. THis is the code in ThreadProc
pCtl->MailSent();
// and this is thee function MAilSent in Control class
void CSMTPControl::MailSent()
{
FireMailSent(); // This is where it gives access violation
}
//////////////////////
as it is an OCX so I cant use Timer in it otherwise I'll set a volatile global variable and will set timer in main thread to firevent when volatile vairblae asks. But I want something else to do to solve it. cuz it is an OCX i cant just send messages to it beacause it is invisible at run time.
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
Hi Todd,
Could you give any references to this kind of thing. I'm having touble as well, but from ATL.
Call a COM method, start a worker thread, and return. Worker thread fires a connection point event.
Thanks,
Giles
|
|
|
|
|
While I don't have an answer, let me know how you get on, as i had the same problem when looking at something similar last week.
Mine was with ATL though. I had implemented a connection point in an object, and wanted to be able to start a worker thread from the COM method, so it could return asyncronously. The worker thread would then fire the event before terminating.
Giles
|
|
|
|
|
What is threading model?
soptest
|
|
|
|