Problem with blocking of main thread with other thread

I have a problem with blocking of main thread:

My application contains an interpreter and I need to write a debugger 
for it.

The mainframe creates a thread that is interpreting instructions. When I 
need to break execution of instruction thread, I use
WaitForSingleObject(m_WaitEventHandle, INFINITE);
in the interpreter thread.

Everything works fine until the window is opened from the interpreter. 
Then the mainframe freezes.

When I break execution in VC the call stack for interpreter thread shows:

� NTDLL!
� KERNEL32!
� CDebugManager::CheckBreakpoints()
� CInterpreterThread::Run()
� _AfxThreadEntry()
� _threadstartex()
� KERNEL32!

call stack for the mainframe:
� CWinThread::Run()
� CWinApp::Run()
� AfxWinMain()
� WinMain()
� WinMainCRTStartup()
� KERNEL32!


The window opened from interpreter is descendant of CDialog and is 
created by calling CDialog::Create(IDD_DIALOG_BASE)

What can be wrong?
Is it a way to find out why the main thread is blocking?

Thanks for any help.
0
TX
7/10/2005 12:26:16 AM
vc.mfc 33608 articles. 0 followers. Follow

5 Replies
1037 Views

Similar Articles

[PageSpeed] 23

TX wrote:
> I have a problem with blocking of main thread:
> 
> My application contains an interpreter and I need to write a debugger 
> for it.
> 
> The mainframe creates a thread that is interpreting instructions. When I 
> need to break execution of instruction thread, I use
> WaitForSingleObject(m_WaitEventHandle, INFINITE);
> in the interpreter thread.
> 
> Everything works fine until the window is opened from the interpreter. 
> Then the mainframe freezes.
> 
> When I break execution in VC the call stack for interpreter thread shows:
> 
> � NTDLL!
> � KERNEL32!
> � CDebugManager::CheckBreakpoints()
> � CInterpreterThread::Run()
> � _AfxThreadEntry()
> � _threadstartex()
> � KERNEL32!
> 
> call stack for the mainframe:
> � CWinThread::Run()
> � CWinApp::Run()
> � AfxWinMain()
> � WinMain()
> � WinMainCRTStartup()
> � KERNEL32!
> 
> 
> The window opened from interpreter is descendant of CDialog and is 
> created by calling CDialog::Create(IDD_DIALOG_BASE)
> 
> What can be wrong?
> Is it a way to find out why the main thread is blocking?
> 
> Thanks for any help.

The main call stack does not look frozen: CWinThread::Run is the main 
message pump.  Assuming that you have installed the MFC source files, a 
double-click on the top line of the stack will show you where the main 
thread is executing.

Does your main thread attempt to access the dialog or dialog controls 
created in the second thread?  That would cause a deadlock if the second 
thread is in WaitForSingleObject.  The second thread cannot maintain a 
window while it is in WaitForSingleObject.  It is best to put all 
windows in the main thread.

-- 
Scott McPhillips [VC++ MVP]

0
Scott
7/10/2005 4:14:06 AM
I've written many interpreters. Blocking the main  thread is ALWAYS a mistake. 

You have not said what the child thread is doing. The key phrase here is "until the window
is opened". Who "opens"  "the window"? You have not said who opens it, or what window it
is. I can imagine any number of cases where you have created a canoncical deadlock
situation. 

One question is "how fast does your interpreter have to be?" A low-speed interpreter can
use a lot of really simple tricks to handle interpreter sequencing at the byte-code level.
For a high-speed interpreter (need to execute hundreds of thousands of byte codes per
second), even putting a WaitForSingleObject on a debug event is going to seriously impact
performance. 

It doesn't matter what the stack looks like; key to all of this is to remove ANY
WaitFor... from the main GUI thread, period; and preferrably, remove the WaitFor... from
the interpreter thread.

First trick: you PostThreadMessage a user-defined message to a UI thread. The PostMessage
says "execute". When the message is dequeued (I used a UI thread to handle this). When in
Run mode, the interpreter forces a PostThreadMessage to execute the next byte code. In
single-step mode, or when you hit the "break" button on your control panel, you set a
Boolean that stops this message from being posted. So it simply executes one step of the
interpreter and stops. I had an interpreter that allowed single-byte-code debug and
statement-at-a-time debug (in fact, it was the first Windows program I wrote).

