Click here to Skip to main content
16,005,141 members
Home / Discussions / C#
   

C#

 
Generalselecting table adapters in datasets Pin
Glen Harvy24-Jan-08 11:15
Glen Harvy24-Jan-08 11:15 
GeneralRe: selecting table adapters in datasets Pin
Gareth H24-Jan-08 11:37
Gareth H24-Jan-08 11:37 
GeneralRe: selecting table adapters in datasets Pin
Glen Harvy24-Jan-08 13:23
Glen Harvy24-Jan-08 13:23 
QuestionPrint multiple copies of a page? Pin
DaleEMoore24-Jan-08 10:49
DaleEMoore24-Jan-08 10:49 
GeneralRe: Print multiple copies of a page? Pin
Gareth H24-Jan-08 10:59
Gareth H24-Jan-08 10:59 
GeneralRe: Print multiple copies of a page? Pin
DaleEMoore24-Jan-08 11:22
DaleEMoore24-Jan-08 11:22 
GeneralRe: Print multiple copies of a page? Pin
DaleEMoore24-Jan-08 11:30
DaleEMoore24-Jan-08 11:30 
QuestionIssue using .dll in Program vs Service Pin
abupsman24-Jan-08 9:43
abupsman24-Jan-08 9:43 
I need some assistance in tracking down why my code will not run as a service.
I have been hacking at this for over two weeks on and off with no real progress.
I need to use an old dll to access data.
When I call it from a console app, it works just fine.
Here is a snip of the code that works...

[DllImport("C:\\Program Files\\Omaha_Steaks_NUCAS_Reader\\libhab2.dll")]
public static extern int HABRSCI(string RSCI1, string RSCI2, string RSCI3, string RSCI4, string RSCI5);

static void Main()
{

try
{
//Create Variables for Host Access string
string resbuff = new string(' ', 80);
string reascode = "0000";

HABRSCI("0000", "01", "nucas.txt\0", resbuff, reascode);

}
catch (Exception ex)
{
string zzzz = ex.Message;
}

}


I rewrote as a Service, everything works except the dll call, it just acts as it was never called at all.

Here are some snips from my Service code....

//Set up usage of the .dll for Host Access
[DllImport("C:\\Program Files\\OS_NUCAS_Reader\\libhab2.dll",EntryPoint = "HABRSCI")]
public static extern int HABRSCI(string RSCI1, string RSCI2, string RSCI3, string RSCI4, string RSCI5);

and later, inside of a timer event..

try
{
//Create Variables for Host Access string
string resbuff = new string(' ', 80);
string reascode = "0000";
HABRSCI("0000", "01", "nucas.txt\0", resbuff, reascode);
}
catch (Exception ex)
{

}

This is just ignored!!!
I know the code executes around it, I have even added lines to write to the Event log just before and after the call.
If it works, a text file is created and a records is added to a log file maintained by the dll. none of these are happening so it apears that it ignores the call to the dll when running as Service.

Any assistance would be much appreciated.
Thanks,
Don
GeneralRe: Issue using .dll in Program vs Service Pin
Luc Pattyn24-Jan-08 10:15
sitebuilderLuc Pattyn24-Jan-08 10:15 
GeneralRe: Issue using .dll in Program vs Service Pin
abupsman24-Jan-08 10:30
abupsman24-Jan-08 10:30 
GeneralRe: Issue using .dll in Program vs Service Pin
Luc Pattyn24-Jan-08 10:51
sitebuilderLuc Pattyn24-Jan-08 10:51 
GeneralRe: Issue using .dll in Program vs Service Pin
abupsman24-Jan-08 11:56
abupsman24-Jan-08 11:56 
GeneralRe: Issue using .dll in Program vs Service Pin
Luc Pattyn24-Jan-08 12:04
sitebuilderLuc Pattyn24-Jan-08 12:04 
GeneralCustom tab control Pin
DanB198324-Jan-08 7:58
DanB198324-Jan-08 7:58 
GeneralRe: Custom tab control Pin
led mike24-Jan-08 9:41
led mike24-Jan-08 9:41 
GeneralRe: Custom tab control Pin
DanB198324-Jan-08 9:50
DanB198324-Jan-08 9:50 
GeneralRe: Custom tab control Pin
led mike24-Jan-08 10:31
led mike24-Jan-08 10:31 
GeneralRe: Custom tab control Pin
DanB198325-Jan-08 0:14
DanB198325-Jan-08 0:14 
GeneralRe: Custom tab control Pin
led mike25-Jan-08 5:56
led mike25-Jan-08 5:56 
GeneralRe: Custom tab control Pin
DanB198326-Jan-08 1:29
DanB198326-Jan-08 1:29 
QuestionWPF Transparent Window - can it still detect events? Pin
Member 429406224-Jan-08 7:44
Member 429406224-Jan-08 7:44 
AnswerRe: WPF Transparent Window - can it still detect events? Pin
i_want_to_learn_c#24-Jan-08 8:11
i_want_to_learn_c#24-Jan-08 8:11 
AnswerRe: WPF Transparent Window - can it still detect events? Pin
Paul Conrad24-Jan-08 8:39
professionalPaul Conrad24-Jan-08 8:39 
GeneralRe: WPF Transparent Window - can it still detect events? Pin
DaveyM6924-Jan-08 11:01
professionalDaveyM6924-Jan-08 11:01 
QuestionShould I do MCSD certification for Framework 2.0 or wait for 3.0? Pin
i_want_to_learn_c#24-Jan-08 7:23
i_want_to_learn_c#24-Jan-08 7:23 

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.