Re: troubles deploying software
I dont think its because the gui thread is stalling..
there are basically two parts to my app.
the backend application essentially acts as a gateway for clients to access
the CAN bus. The backend is multithreaded, the gui has its own thread,
there's a thread that maintains the CAN bus connection , and there's a
thread for each client that connects. when a packet comes in, the CAN
maintaining thread sends the packets to each client thread, the client
threads then filters the packet and sends the packet to the client app via
WM_COPYDATA.
You are right, my remotesend client is a single thread, but the messages
being sent to the client are filtered and, in this case, is not that much.
I even tried running the remote sendclient without the backend on, (which
means there is no connection to the bus) and I still could not type in the
Cedit box. Mind you I can still press buttons, even open the Combobox.
I did overwrite the Cedit box and overridden the ON KEY function so that I
could get command history functionality:
sorry for the formatting, it got messed up on the copy/paste
void CCustEdit::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
switch(nChar)
{
case VK_UP:
if(m_historyVect.size()){
if(++m_cmdCount == m_historyVect.size())
{
m_cmdCount = m_historyVect.size()-1;
}
SetWindowTextW(m_historyVect[m_historyVect.size()-1-m_cmdCount]);
}
return;
case VK_DOWN:
if(m_historyVect.size()){
if(--m_cmdCount < 0)
{
m_cmdCount = 0;
return;
}
SetWindowTextW(m_historyVect[m_historyVect.size()-1-m_cmdCount]);
}
return;
case VK_RETURN:
{
CString string;
if(GetWindowTextLengthW())
if(m_cmdCount == -1){
GetWindowTextW(string);
m_historyVect.push_back(string);
}
else{
string = m_historyVect[m_historyVect.size()-1-m_cmdCount];
m_historyVect.erase(m_historyVect.begin() +
m_historyVect.size()-1-m_cmdCount);
m_historyVect.push_back(string);
}
m_cmdCount = -1;
//contstruct Protocol Packet and send message to frontEnd
::SendMessage(m_dlgHandle
,UWM_SENDCOMMAND
,(WPARAM)0
,0);
}
return;
default:
m_cmdCount = -1;
CEdit::OnKeyDown(nChar, nRepCnt, nFlags);
}
}
I dont see how this would only work on my PC though.
Let me know if any of you guys need more information.
Thanks,
Nick
"Jim" <adirondackmtn@yahoo.com> wrote in message
news:73394928-a35f-4f9f-96e1-dfbf87e99069@u6g2000prc.googlegroups.com...
On Jul 24, 2:00 pm, "Nick Schultz" <nick.schu...@flir.com> wrote:
Hi there,
So after some hard work programming and debugging my code, I'm ready to
test
my software on different PCs, and I'm running into some big headaches.
(when i speak of bus, I mean CAN network bus)
On my PC(winxp sp3, core2duo cpu,very light bus load), it works great. I
press the poll processors button, which then sends a message on a bus,
and
then as it gets responses from processers, it populates the processors
into
a combobox. I can then select a processor and press the connect button.
I
then get a prompt from the processor, I type into a Cedit box(which I
derived to implement previous command history) and I am able to send
commands to the processor and read its output.
on another PC(win2000, moderate bus load), it doesnt work so great, I
press
the pollbtn, the message gets sent, however the combo box does not get
populated , so I don't know if I can send messages or not, however when I
type in the CEdit box, text appears. (an earlier prototype version I was
able to poll, populate the combo, send messages.. however if the command
was
more than two words(separated by space), it would send nothing at
all...mind
you everything still was working great on my PC)
on a thrid PC (winxp sp3,celeron cpu, high bus load), I am able to poll
the
processors, get the combo box populated, connected to a processor, get a
prompt from the processor..... BUT I can't type anything into the CEdit
box,
the cursor is blinking and I press keys, but nothing is showing up.
Anybody know what is going on?!?
This is very confusing.. how do I debug this? Is there anything I can do
in
the future to prevent my program only working on my local machine?
Thanks
Nick
Nick,
I doubt the PCs are so busy Windows can't respond to user input.
However, you can pretty easily verify this by upping the process
priority & see if it gets more responsive.
I DO think you probably aren't running a multi-threaded app and it
gets stalled waiting on the bus. If the gui thread stalls, so does
the gui's input.
Jim