Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MFC Apps under Win95

Posted on 2000-02-15
3
Medium Priority
?
196 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:
Vinayak Kumbar earned 300 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:Vinayak Kumbar
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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. …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

783 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