Now this does have a limitation on performance. For the code I was interpreting (a simple
language akin to BASIC in its semantics but bearing a strong resemblance to C in its
syntax), the average program was a couple hundred lines, had very few loops (just
enumerating database items), and usually completed execution by the time the user realized
the mouse had clicked.

More than a decade later, I used the same technique in my HP16C emulator. Same
low-performance issues made it feasible.

Now, if I needed performance, I'd probably do something like


while(TRUE)
   { /* thread loop */
     ::WaitForSingleObject(runEvent, INFINITE);
     while(interpreting)
        { /* interpreter loop */
          interpretOneOp();
          if(breakflag)
              break; // leave interpreter loop
        } /* interpreter loop */
     gui->PostMessage(UWM_INTERPRETER_STOPPED);
    } /* thread loop */
gui->Postmessage(UWM_SHUTDOWN);

Note that this runs the interpreter at "full speed" unless the breakflag is set. The
"break" button on your control panel/menu will ResetEvent() and set this flag (in that
order!); the "run/resume" item (think F5 key) will clear this flag and SetEvent().
Single-step will set the brekflag and then do a SetEvent(). Note that if the interpreter
is stopped, it is impossible to kill the thread; see my essay on worker threads and how to
use a ShutdownEvent and WaitForMultipleObjects to terminate the main thread loop. Note
that this algorithm removes the WaitFor[Single/Multiple] object from the main interpreter
loop.

Now, the way the main GUI thread determines the interpreter has stopped interpreting is
because it receives the UWM_INTERPRETER_STOPPED message. 

Note this now shows you a general mechanism. For example, you can have the generic
breakflag, which says "stop the interpreter loop" but you can also have a "reason" which
encodes why it stopped, and you could pass this back in the wParam. For example, "array
index out of bounds" would implicitly set the break flag, and set the reason.

Another mechanism is to put the interpreter loop inside a try/catch construct  (we did
this back in 1967 when we built an interactive interpreted language at CMU called "LCC")

while(TRUE)
     { /* thread loop */
      WaitForSingleObject(runEvent, INFINITE);
      try 
         {
          while(TRUE)
              { /* interpreter loop */
               interpretOneOp();
               if(breakflag)
                   throw new CInterpreterBreakException( );
             } /* interpreter loop */
         } 
     catch(CInterpreterException * e)
        {
          ResetEvent(runEvent);
          gui->PostMessage(UWM_INTERPRETER_EXCEPTION, (WPARAM)e);
       }
    } /* thread loop */

The recipient then can interpret the CInterpreterException and call the Delete method on
the exception when it is done.

Now CInterpreterException is a subclass of CException, and it in turn has subclasses such
as CInterpreterArrayBoundsException, CInterpreterDivideByZeroException,
CInterpreterIsReallyConfusedException, and the one I show abouve,
CInterpreterBreakException. 

The try block is outside the interpreter loop, so it only has to be called once, because
exception handler setup/teardown is realtively slow.  Expect that the interpreter loop is
going to be screamingly fast under this model (limited only by the computations
themselves).

By the way, the way I implemented the interpreter was that I just had the parse tree of my
language, enhanced in some minor ways (alas, the advantages of multiple inheritance would
show up well here, but it has a lot of other problems), and each node, which was a
subclass of the abstract superclass TreeNode, had an Interpret method. So 

