[comp.sys.mac.programmer] Communications Toolbox Initialization?

time@oxtrap.oxtrap.UUCP (Tim Endres) (09/08/89)

I have just recently started coding with the Communication Toolbox.
No where in the documentation do they show the full source for
starting an application, and the initializations needed. I can run my
program, but CMNew() fails. If I run Versaterm, then quit Versaterm,
then run my application, CMNew() succeeds until I reboot, then it fails
again. Does anyone have the list of initializations that are required
and their order? I assume I am not initailizing something.

han@Apple.COM (Byron Han) (09/09/89)

In article <TIME.89Sep8111012@oxtrap.oxtrap.UUCP> time@oxtrap.UUCP writes:
>
>I have just recently started coding with the Communication Toolbox.
>No where in the documentation do they show the full source for
>starting an application, and the initializations needed. I can run my
>program, but CMNew() fails. If I run Versaterm, then quit Versaterm,
>then run my application, CMNew() succeeds until I reboot, then it fails
>again. Does anyone have the list of initializations that are required
>and their order? I assume I am not initailizing something.

PROCEDURE Initialize;
VAR
	err:	OSErr;

BEGIN
	{ standard Macintosh Toolbox initialization }

	err := InitCTBUtilities;
	err := InitCRM;

	err := InitCM;
	{ check connection manager initialization result code... }

	err := InitTM;
	{ check terminal manager initialization result code ... }

	err := InitFT;
	{ check file transfer manager initalization result code... }

	{ rest of initalization }
END;

Hope this helps...

-- 
+-----------------------------------------------------------------------------+
| Disclaimer: Apple has no connection with my postings.                       |
+-----------------------------------------------------------------------------+ 
Byron Han, CommToolbox Scapegoat      Macintosh - Catch the Wave!
Apple Computer, Inc.                  -----------------------------------------
20525 Mariani Ave, MS27Y              Internet: han@apple.COM
Cupertino, CA 95014                   UUCP:{sun,voder,nsc,decwrl}!apple!han
------------------------------------  GENIE:BYRONHAN   CompuServe:72167,1664
ATTnet: 408-974-6450                  Applelink:HAN1   HAN1@applelink.apple.COM
-------------------------------------------------------------------------------

miker@Apple.COM (Michael P. Radovancevich) (09/09/89)

Hello,

To use the Macintosh Communications Toolbox in your application

	{check to see if the CommToolbox is installed}

	InitGraf(@thePort);
	{etc.  init all the other stuff}

	error := InitCRM;	{init the Communications Resource Manager}
	{error checking}

	error := InitCTBUtilities;	{init the CommToolbox Utilities}
	{error checking}

	error := InitCM;		{init the Connection Manager or 
					 File Transfer Manager or
					 Terminal Manager, whichever ones you
					 will be using}
	{error checking}

	{followed by the rest of your totally radical CommToolbox using code}

Hope this helps.


Mike



-- 
-------------------------------------------------------------------------------
| Michael P. Radovancevich   | My opinions are not the product of Apple,      |
| CommToolbox Hack           | but my products are the opinion of Apple.      |
| Apple Computer, Inc.       | ---------------------------------------------- |
| 20525 Mariani Ave, MS 27Y  | Internet: miker@apple.com                      |
| Cupertino, CA 95014        | UUCP:{sun,voder,nsc,decwrl}!apple!miker        |
| 408-974-1042               | Applelink:RADOVANCEVI1                         |
-------------------------------------------------------------------------------