Solved

MFC Apps under Win95

Posted on 2000-02-15
3
188 Views
Last Modified: 2013-11-20
HI,
 
I got a problems I was hoping I could get help on.  I've created a program over the past few weeks on NT, which works ok.  I've come to test the software on a win95 machine and I've developed 2 problems.
 
The first and not so important problem is that under Nt all my
text/edit boxes are centred, and appear so when run, under Win95 they all reveert to left justification...only a small problem but it is bugging me.
 
My major problem is that thread is not working.  The program is an MFC exe, which uses a main working thread.  Under NT everything ok, the thread goes away every so often and then updates my main screen.  Under 95 nothing happens.  To narrow the problem I commented out all the code within the thread and just left in a MessageBox call in a loop.  Under NT the message is correctly displayed every 2 seconds...under 95 nothing.
 
I use the following line to kick off the thread :-
 
          _beginthread( NULL, 0, ldmiThread, &ldmi, 0, dummy ) ldmiThread - The function
ldmi      - a pointer to a shared structure between thread and main class
 
I was going to use a TIMER function but the thread can take a bit of processing and if I use a TIMER the front end is slowed down and becomes un-responsive.
 
Any help greatly appreciated.
 
Lee Ogley
0
Comment
Question by:LeeOgley
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
VinExpert earned 100 total points
Comment Utility
Hi,

Try using AfxBeginThread()
LPVOID s;
s = ur pointer to pass
//to spawn
MyThread(ldmiThread, s);

thread proc is defined as global as
UINT ldmiThread(LPVOID s);

then in the thread retrieve the pointer back using s and typecasting it to the required pointer.

To kill it use AfxEndThread();

Try it out.
VinExpert
0
 

Author Comment

by:LeeOgley
Comment Utility
Great, thanks,

Any idea why Win95 left justifies all my centre justified edit/text boxes though.

Lee
0
 
LVL 8

Expert Comment

by:VinExpert
Comment Utility
Hi,

I have given the comment for, Just make sure of center justification by doing it in code also. So that, that variable will be reduced.

Try it out and let me know the results.
VinExpert
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
repeateFront java challenge 31 86
Expand data scrubbing tool 13 29
Tab names are off by one 5 49
firstChar challenge 13 83
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now