NetTalk Central

Author Topic: Running NetSimple in a Source module (Not a Window)  (Read 3934 times)

CyberFerret

  • Newbie
  • *
  • Posts: 32
    • View Profile
    • Email
Running NetSimple in a Source module (Not a Window)
« on: December 16, 2008, 02:05:44 AM »
Hello all,

I am looking at creating a small procedure which uses NetSimple to send some packets of data up to a server, then listen for some incoming packets.

I would like to create this procedure as a 'Source' procedure instead of a 'Window' or 'Progress' which contains the structure for a window.

I am guessing that this cannot be done, as NetTalk listens and processes all it's events on the window's ACCEPT loop?

Cheers,
Devan

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Running NetSimple in a Source module (Not a Window)
« Reply #1 on: December 16, 2008, 10:43:55 PM »
Hi Devan,

correct, you need the ACCEPT loop to listen for the incoming packets - and hence you need a Window structure.

But you can hide the window
window{prop:hide} = 1
immediately after the window opens.

In the ErrorTrap, and .Process (when done)
Post(event:closeWindow)

A good example of this approach is the "Send Email in a Process" example. Although the NetTalk object is on a window (the window that actually sends the email) that window is completely invisible to the user.

Cheers
Bruce


CyberFerret

  • Newbie
  • *
  • Posts: 32
    • View Profile
    • Email
Re: Running NetSimple in a Source module (Not a Window)
« Reply #2 on: December 16, 2008, 11:08:12 PM »
Thanks for the clarification Bruce!

I am looking to create this application as a WebServer, and using SelfService to make it into a background service.  My process will be running on a timer, or may in fact get invoked by a web client request.  Will this cause an issue with Vista security etc. if the service keeps 'popping up' an invisible window from time to time?  Will it also cause the currently running application on the user's PC to lose focus?

I haven't 'gone all the way' and tested this under XP or Vista, in case someone else here has already done it and can advise me??

Thanks,
Devan