|
Help to run my project in Sevice mode
Getting error 1053 , when trying to start from service mode
dil
|
|
|
|
|
Error 1053 means ERROR_SERVICE_REQUEST_TIMEOUT
It seems as if your code isn't responding to some kind of event.
If you want a more detailed answer, please give more details about the problem.
|
|
|
|
|
LPCTSTR name123 = "sangaraju" ;
SC_HANDLE hSCManager =( OpenSCManager(NULL,NULL,SC_MANAGER_CREATE_SERVICE));
SC_HANDLE hi = OpenService(hSCManager,name123,SERVICE_ALL_ACCESS );
SC_HANDLE hSCreate = CreateService(SCManager,name123,name123 ,SERVICE_ALL_ACCESS,
SERVICE_WIN32_OWN_PROCESS,SERVICE_AUTO_START,SERVICE_ERROR_IGNORE,
"\"d:\\Shu.exe\"",NULL,NULL,NULL,NULL,NULL);
and then Closed the services......
Opened the Windows services
i found Startup type = automatic , and status is empty
But when iam trying to start in the servics , Error which iam getting is
Error 1053 : " The service did not respond to the start or control request in timly fashion"
Please help me Kakan.......
Thanks in advance
|
|
|
|
|
Hello.
Your servce code has to respond on different messages, such as start, stop, pause e.t.c.
As well as responding to queries from the OS...
I think you will have to do your homework on this one (study), or (quicker, i think). Follow the advice from ThatsAlok and check out XYNTService.
Use it as it is or study the code. It's very informational (Is that an English word? )
Kakan
|
|
|
|
|
kakan wrote: It's very informational (Is that an English word? )
look like to be
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
It felt good when I wrote it. But then I began to wonder.
Anyway, as long as the reader gets the message, anything goes (as far as I'm concerned)
|
|
|
|
|
Help to run my project in Se
dil
|
|
|
|
|
usha_dolly wrote: Help to run my project in Se
I believe you want to run your program as service. This link will help :-
http://www.codeproject.com/system/xyntservice.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
-- modified at 6:45 Tuesday 6th December, 2005
|
|
|
|
|
|
I create another dialog box from my main dialog box. I want to show it and remove it when i want, without the user's will. I call the show function and the remove function from different places, and 90% I am able to remove it. For the other 10% I tried calling DestroyWindow() to remove, or calling it in the class destructor. I also tried overriding PostNcDestroy() and calling CDialog::PostNcDestroy() inside, etc. OnDestroy(), PostNcDestroy() and OnNcDestroy() are called respectively, but I keep seeing the dialog box, it is not removed. Can someone please help me? How can I destroy it properly?
Thanks in advance
To show:
pOtherBox = new COtherBox();<br />
BOOL ret = pOtherBox->Create(IDD_OTHERBOX, this);<br />
<br />
pOtherBox->SetWindowPos(&this->wndTopMost,<br />
left,top,width,height,<br />
SWP_NOREPOSITION|SWP_NOSENDCHANGING|SWP_NOACTIVATE|SWP_SHOWWINDOW);
To remove:
if(pOtherBox!=NULL)<br />
{<br />
delete pOtherBox;<br />
pOtherBox = NULL;<br />
}
|
|
|
|
|
To dismiss the modeless dialog box, simply call:
pOtherBox->DestroyWindow();
And also implement:
void COtherBox::PostNcDestroy()
{
delete this;
}
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
|
gpswamy wrote: how to get window handle pls
In MFC :-
AfxGetApp()->GetSafeHwnd();
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
In MFC, If you need the window handle of the current window, then it is m_hWnd
Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
Hi,
I am trying to read data from a textfile, but I can't seem to open the file. Here's the code I use:
<code>void fileOperator::openInputFile(const wchar_t *fname)
{
inFile.open(fname, std::ios_base::in);
if(!inFile.is_open() )
{
printf("File could not be opened\n");
exit(1);
}
}</code>
I get no error messages from the compiler, but when I run the program, I get the "File could not be opened" error. I have checked that the program and the textfile are in the same directory. This should be the simplest thing and I'm practically tearing my own hair out trying to figure it out. Please help!
Roger
|
|
|
|
|
is the function called with a valid file path as a parameter ??
what happens if changing fname from const wchar_t* to const char* ?
where is defined inFile ? is it well initialized ?
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20]
|
|
|
|
|
Hi,
Sorry, here is the definition for the class I'm using:
#include <stdio.h>
#include <fstream>
#include <vector>
#include <ios>
class fileOperator {
protected:
<
std::ifstream inFile;
std::ofstream outFile;
public:
fileOperator() {};
void openInputFile(const wchar_t *fname);
void openOutputFile(const wchar_t *fname) {};
void readMatrix(int numberOfColumns, double **matrix);
};
Using const char* was my first thought too, but my compiler doesn't seem to like it. It claims ifstream::open only accepts wchar_t* as its argument. Here's the compiler error I get:
.\fileTest.cpp(8) : error C2664: 'fileOperator::openInputFile' : cannot convert parameter 1 from 'char *' to 'const wchar_t *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
There might be some blindingly obvious thing I'm missing here as I'm fairly new to C++
Roger
|
|
|
|
|
you have to either wass it a char* string and to change the function prototype !!!
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20]
|
|
|
|
|
Sorry about that, with the function prototype changed to char*, the code compiles of course, but I still can't open the file...
Roger
|
|
|
|
|
"wchar_t *fname"?
You might considder "char * fname"?
Or a UNICODE build?
|
|
|
|
|
Does the path to the file look like this ?
const char *path = "C:\Test\TestFile.txt";
If that's true, then you need to escape the \ character by addding another \. Like
const char *path = "C:\\Test\\TestFile.txt";
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi,
Sorry, I'm not using the full path. The file I'm trying to read is in the same directory as the program itself. I tried using full path with the double \\, but to no use. The file still won't open.
Roger
|
|
|
|
|
I need to get my floating points calculation to run faster, the floating point numbers stored in instances of some class in vector<class> array I just need to multiply them and add result:
class{
float val1;
float val2;
};
for(i=0; i<size; i++)
="" res="" +="class[i]-">val1 * class[i]->val2;
will it be faster to store floating numbers from vector massive to plain floating array
float *ar1, *ar2;
for(i=0; i<size; i++)
="" ar1[i]="class[i]-">val1;
ar2[i] = class[i]->val2;
and then perform mmx calculations or memory moving ops will take also some time so there will be no significant speed increase? Or will it be faster to use compound intrinsics to load floating numbers to float[4] and then perform multiplication?
If some one encountered similar problem?
9ine
|
|
|
|
|
9ine wrote: perform mmx calculations
MMX instructions are all integer-based, so they can't help you at all with floating point calcs.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
I know about mmx, by this word I mean all multemedia extensions, it is SSE with floating points which I wonder about for my application if you need me to be more exact.
I can do it my self easely but dont want to waste time if some one done it before an got speed improvement, which I mean:
timemmx = [mem move from classes in vector<> array] + [SSE ops]
timefloat = [standart floating multiplications]
timemmx << timefloat! ??
Otherwise I will need to make much bigger changes in my code to get floating values from my vector<class> to align them in memory, which I'm reluctant.
9ine
|
|
|
|