class OpAdd : public BinaryNode {
      public:
            void Execute() { int R = stack.pop(); int L = stack.pop(); stack.push(R + L);
};

class BinaryNode : public TreeNode {
     public:
           TreeNode * left;
            TreeNode * right;
           void Execute() PURE;
};

class TreeNode {
   public:
         void Execute() PURE;
};

class LeafNode : public:TreeNode {
    public:
         void Execute() PURE;
};

class intval : public  LeafNode {
    public:
         int value; // literal integer value
         void Execute() { stack.push(value); }
};

class variable : public LeafNode {
    public:
          CString name;
          void Execute() { var * v = Lookup(name); 
                                        if(!v->initialized)
                                          throw new CInterpreterUsedUninitializedVariable;
                                        stack.push(v->value);
                                      }

This should give you a number of ideas.
				joe

         
On Sun, 10 Jul 2005 02:26:16 +0200, TX <tx@tx> wrote:

>I have a problem with blocking of main thread:
>
>My application contains an interpreter and I need to write a debugger 
>for it.
>
>The mainframe creates a thread that is interpreting instructions. When I 
>need to break execution of instruction thread, I use
>WaitForSingleObject(m_WaitEventHandle, INFINITE);
>in the interpreter thread.
>
>Everything works fine until the window is opened from the interpreter. 
>Then the mainframe freezes.
>
>When I break execution in VC the call stack for interpreter thread shows:
>
>� NTDLL!
>� KERNEL32!
>� CDebugManager::CheckBreakpoints()
>� CInterpreterThread::Run()
>� _AfxThreadEntry()
>� _threadstartex()
>� KERNEL32!
>
>call stack for the mainframe:
>� CWinThread::Run()
>� CWinApp::Run()
>� AfxWinMain()
>� WinMain()
>� WinMainCRTStartup()
>� KERNEL32!
>
>
>The window opened from interpreter is descendant of CDialog and is 
>created by calling CDialog::Create(IDD_DIALOG_BASE)
>
>What can be wrong?
>Is it a way to find out why the main thread is blocking?
>
>Thanks for any help.

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
7/10/2005 5:02:31 AM
Scott McPhillips [MVP] wrote:
> TX wrote:
> 
>> I have a problem with blocking of main thread:
>>
>> My application contains an interpreter and I need to write a debugger 
>> for it.
>>
>> The mainframe creates a thread that is interpreting instructions. When 
>> I need to break execution of instruction thread, I use
>> WaitForSingleObject(m_WaitEventHandle, INFINITE);
>> in the interpreter thread.
>>
>> Everything works fine until the window is opened from the interpreter. 
>> Then the mainframe freezes.
>>
>> When I break execution in VC the call stack for interpreter thread shows:
>>
>> � NTDLL!
>> � KERNEL32!
>> � CDebugManager::CheckBreakpoints()
>> � CInterpreterThread::Run()
>> � _AfxThreadEntry()
>> � _threadstartex()
>> � KERNEL32!
>>
>> call stack for the mainframe:
>> � CWinThread::Run()
>> � CWinApp::Run()
>> � AfxWinMain()
>> � WinMain()
>> � WinMainCRTStartup()
>> � KERNEL32!
>>
>>
>> The window opened from interpreter is descendant of CDialog and is 
>> created by calling CDialog::Create(IDD_DIALOG_BASE)
>>
>> What can be wrong?
>> Is it a way to find out why the main thread is blocking?
>>
>> Thanks for any help.
> 
> 
> The main call stack does not look frozen: CWinThread::Run is the main 
> message pump.  Assuming that you have installed the MFC source files, a 
> double-click on the top line of the stack will show you where the main 
> thread is executing.
> 
> Does your main thread attempt to access the dialog or dialog controls 
> created in the second thread?  That would cause a deadlock if the second 
> thread is in WaitForSingleObject.  The second thread cannot maintain a 
> window while it is in WaitForSingleObject.  It is best to put all 
> windows in the main thread.
> 

Now I break execution again and the call stack for main thread shows this:

------------------------
� USER32! 77e1392f()
� USER32! 77e15709()
� CFrameWnd::NotifyFloatingWindows()
� CFrameWnd::OnActivate()
� CWnd::OnWndMsg()
� CWnd::WindowProc()
� AfxCallWndProc()
� AfxWndProc()
� AfxWndProcBase()
� USER32! 77e12e98()
� USER32! 77e139a3()
� USER32! 77e1395f()
� NTDLL! 77fa032f()
� CWinThread::PumpMessage()
� CWinThread::Run()
� CWinApp::Run()
� AfxWinMain()
� WinMain()
� WinMainCRTStartup()
� KERNEL32! 77e97d08()
------------------------

When I double-click on CFrameWnd::NotifyFloatingWindows(), the source of 
WinFrm.cpp shows the line marked with =====>


------------------------
void CFrameWnd::NotifyFloatingWindows(DWORD dwFlags)
{
	ASSERT_VALID(this);
	ASSERT(m_hWnd != NULL);

	// get top level parent frame window first unless this is a child window
	CFrameWnd* pParent = (GetStyle() & WS_CHILD) ? this : GetTopLevelFrame();
	ASSERT(pParent != NULL);
	if (dwFlags & (FS_DEACTIVATE|FS_ACTIVATE))
	{
		// update parent window activation state
		BOOL bActivate = !(dwFlags & FS_DEACTIVATE);
		BOOL bEnabled = pParent->IsWindowEnabled();

		if (bActivate && bEnabled && pParent != this)
		{
			// Excel will try to Activate itself when it receives a
			// WM_NCACTIVATE so we need to keep it from doing that here.
			m_nFlags |= WF_KEEPMINIACTIVE;
			pParent->SendMessage(WM_NCACTIVATE, TRUE);
			m_nFlags &= ~WF_KEEPMINIACTIVE;
		}
		else
		{
			pParent->SendMessage(WM_NCACTIVATE, FALSE);
		}
	}

	// then update the state of all floating windows owned by the parent
	HWND hWnd = ::GetWindow(::GetDesktopWindow(), GW_CHILD);
	while (hWnd != NULL)
	{
		if (AfxIsDescendant(pParent->m_hWnd, hWnd))
			::SendMessage(hWnd, WM_FLOATSTATUS, dwFlags, 0);
=====>		hWnd = ::GetWindow(hWnd, GW_HWNDNEXT);
	}
}
------------------------

In hWnd is the handle of the window that was opened from the interpreter...
0
TX
7/10/2005 9:27:58 AM
TX wrote:
> When I double-click on CFrameWnd::NotifyFloatingWindows(), the source of 
> WinFrm.cpp shows the line marked with =====>
>     // then update the state of all floating windows owned by the parent
>     HWND hWnd = ::GetWindow(::GetDesktopWindow(), GW_CHILD);
>     while (hWnd != NULL)
>     {
>         if (AfxIsDescendant(pParent->m_hWnd, hWnd))
>             ::SendMessage(hWnd, WM_FLOATSTATUS, dwFlags, 0);
> =====>        hWnd = ::GetWindow(hWnd, GW_HWNDNEXT);
>     }
> }
> ------------------------
> 
> In hWnd is the handle of the window that was opened from the interpreter...

Bingo. That seems to be the problem I described earlier.  Accessing a 
window that was created in another thread requires the other thread to 
execute.  But your other thread is blocked in WaitForSingleObject so it 
will not execute.  You have apparently compounded the problem by 
creating a parent-child relationship between windows in multiple 
threads, which MFC is not desgigned to handle.

* Do not create windows in a thread that will be suspended.
* Do not access windows from a thread that did not create them.

The recommended practice is to put all windows in the main GUI thread. 
If another thread needs to update a window it must request the GUI 
thread to do it, typically via PostMessage to a window.  An example of 
this lock-free technique can be found in 
http://www.mvps.org/vcfaq/mfc/index.htm

-- 
Scott McPhillips [VC++ MVP]

0
Scott
7/10/2005 4:11:02 PM
The phrase "was opened by the interpreter" is suggestive of the problem. You must not
create any child window in a thread where the parent was created from another thread. If a
thread needs a window to be created, it should PostMessage a request to the main GUI
thread to create the window, and access that window solely and exclusively by using
PostMessage calls to send messages to that window from the thread. What you appear to have
is classic deadlock, and the only solution is redesign.
					joe

On Sun, 10 Jul 2005 11:27:58 +0200, TX <tx@tx> wrote:

>Scott McPhillips [MVP] wrote:
>> TX wrote:
>> 
>>> I have a problem with blocking of main thread:
>>>
>>> My application contains an interpreter and I need to write a debugger 
>>> for it.
>>>
>>> The mainframe creates a thread that is interpreting instructions. When 
>>> I need to break execution of instruction thread, I use
>>> WaitForSingleObject(m_WaitEventHandle, INFINITE);
>>> in the interpreter thread.
>>>
>>> Everything works fine until the window is opened from the interpreter. 
>>> Then the mainframe freezes.
>>>
>>> When I break execution in VC the call stack for interpreter thread shows:
>>>
>>> � NTDLL!
>>> � KERNEL32!
>>> � CDebugManager::CheckBreakpoints()
>>> � CInterpreterThread::Run()
>>> � _AfxThreadEntry()
>>> � _threadstartex()
>>> � KERNEL32!
>>>
>>> call stack for the mainframe:
>>> � CWinThread::Run()
>>> � CWinApp::Run()
>>> � AfxWinMain()
>>> � WinMain()
>>> � WinMainCRTStartup()
>>> � KERNEL32!
>>>
>>>
>>> The window opened from interpreter is descendant of CDialog and is 
>>> created by calling CDialog::Create(IDD_DIALOG_BASE)
>>>
>>> What can be wrong?
>>> Is it a way to find out why the main thread is blocking?
>>>
>>> Thanks for any help.
>> 
>> 
>> The main call stack does not look frozen: CWinThread::Run is the main 
>> message pump.  Assuming that you have installed the MFC source files, a 
>> double-click on the top line of the stack will show you where the main 
>> thread is executing.
>> 
>> Does your main thread attempt to access the dialog or dialog controls 
>> created in the second thread?  That would cause a deadlock if the second 
>> thread is in WaitForSingleObject.  The second thread cannot maintain a 
>> window while it is in WaitForSingleObject.  It is best to put all 
>> windows in the main thread.
>> 
>
>Now I break execution again and the call stack for main thread shows this:
>
>------------------------
>� USER32! 77e1392f()
>� USER32! 77e15709()
>� CFrameWnd::NotifyFloatingWindows()
>� CFrameWnd::OnActivate()
>� CWnd::OnWndMsg()
>� CWnd::WindowProc()
>� AfxCallWndProc()
>� AfxWndProc()
>� AfxWndProcBase()
>� USER32! 77e12e98()
>� USER32! 77e139a3()
>� USER32! 77e1395f()
>� NTDLL! 77fa032f()
>� CWinThread::PumpMessage()
>� CWinThread::Run()
>� CWinApp::Run()
>� AfxWinMain()
>� WinMain()
>� WinMainCRTStartup()
>� KERNEL32! 77e97d08()
>------------------------
>
>When I double-click on CFrameWnd::NotifyFloatingWindows(), the source of 
>WinFrm.cpp shows the line marked with =====>
>
>
>------------------------
>void CFrameWnd::NotifyFloatingWindows(DWORD dwFlags)
>{
>	ASSERT_VALID(this);
>	ASSERT(m_hWnd != NULL);
>
>	// get top level parent frame window first unless this is a child window
>	CFrameWnd* pParent = (GetStyle() & WS_CHILD) ? this : GetTopLevelFrame();
>	ASSERT(pParent != NULL);
>	if (dwFlags & (FS_DEACTIVATE|FS_ACTIVATE))
>	{
>		// update parent window activation state
>		BOOL bActivate = !(dwFlags & FS_DEACTIVATE);
>		BOOL bEnabled = pParent->IsWindowEnabled();
>
>		if (bActivate && bEnabled && pParent != this)
>		{
>			// Excel will try to Activate itself when it receives a
>			// WM_NCACTIVATE so we need to keep it from doing that here.
>			m_nFlags |= WF_KEEPMINIACTIVE;
>			pParent->SendMessage(WM_NCACTIVATE, TRUE);
>			m_nFlags &= ~WF_KEEPMINIACTIVE;
>		}
>		else
>		{
>			pParent->SendMessage(WM_NCACTIVATE, FALSE);
>		}
>	}
>
>	// then update the state of all floating windows owned by the parent
>	HWND hWnd = ::GetWindow(::GetDesktopWindow(), GW_CHILD);
>	while (hWnd != NULL)
>	{
>		if (AfxIsDescendant(pParent->m_hWnd, hWnd))
>			::SendMessage(hWnd, WM_FLOATSTATUS, dwFlags, 0);
>=====>		hWnd = ::GetWindow(hWnd, GW_HWNDNEXT);
>	}
>}
>------------------------
>
>In hWnd is the handle of the window that was opened from the interpreter...

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
7/10/2005 6:04:56 PM
Reply:

Similar Artilces:

Problem with komma versus period in Excel
Hej I am have problems with the use of period in Excel. I Denmark komma is the decimal seperator. If I convert (from within VB Editor) the content of a cell from "6340,00" to text and replace the komma with period I get "6340" (I wanted "6340.00). If I make the convertion in Excel and record the macro at the same time I get the desired result i my sheet. BUT when I put in my code in VBA and run it from here I still get the wrong result, "6340" and not "6340.00". I know Excel (VBA) transform "." to "," probably acording to...

Placing Individual Building Blocks on Ribbon
I've created a customized tab for our workgroup, and would like to make separate buttons for a few of our custom building blocks. The building blocks are visible in the Quick Parts listing. I've recorded macros that retrieve each building block -- the macros work fine via the Developer>Macro method. I then tried to insert lines in the RibbonX XML that place icons on the Ribbon and allow the user to call each macro. Here's a sample line of code, using the same syntax that I had successfully used for other macros that don't deal with building blocks: &...

Help! Setfocus problem
i ave a dropdown field on the first tab. I use setfocus so that it selects a different field to stop users scrolling down and changing the selection on the load event. Problem When a user changes tab and come back to the origional tab the setfocus doesnt run as the form is already loaded. How do you get around this? This is driving me and users mad at minute...please help before i open another bottle of dark rum! Hi Brian, Check out following URL; how to fire onclick event on tab click. It may help you. http://crmrocks.net/?p=16 -- PLEASE do click on Yes or No button if this post wa...

Report Writer Text Spacing Problems While Modifying a PO form
Due to Report Writer static text field size limitations, I am forced to try to use two adjacent text fields to complete a sentence. I am having an inordinate amout of problems trying to get words to align in sentences with the correct amount of character spacing between words that span the text field boundaries. And, the process of toggling between Report Writer and Dyamics to get the Purchase Order form to reprint is time consuming. What am I missing (besides patience)? -- Jay Jay, 1) Setup a calculated field for your static text. Set the result type to String, and use the Constant...

Exchange Patch (KB912442) causes problem w/ share login accts
Exchange2003 std SP2 w/ Office 2003 & XP clients. We have several users who shares a computer, so instead of logging in w/ different users accts, I set them up w/ a shared logging and access Outlook w/ multiple Mail profiles. However, after installing KB912442, it blocks these users from sending emails. It gives them an message that the shared login doesn't have the right to send emails on behalf of this user. I checked the mailbox rights in AD Users and Computers, the shared login has Read & Full mailbox rights permissions. Any idea how to fix this. Thanks in advance. ...

Safe Pay Check Amount Problem
I am trying to setup Safe Pay. Everything seems to be working fine except for one annoying quirk. Our bank's Positive Pay data format gives us 12 characters for check amounts ($$$$$$$$$$¢¢). The file that Safe Pay generates is working perfectly except for those checks that are greater than $9,999,999.99 (9 characters). If the check amount is greater than that (say $10,000,000.00), the value that the Safe Pay file shows for that check is 002147483647. And, even if none of the individual checks exceed $9,999,999.99, if the total of the checks in the batch exceeds that a...

WM_QUERYENDSESSION and saving data through a worker thread
Hello I have an application that uses a worker thread to save/load data. I'm wondering what is the best reaction to WM_QUERYENDSESSION in my case. I have to possible scenarios: 1. When WM_QUERYENDSESSION comes fire the thread and wait for it to end. Only then return TRUE from WM_QUERYENDSESSION handler. The problem is that I will get nusty dialog that my application "is not responding". 2. When WM_QUERYENDSESSION comes fire the thread and return FALSE from the handler. When thread is done force application to end. But this way I will probably prevent Windows from closing,...

Internet connection problem
Hi. I hope someone is able to cast some light on a problem. We have a home network (all computers running XP) some wired and some wireless. For about a month now we have intermittent connection problems in that any one computer (randomly) will not connect to internet. I think all of the computers have suffered from the problem. Rebooting the affected computer makes no difference but rebooting the router can sort it until the next time. Even my mobile phone occasionally cannot connect. In Firefox the message is just "server not found". Pinging an IP address results in a time...

Problem with charting Net income vs Year
Im having some problems with my Excel chart. It will not plot Net Income vs Year. It keeps trying to treat Year as a different data series. It will work if I use text i.e. a1990, a1991, etc. but it refuses to use 1990, 1991... Any Ideas??? Use an "XY (Scatter)" chart, instead of a "Line" chart. Jerry Hunter wrote: > Im having some problems with my Excel chart. It will not plot Net Income vs Year. It keeps trying to treat Year as a different data series. It will work if I use text i.e. a1990, a1991, etc. but it refuses to use 1990, 1991... Any Ideas??? Delete the co...

Problems opening/saving attachments
I am unable to open or save any .rtf file attachments - this started happening today, previously there were no problems with .rtf files. When I try to open such an attachment I get this message: Can't create file: xyz.rtf Right click the folder you want to create the file in, and then click Properties on the shortcut menu to check your permissions for the folder. What folder is this? I am trying to open the attachment not creat the file! Also, when I try to send an rtf file as an attachment, in the email message the file does not show in the attachments section but the receipient actu...

Excel hyperlink problem
Hello everyone, I have a strange excel problem and it's driving me nuts - I would be seriously grateful if someone could help me out! A colleague has this excel document with a huge number of hyperlinks in it, well over 1000 (don't ask me why she wants to use excel - she just does). The hyperlinks are in this format and are using DFS: \\cc\root\pte\tru\ch\scandata\Archaeology\1980\xxx.pdf Whenever she clicks on a link, a pdf from another area of the network is opened. Quite simple and no problems so far. However, as of yesterday, whenver she makes any kind of change to the excel fi...

