Click here to Skip to main content
16,007,760 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: How about a constructor that autodestructs? Pin
Colin Angus Mackay24-Jul-06 2:38
Colin Angus Mackay24-Jul-06 2:38 
GeneralRe: How about a constructor that autodestructs? Pin
Giancarlo Trevisan24-Jul-06 3:02
Giancarlo Trevisan24-Jul-06 3:02 
QuestionMS Word - like interface in .NET Pin
ravinamballa22-Jul-06 13:39
ravinamballa22-Jul-06 13:39 
AnswerRe: MS Word - like interface in .NET Pin
Ed.Poore22-Jul-06 21:12
Ed.Poore22-Jul-06 21:12 
GeneralRe: MS Word - like interface in .NET Pin
ravinamballa23-Jul-06 1:23
ravinamballa23-Jul-06 1:23 
Questionwindows service and unmanaged dll Pin
simon_pl22-Jul-06 12:43
simon_pl22-Jul-06 12:43 
AnswerRe: windows service and unmanaged dll Pin
Net_DNA22-Jul-06 22:43
Net_DNA22-Jul-06 22:43 
GeneralRe: windows service and unmanaged dll Pin
simon_pl23-Jul-06 2:37
simon_pl23-Jul-06 2:37 
Timer event is used for polling. It just checkes if there is data pedning, read it if yes, end ends.

Anyway i have tried another simpler aproach. I thought that mayby its not working because of creating multiple threads. So i have created single worker thred which does all work in infinite loop. Although there is the same problem... It looks like this:


private void WorkerFunction()
{
//I tried this but it changes nothing:
// MyDll.LoadLibrary("user32.dll");
//If i am correct the same is done by pinvoke:
// IntPtr dll = MyDll.LoadLibrary("my.dll");

m_nAppId = MyDll.OpenApp(0);
string Id = "123";
m_nLnkId = MyDll.OpenLink(m_nAppId, encoding.GetBytes(Id), 0);

AddTransaction("OnStart " + m_nAppId.ToString() + ":" + m_nLnkId.ToString());

// start an endless loop; loop will abort only when
// "serviceStarted" flag = false
while (serviceStarted)
{
tick++;
AddTransaction(tick);
StringBuilder buffer = new StringBuilder(256);
int res = MyDll.AutoGetPollData(m_nAppId, m_nLnkId, buffer, 256);

if (res != 0)
{
AddTransaction(buffer.ToString());
MyDll.AutoReleasePollData(m_nAppId, m_nLnkId);
}

if (serviceStarted)
{
Thread.Sleep(new TimeSpan(0, 0, pollingBreak));
}
//and now MessageBox. I can put it enywhere within
//loop and it works...
MyDll.MessageBoxA(0, "asd", "Myservice", 0);
}

AddTransaction() sends data to db. "ticks" are always sent properly but not proper data. I appreciate any suggestions, i have no idea whats going on...
QuestionAuto generating .sln .csproj files Pin
danielk_22-Jul-06 2:28
danielk_22-Jul-06 2:28 
AnswerRe: Auto generating .sln .csproj files Pin
Ed.Poore22-Jul-06 9:44
Ed.Poore22-Jul-06 9:44 
Questionproblem in Synchronize the database between PC and Pocket PC [modified] Pin
sgupta1622-Jul-06 1:40
sgupta1622-Jul-06 1:40 
QuestionUsing of combobox in VC++.Net Pin
Nagaraju_Focus21-Jul-06 22:28
Nagaraju_Focus21-Jul-06 22:28 
AnswerRe: Using of combobox in VC++.Net Pin
Ed.Poore22-Jul-06 9:46
Ed.Poore22-Jul-06 9:46 
GeneralRe: Using of combobox in VC++.Net Pin
Nagaraju_Focus23-Jul-06 18:34
Nagaraju_Focus23-Jul-06 18:34 
QuestionQuick Question - Events / Event Handleing Pin
Jawz-X21-Jul-06 10:38
Jawz-X21-Jul-06 10:38 
AnswerRe: Quick Question - Events / Event Handleing Pin
Rob Graham21-Jul-06 11:08
Rob Graham21-Jul-06 11:08 
GeneralRe: Quick Question - Events / Event Handleing Pin
Jawz-X22-Jul-06 10:03
Jawz-X22-Jul-06 10:03 
QuestionDetecting Framework executables and versions Pin
Joshua Lunsford21-Jul-06 6:14
Joshua Lunsford21-Jul-06 6:14 
AnswerRe: Detecting Framework executables and versions Pin
Paul Conrad21-Jul-06 11:29
professionalPaul Conrad21-Jul-06 11:29 
QuestionMultithreading Pin
k_dasaprakash20-Jul-06 2:19
k_dasaprakash20-Jul-06 2:19 
AnswerRe: Multithreading Pin
Keith Malwitz20-Jul-06 4:39
Keith Malwitz20-Jul-06 4:39 
AnswerRe: Multithreading Pin
Rob Graham21-Jul-06 11:00
Rob Graham21-Jul-06 11:00 
QuestionProblem using a Multiview inside of a Formview! Pin
gabru12319-Jul-06 10:31
gabru12319-Jul-06 10:31 
AnswerRe: Problem using a Multiview inside of a Formview! Pin
Mr programboy10-Dec-08 0:14
Mr programboy10-Dec-08 0:14 
QuestionDataGrid: setting an indexed property as mappingname value. Pin
space_doggy19-Jul-06 10:02
space_doggy19-Jul-06 10:02 

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.