Marketplace

Related Articles

More

Related Categories

Recently Added

More

Join StudyUp.com Today

It's always free and anyone can join!

Watch StudyUp Demo Video Now

You Recently Visited

Visual Writing Prompts

Laura Said:

How to compile a program in Microsoft Visual C++?

We Answered:

This video will show you how with the VC++ 2008 Express Edition. Very easy to follow.

http://xoax.net/comp/cpp/console/Lesson1…

Mabel Said:

How do you create a print button using Visual Basic?

We Answered:

You have to use the PrintForm object

DIM prntfrm AS PrintForm

prntfrm.Form = ME
prntfrm.Action = PrintToPrinter
prntfrm.Print()

If your just trying to print out text that was entered on the form, you just use printer without the PrintForm object

Printer.Print Form1.Text1
Printer.EndDoc

Dwayne Said:

How do i make my visual basic program prompt to save on exit?

We Answered:

Private Sub Form_Unload(Cancel As Integer)

dim rc as integer

' Add code to check if changes have
' been made since last save
' Add if/else/endif based on need to save

rc = msgbox ( "Do you want to save your changes?", _
   vbYesNoCancel + vbQuestion, "app Title" )

select case rc

 case vbYes
   ' Add code to save changes
 case vbNo
   ' Do nothing in here
 case vbCancel
   Cancel = true ' This will prevent the app from closing

end select

End Sub

Gina Said:

How do I compile a self written program from my home computer Visual 2008 Command Prompt?

We Answered:

bcc is the Borland compiler.

Microsoft's C/C++ compiler is cl

so:
cl file.c

Should generate file.exe (assuming no compile errors).

But it's really a lot easier to use the Visual part of Visual C. You can edit, compile, run and debug very easily from within the IDE.

Bonnie Said:

Save textfile without prompt in visual basic 2010?

We Answered:

Sure.
Drag a timer onto your form. Set the interval to how often you want to save. (It's in milliseconds, so if you want to save ever 5 minutes it would be 5 * 60 * 1000 = 300000 milliseconds).
Set enabled to true, and add a tick event handler. Call your save function from the tick event handler.

To save on close, add a FormClosing event handler. Call save from this handler.

To add the event handlers, use the properties window in the form designer. Click the lightning bolt icon. Select the object you want to add the event handler for (the form, for form closing, the timer for the timer tick). Find the event in the list, double click it.

Rita Said:

I am writing a game program in Visual C++. How do I obtain the system time in my callback function?

We Answered:

WM_TIMER is ok. However, keep in mind that this message has least priority and others will preempt.

To use the pump (start the messages), look up the "SetTimer()" function.

That will start the WM_TIMER messages and if you use MFC, all you need to do is populate the "OnTimer" event.

To get the computer time, see "GetLocalTimer()" or "GetSystemTime()" functions.

Good luck.

Discuss It!