home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / mswindo / programm / misc / 4191 < prev    next >
Encoding:
Text File  |  1992-12-13  |  2.6 KB  |  59 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!torn!nott!emr1!jagrant
  3. From: jagrant@emr1.emr.ca (John Grant)
  4. Subject: Re: Need KLUDGE to make DOS .exe work *my way* from VB app
  5. Message-ID: <1992Dec14.002337.13668@emr1.emr.ca>
  6. Organization: Energy, Mines, and Resources, Ottawa
  7. References: <1992Dec9.193630.25156@worak.kaist.ac.kr> <1992Dec12.043729.18412@u.washington.edu>
  8. Date: Mon, 14 Dec 1992 00:23:37 GMT
  9. Lines: 48
  10.  
  11. In article <1992Dec12.043729.18412@u.washington.edu> tvp@gibdo.engr.washington.edu () writes:
  12. >I'm fairly new to Windows programming. I picked up Windows SDK, VB and
  13. >Borland C++ 3.1 with the purchase of my home PC last spring.
  14. >Basically, all I've been using is BC++, and then only for compiling
  15. >straight C.  Realizing this is a waste, I've taken on some small
  16. >projects to initiate me in different aspects of Windows programming.
  17. >
  18. [stuff deleted...]
  19.  
  20. >For conversion, I thought I'd try Visual Basic. (Turns out I kind of
  21. >like it, but that's another story.) The way I did it was to put in a
  22. >Drive box, Directory box, and File list box (using the standard
  23. >idioms) for selecting the input text file; two check boxes repre-
  24.  
  25. [stuff deleted...]
  26.  
  27. Tad, I can't answer your question, however since the object of the
  28. exercise is to learn Windows programming, I do have one suggestion.
  29. Windows 3.1 comes with COMMDLG.DLL (Common Dialog Functions).  They
  30. are:
  31.     GetOpenFilename() - get pathname of input file
  32.     GetSaveFilename() - get pathname of output file
  33.     ChooseColor()      - choose an RGB colour
  34.     ChooseFont()      - choose a font
  35.     PrintDlg()      - print setup
  36.     FindText()      - find text (i.e. in an editor)
  37.     ReplaceText()      - find & replace text
  38.  
  39. The functions are very easy to use and save you a lot of work coding
  40. your application.  They also give apps which use them a common look
  41. and feel.  MicroSoft allows you to distribute COMMDLG.DLL with your
  42. app so it will run on Windows 3.0.
  43.  
  44. In your case, assuming Visual Basic supports these functions, you
  45. can make a single function call to GetOpenFilename instead of
  46. managing 3 listboxes as you are doing now.  If you want to see some
  47. of these functions in action, just use the Windows 3.1 utilities like
  48. Notepad, Write, PaintBrush, desktop/colour (i.e. windows colour setup).
  49.  
  50. Also, as you have probably found out by now, you don't need the SDK
  51. if you have BC++ 3.1 - it includes (almost) everything you need.
  52.  
  53. Good luck.  It's a lot of work and a steep learning curve, but it's
  54. also very satisfying (as you've undoubtedly discovered).
  55. -- 
  56. John A. Grant                        jagrant@emr1.emr.ca
  57. Airborne Geophysics
  58. Geological Survey of Canada, Ottawa
  59.