Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Jon

Need help with Windows programming...

This topic is 6920 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

My problem is probably very easy to solve but I aint too good with windows programming so here goes: I''m programming in Borland C++ Builder 4 and I''m using alot of my own classes and within one of my window I have an object of my own class, and within that object I have an object of another class. The setup looks like this: BoardWindow->Game->AI. And from the AI-class I would like to access a progressbar located in the windowclass. I guessing windowhandles have something to do with it but I haven''t succeded.

Share this post


Link to post
Share on other sites
Advertisement
Try looking at it from the other direction. I don''t think it should be the AI object''s responsibility to update a progress bar. Rather, it could simply have a member function that supplies a value. Then the game or window code (whichever owns the progress bar) would call the function and use the value to update the bar.

the Gent

Share this post


Link to post
Share on other sites
You''ve got a point there but within the AI-class I have a double loop from where I would like run the progressbar and since the program is supposed to be finished in a few days I just don''t have time change everything.

Share this post


Link to post
Share on other sites
Then you're going to have to either add a member function to the window class that returns a pointer to the progress bar, or a member function that lets you set the value of the progress bar. I recommend the second method. Then from within your AI loop, just call this function with the value.

Are you using MFC (or OWL) for the progress bar, or did you write one yourself?

the Gent

Edited by - An Irritable Gent on May 14, 2000 10:25:51 AM

Share this post


Link to post
Share on other sites
I''m using Borland Builder so the progress bar is included as a component within Builder, so I have no idea. But i''ll try that second solution. Thanks!

Share this post


Link to post
Share on other sites
Hello there,
you could store a pointer to the progress bar in your
ai object and update the progress bas as normal from
inside your object.

TProgressBar *pbrProgress = BoardMain->ProgressBar.

in ai routine

pbrProgress->Position = value;

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!