Confused with serializing an object to a queue

F

falcon198198

Greetings:

I was hoping for some advice on an application. Here is what I am
working on:
Basically I have a bigger application that is having a printing
problem making multiple copies of a pdf so I set off to write a
program that can watch a folder using filesystemwatcher. From the
events that this generates I created a class and instantiated an
object that will hold information like full path and last write time.
I want to be able to create some logic that determines the file has
stabilized and then queue the object so a separate thread may be a
windows form timer can dequeue them a do the act of making multiple
copies with a unique name and pass them along to a printer drop
folder.

Is this the right way to think about using an object?
One of the first issues I ran into was trying to enqueue the object I
was doing something like this :
Dim fsw = new filesystemwrite
Dim queue as Queue

Some logic on fsw


queue.enqueue(fsw)

This causes an error.


So even if this worked would you then dequeue it back to a generic
object an then be able to see the private variables.


I have read conflicting information about seralizeing an object and I
guess at this point I am confused as I am trying to create a
collection of objects that can be use by a different process other
then the file system watcher.

Thank you in advance for any advice.


Dan , MCSE/MCSA
 
M

Mr. Arnold

Greetings:

I was hoping for some advice on an application. Here is what I am
working on:
Basically I have a bigger application that is having a printing
problem making multiple copies of a pdf so I set off to write a
program that can watch a folder using filesystemwatcher. From the
events that this generates I created a class and instantiated an
object that will hold information like full path and last write time.
I want to be able to create some logic that determines the file has
stabilized and then queue the object so a separate thread may be a
windows form timer can dequeue them a do the act of making multiple
copies with a unique name and pass them along to a printer drop
folder.

Is this the right way to think about using an object?
One of the first issues I ran into was trying to enqueue the object I
was doing something like this :
Dim fsw = new filesystemwrite
Dim queue as Queue

Some logic on fsw


queue.enqueue(fsw)

This causes an error.


So even if this worked would you then dequeue it back to a generic
object an then be able to see the private variables.


I have read conflicting information about seralizeing an object and I
guess at this point I am confused as I am trying to create a
collection of objects that can be use by a different process other
then the file system watcher.

Thank you in advance for any advice.


A collection of objects must be based on an object. You should look up on
Google on how to make a Strong Type Collection that will hold the objects,
which can be a serialized object or not, but in either case, the object must
be based on the recreation of the object and de-serialized back to an object
in another process. The object with it properties of (gets/sets or
lets/gets pointing to private variables with their data) will hold state.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top