securety problem
Hi, I start an app in vb with this code: ActiveWorkbook.FollowHyperlink "C:\te.exe" I always get a warning about hyperlinks that can be harmfull to computer. How can I bypas this warning. I �ve put my macro securety on low and trust all installed add-ins and templates + trust acces to visiual basic project. Is there a way so the warning won�t show Thanks Johan -- climax ------------------------------------------------------------------------ climax's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=30816 View this thread: http://www.excelforum.com/...

create main configuration file for solution.
Hello. How can I create main configuration file for my solution (Win-Form : VS 2008. VB.NET), like a general ini-file. Thanks :) "Mr. X." wrote: > Hello. > How can I create main configuration file for my solution (Win-Form : VS > 2008. VB.NET), like a general ini-file. > It's called an app.config. There is a name space you can use to mainulupate the app.config from a program. I see it on the project source directory (not for solution). I cannot see it on the release directory. Is there any convention to read / write from app.config...

wire transfer download problems
I made an international wire transfer of $5000 from my US bank. The receiving bank in Panama took $15 as a service fee and credited my account with $4885. Somehow my US bank now wants to show the amount as $4885 during downloads to my checking account. But some genie reminds Money 2004 that the original amount was $5000 which triggers a discrepancy. As a result, this transaction wants to download each and every time, whether I change, accept, or whatever. Thanks for help. In microsoft.public.money, lanecito wrote: >I made an international wire transfer of $5000 from my US bank. Th...

