Click here to Skip to main content
15,885,366 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to make a program that is able to save data ? Pin
Me0w!8-May-07 10:21
Me0w!8-May-07 10:21 
QuestionDeleting multiple rows Pin
TAK788-May-07 8:00
TAK788-May-07 8:00 
AnswerRe: Deleting multiple rows Pin
Dave Kreskowiak8-May-07 8:13
mveDave Kreskowiak8-May-07 8:13 
GeneralRe: Deleting multiple rows Pin
TAK788-May-07 8:39
TAK788-May-07 8:39 
GeneralRe: Deleting multiple rows Pin
TAK788-May-07 8:53
TAK788-May-07 8:53 
Questionsearch hard drive for files Pin
jds12078-May-07 7:36
jds12078-May-07 7:36 
AnswerRe: search hard drive for files Pin
MatrixCoder8-May-07 7:59
MatrixCoder8-May-07 7:59 
AnswerRe: search hard drive for files Pin
Dave Kreskowiak8-May-07 8:10
mveDave Kreskowiak8-May-07 8:10 
First, scrap this service. If you can't write the code to search for files in a normal app, writing it as serice will only serve to frustrate you to death. Besides, the way you've written this code demonstrates a lack of understanding how Services work, how to write them, and most importantly, how to communicate with them to get them to do something useful.

The Timer isn't doing anything other than creating an event log on every tick of the timer.

You have no method of calling your function. Sure, it CAN work as a search, but you have no methods in here that allow for communication with the service in any way, so you have no way to call the search code.

Services require you to do a lot more planning up front. There's no such thing a "whipping one togther" like you can with a Console or Windows Forms app.

There's nothing in this code to salvage to get a working service. This thing really does need to be scrapped.

Simplify your code and get a working search in a Console or Windows Forms app first. The experience you get with that will show you what a search needs for input and what it can return as output and how it needs to be returned. After that, you can add threading support, which will give you the basis for writing a service that's going to work. You can't do this with a Timer...


A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


GeneralRe: search hard drive for files Pin
jds12078-May-07 10:21
jds12078-May-07 10:21 
GeneralRe: search hard drive for files Pin
Dave Kreskowiak8-May-07 10:32
mveDave Kreskowiak8-May-07 10:32 
GeneralRe: search hard drive for files Pin
Dave Kreskowiak8-May-07 17:24
mveDave Kreskowiak8-May-07 17:24 
GeneralRe: search hard drive for files Pin
P P Vilsad8-May-07 21:21
P P Vilsad8-May-07 21:21 
AnswerRe: search hard drive for files Pin
P P Vilsad8-May-07 21:18
P P Vilsad8-May-07 21:18 
QuestionStart up Pin
scorp_scorp8-May-07 7:23
scorp_scorp8-May-07 7:23 
AnswerRe: Start up Pin
MatrixCoder8-May-07 7:55
MatrixCoder8-May-07 7:55 
AnswerRe: Start up Pin
nlarson118-May-07 7:58
nlarson118-May-07 7:58 
QuestionDataGridView - Display Row Numbers on Control Pin
RichardBerry8-May-07 4:26
RichardBerry8-May-07 4:26 
AnswerRe: DataGridView - Display Row Numbers on Control Pin
Rupesh Kumar Swami8-May-07 5:27
Rupesh Kumar Swami8-May-07 5:27 
GeneralRe: DataGridView - Display Row Numbers on Control Pin
RichardBerry8-May-07 7:43
RichardBerry8-May-07 7:43 
QuestionOffice 2007 ActiveX Pin
Stijn Courtheyn8-May-07 4:26
Stijn Courtheyn8-May-07 4:26 
QuestionNeed help with Word template Pin
Jats_4ru8-May-07 2:33
Jats_4ru8-May-07 2:33 
QuestionExtracting data from Web pages Pin
Farazj8-May-07 1:29
Farazj8-May-07 1:29 
Questionhow to access dynamically created control Pin
WorkingAcc8-May-07 1:07
WorkingAcc8-May-07 1:07 
GeneralRe: how to access dynamically created control [modified] Pin
Colin Angus Mackay8-May-07 2:26
Colin Angus Mackay8-May-07 2:26 
QuestionApplication Shortcut Pin
harsh_c7-May-07 21:56
professionalharsh_c7-May-07 21:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.