Solved

MFC Apps under Win95

Posted on 2000-02-15
3
191 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
ID: 2523065
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
ID: 2523218
Great, thanks,

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

Lee
0
 
LVL 8

Expert Comment

by:VinExpert
ID: 2525688
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to create frequencies of a variable from SAS dataset? 10 125
ShiftLeft challenge 21 82
zeroMAx challenge 20 105
noX challenge 17 119
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

831 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