|
Hi everybody!
I want Create and develop a windows service in Visual Studio.Net( Visual C++ )
and I want use the MFC instructions in this.
if is it possible please help me!
Tell me what shulde I do?
Please answer to me immediately!
|
|
|
|
|
BiNam wrote:
Please answer to me immediately!
I hope you don't mind my delay, Sir. My humble apologies for not answering faster, as you demanded and surely deserve.
BiNam wrote:
I want Create and develop a windows service in Visual Studio.Net( Visual C++ )
and I want use the MFC instructions in this.
First, you should check What MFC Cannot Do for You[^], and in particular the part where it specifically says:
Microsoft does not support using MFC to build Windows services
--
"slow" jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Hello Jose Lamas Rios!
Thanks a lot for your useful help!
How one program requests from a service?
Please explain to me completely.
Thank you!
|
|
|
|
|
Generally you are supposed to figure stuff out for yourself and ask here for help on specific issues. Not "How do I write a xxx type of program?".
Go away and do some studying. Work out the basics and then come back and ask details. There are plenty of excellent examples of writing services here on CP.
HTH.
|
|
|
|
|
Jose Lamas Rios wrote:
My humble apologies for not answering faster, as you demanded and surely deserve.
Jose Lamas Rios wrote:
Microsoft does not support using MFC to build Windows services
Yeap, But Mr. Naughter this article support MFC in Window Service too:-
http://www.codeproject.com/system/cntservice.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
|
|
|
|
|
|
Thanks Ravi for your help
But if you can,give me a sample code for create a Windows Service in MFC
|
|
|
|
|
Is the sample in the article not sufficient?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hello,
I have this code!
HWND hwndTextBox = NULL;
hwndTextBox = GetDlgItem(hwndDlg,IDC_EDIT1);
if(CDesktop::None != (CDesktop::ShowStatus)iIndex)
{
if(GetWindowText(hwndTextBox,text,MAX))
bSuccess=g_objDesktop.SetDesktopWallpaper (text,CDesktop::ShowStatus)iIndex);
}
But now I want to use it in a dialog (MFC) and I dont now how to get the text as a char enter in the EDIT1
as it supose to do. Is there anyone that can help me?
|
|
|
|
|
Hi Larsson :
I could not understand your meaning .But if you want to get the char when you click a certain key of keyboard ,you can use the message map to hook the key down message.
The example is in the following :
// you should ooverride the "PreTranslateMessage"
BOOL CMyClientDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
switch(pMsg->message)
{
case WM_KEYDOWN :
switch(pMsg->wParam)
{
case 'A': //add code here to get the char A break;
case 'B': //add code here to get the char B break;
case 'B': //add code here to get the char C break;
}
break;
case WM_KEYUP:
switch(pMsg->wParam)
{
case 'A': //add code here to get the char A break;
case 'B': //add code here to get the char B break;
case 'B': //add code here to get the char C break;
} }
break;
}
return CDialog::PreTranslateMessage(pMsg);
}
AntonlioX
|
|
|
|
|
how do you display the set password dialog for a given user via the command line or C++?
(control userpasswords, control userpasswords2 - doesn't go to a specific user)
|
|
|
|
|
I need to automatically add my snapin to compmgmt.msc using C++.
|
|
|
|
|
Using DirectShow I can display the property page, but I don't know how to actually change the values shown in program code.
|
|
|
|
|
For the standard video properties such as brightness,
contrast, saturation, etc you need to obtain a pointer
to the IAMVideoProcAmp interface ( Here[^] )
on your video capture filter and use the Set() / Get()
methods exposed on it.
e.g. (without error checking or clean-up)
Given a valid pointer to your IBaseFilter video capture
filter, m_pVideoCapture;
HRESULT hr;
IAMVideoProcAmp *m_pIVideoProcAmp;
hr = m_pVideoCapture->QueryInterface(IID_IAMVideoProcAmp, (void **)&m_pIVideoProcAmp);
m_pIVideoProcAmp->Set(VideoProcAmp_Brightness, m_nBrightnessValue, 0l);
"VideoProcAmp_Brightness" is one of the properties in the
VideoProcAmpProperty Enumeration :
( here[^] )
You will also need to use the GetRange() method
on the IAMVideoProcAmp interface to find the valid
range of values for each property.
Steve T
|
|
|
|
|
how do you tell if fast user switching is enabled in C++ code?
|
|
|
|
|
What do you want to do?
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
During program installation I need to choose the install type depending on if the user is using the classic Gina interface or the fast user switching welcome screen for login.
|
|
|
|
|
This is a dynamic setting though. For example I could install your program, then join a domain on my Windows XP Pro machine. So you may want to detect at runtime if it is enabled when your gina is loaded.
LogonUI[^]
One way to tell would just be to find out if LogonUI is running or when it is run. LogonUI is the application that displays the full screen logon dialog, winlogon I believe should still be displaying the old dialog in Windows XP Pro when FUS is disabled.
The other thing to check is to make sure that Terminal Services/FUS Service is running, of course TS can be running even when FUS is disabled. So if you don't care about that part and are more worried about the graphical look then logonui is probably what you would want to check.
You may want to verify this but in any case I would suggest a dynamic check since the state of using FUS or not can change.
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
This article[^] on the MSDN talks about the conditions under which fast user switching is available. It sounds like you could detect those conditions, and then assume that fast user switching is enabled.
If your application needs to know that users have changed, it's a lot simpler. Use WTSRegisterSessionNotification [^] to cause a window in your application to receive a message when the user has changed sessions.
Software Zen: delete this;
|
|
|
|
|
I need to generate a program database file containing my app's symbols when building in Release mode. I've modified the project settings to do this (/Zi ). However, I don't see the .pdb file when I build the app in Release mode. (It is being generated in Debug mode, as expected).
I know I've done this before but don't remember how I got it to work. Any idea what I'm missing?
Thanks!
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
1 Disable optimization
2 In the Link tab, select "Generate debug info"
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Ravi Bhavnani wrote:
1 Disable optimization
2 In the Link tab, select "Generate debug info"
In 'Release mode'??
|
|
|
|
|
Yes, this is necessary in order to create a log file containing a stack trace in the event of a crash. I'm using PJN's CExceptionLogger[^] class.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
You don't need to disable optimizations. Setting Program Database (/Zi) for the compiler and "generate debug info" for the linker, will do.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
you have debug infos in release mode ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|