Solved

MFC Apps under Win95

Posted on 2000-02-15
3
190 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
maxBlock challenge 30 111
Window placement 17 75
FizzBuzz challenge 9 76
Problem to open Excel file 15 95
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

910 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

16 Experts available now in Live!

Get 1:1 Help Now