Interesting TIF file problem
At the company I work for, we have someone that exports AutoCAD drawings to a TIF file, then inserts the TIF file into an Excel spreadsheet. We have quite a few of these. Other users can open this spreadsheet, view it, do a print preview, but when they try to print the file the inserted picture does not show up. All that prints is a box with the broken url red x document image. It seems that the problem is with Office XP. The Excel files are created with Office 2000, and they print fine from Excel 2000. On Office XP and Office 2003, the file won't print properly (all systems are ru...

Annoying problem with lookup field
On a client, I have a MOSS 2007 portal with two lists which are not wroking as expected. One contains people and the other one contains a lookup field based on data from the first list. When someone which hasn't got administrative rights logs in and tries to see the properties of any element in the second list (on DispForm.aspx), they can't see the lookup field value, and if they try to edit the element, the dropdown control used to choose a person from the first list appears empty. Administrator don't have this problem. The users having the problem have collaboration rig...

Problem with vba code to export query result in excel
Hi, I have a access report that exports to excel with click of a button after choosing parameters. This works well. However I have to modify couple of fields to utilize formula in the export module. I am not sure how to do this. I am writing the above code which seems to cause problem. I appreciate any help to resolve this issue. Thanks. Code: If lngColumn = 12 Then xlc.Offset(0, lngColumn).Value = =([UnitPrice]*[OriginalShippedQty])/1000 End If It seems the fields UnitPrice and OrigianalShippedQty are not being recognized here Jack wrote: >Hi, >I have a acces...

