PDA

Click to See Complete Forum and Search --> : DLL question....


laudy
Jan 13th, 2000, 02:47 AM
I am trying to write a COM Object that has functions to create a "Word.Application" object, write and format some data in the document and then save the document.

This dll will be registered and run on my Personal Web Server from which I will access the COM object via script.

My question is, in the dll, how do I declare or create the object .... Set appWD = CreateObject ("Word.Application")
.... so that It is available to ALL other functions?

(I need to be able to close the instance of Word from script by calling a method on the COM object that in turn kills the Word.Application object)

Thanks, Sorry this is so wordy.

KENNNY
Jan 13th, 2000, 05:28 AM
well, this method should work:

in declarations:

Public appWd as new Word.Application

im not sure this will work,but try it :)

------------------
cintel rules :p
www.cintelsoftware.co.uk

Clunietp
Jan 13th, 2000, 10:07 AM
Kenny is correct. If you only have a single class, put it in the general/declarations. In the Class_Initialize, instantiate the object. In the class_terminate, destroy the object. These methods do not apply if your component will run in MTS: You'll have to do it all within one function

FYI: This will not be a scalable solution because of the large overhead required to instantiate the word object....