Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

threads in Visual C++

Status
Not open for further replies.

CetGabbe

Programmer
Apr 12, 2002
18
0
0
SE
Good day.
I'm a new examinated software engineer and am working with a thread problem..
I've never worked with threads in Visual C++ before and would like help to get started.
I know its a worker thread i'm going to use but not much more..
If there is some one out there who knows a good tip-site or I would be very greateful.

 
msdn for VC++
give u a link not easy what type of app do u wish to code ? someone knowledge ends were
someone else knowledge starts
 
I've made I worker thread, I want it to search a LAN after folders.
I don't know the folders name, but when a folder appears It's ment that I'm going to copy the folder and all the underlaying folder and files to my local drive.
So that's the problem...
 
As a somewhat related question, but more basic to your topic, how does VC++ communicate with other processes? I have a DLL written in VC++ that gets called from a VB GUI, but the DLL does some serious processor work and I'd like to send messages back to the GUI to update a progress or something of the like.

I'm pretty sure I can make the VB listen for a message, but I don't know how to make the DLL send one. It'd only be sending an integer, so no data-type complexities to worry about.

...and please don't tell me to do use MFC's for the progress bar. I really don't like the things. They confuse me. I'm open to the suggesion if it's simple. ----------------------------------------------------------------------------------...but I'm just a C man trying to see the light
 
Use com connection points in c++ and withevents keword in vb..

update progressbar on event arriving...


Greets,

John.
 
Thanks for all tips, I decided to use a timer instead..
So thanks so much..
Enjoy.
 
Alright, I'm kind of lost on the whole COM connection points. I can create a progress bar in VB to accept a custom event, but this event is not exported like in a .dll, it's just an executable. How would the C++ .dll know where to send the message?

Or am I looking at it backwards, and the VB calls the .dll on a timer to get update information? ----------------------------------------------------------------------------------
...but I'm just a C man trying to see the light
 
on initDialog you call the timer function every (for example) 30 sec. From the timer function I just call the methods I want to run.
 
How about implementing a callback in your c++ dll,

call it when ever appropriete,

in vb, implement the callback....

Greets,

John.
 
1- never use CreateThread api but use _beginthreadex
creatrethread has some bugs.. !!
2- please set the project settings as multithread

just some warnings..

Read between the lines
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top