Calculate Subreport totals in a main report Group footer
Hi all Apologies if this has been answered before but I can’t find it. I have a main Report with a Group called “Product_Category” which lists a number of “Products” in the Detail I have a Subreport named “product_costs” which has a record for each date and Text Boxes named “materials” and “fuel” (there are more but I’ll keep it simple). The Subreport sums all costs and has Text Boxes named “summaterials” and “sumfuel” in the footer (all with a height of 0.1cm) The Subreport is embedded in the Detail of the Categories and linked by Product_id In the Detail of the Main Rep...

re install Pub 2000 problem.
Hello and I hope I'm In the right newsgroup. My problem is I've had to re install my Office 2000 Disc2 and now when I want to start publisher the message box tells me I am trying to access a program that needs the cd. When I installed it, I checked for Publiher to "run all from my computer" I've un installed and re installed, still need disc. what am I doing wrong? Thanks for your help, John :) Johnny1r wrote: > Hello and I hope I'm In the right newsgroup. My problem is I've had to > re install my Office 2000 Disc2 and now when I want to start publis...

Uploading problems
Hi all, I hope someone can help me with a few difficulties i'm having uploading my website. 1. When I upload, only the first page is uploading - so pages 2-7 don't appear 2. Images do not download with the webpages so when you type in the url, you simply see a blank space where a photo should be with a small icon at the top left courner which sometimes offers the option of 'show picture'. 3. The webpage is positioned to the left of the window when it appears and doesn't centre itself to the page so there is a huge chunk of white space to the right of the window. Can ...

"Archive all messages sent or received by mailboxes on this store" option problem
I want to backup the all message sent or received by mailboxes, I find that there is an option "Archive all messages sent or received by mailboxes on this store " in Exchanger 2003. I had selected this option and forward to public folder. But I found that not all message will be archived. - All message sent by mailboxes can be archived - Some Messages come from mailboxes will not be archived Eg: yahoo, hotmail, and other company Is this option not archive this message ? Any other setting need to configure ? Dennis ...

CHtmlView shutdown problem
Hi! We created an MFC regular DLL whch is loaded by an old MFC-app (built with VC++ 6.0) but we dont have access to the source of this app, just an DLL-interface. our regular DLL loads several MFC extension DLLs. one of the extension DLLs uses a CHtmlView based object which is used within a docking pane, we dont use document/view-architecture. when I shutdown the app, it takes more than 1 minute till the CHtmlView object gets detstroyed. this effect doesnt occur when we load our DLLs from within an new MFC app, built with VC++.NET, everything shuts down fine. due to the fact that there is n...

Inventory Adjustments with problems
Hi In this moment I have some journal entry in financial module with transactions that i never saw before. The bachumb is something like 'GLTRX024134', they are not sequencial. In the descriptn, this has a link to a transaction from inventory adjustment, but with a change... if for example the transaction from inventory is AJ00000007, in this reference is IVAAJ00000007, this is happening with the transfers too. Any idea is welcome!!! Thanks in advance ...

Attachment File Problem
hi my problem is , when i attachment any file to the new mail i can't attachment the file whyyyyyyyyyy i mean when we attachment any file to the mail must be automatic open new filed where it show us the attachnebt file ?????? but it's not happend in my system second problem when i recive any mail whit attachment file it gave me the message "OE REMOVED ACCESS TO THE FOLLOWING UNSAFE ATTACHMENTSIN YOUR MAIL" HELP Pls. thank's You'll need to be a lot more specific if you expect anyone to know what you're talking about - exact error message is? Post it in t...

CRM Security Problems
Hi Group, I have developed a windows service that hits the CRM database everynight to create some e-mails that need to be sent out to customers in the morning. Eventually these will be automatically sent, but for now, we want to manually send them in order to audit what is going out. Here is the problem. THe service is running under the same account as the installation was run under, integration account with full sysadmin. The e-mails are created by this account, however, the activity party xml is sent in to assign the e-mail to a particular user and even set that user as the owner of the e-...