|
for word document, i think you can use COM interfaces provided by microsoft.
But for PDF file, i have no idea, maybe you can use its virtual print service.
You can look up them on the internet for more exactly details.
|
|
|
|
|
A while ago, I asked a question about,
error C2061: syntax error : identifier 'CEvent'
in a .dll project. My dev env is vs 2005 sp1, but I get this error in 6.0 too. So last time you told me to make sure I include afxmt.h, where CEvent is defined. I dropped this into stdafx.h
Now, it tells me,
1>e:\program files\microsoft visual studio 8\vc\atlmfc\include\afxv_w32.h(16) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
</windows.h>
afxmt.h is an MFC header, right? How do I get around this..?
|
|
|
|
|
bulg wrote: How do I get around this..?
Googling for [^]?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
You need to change your project in a MFC-Project (Headers and project settings) or look in your actual class library if there is an event class.
Or use writing a small Event class to do the CEvent stuff. It is not much.
Greetings from Germany
|
|
|
|
|
Can anybody enlighten me please,
|
|
|
|
|
Check what DLLs it depends on. Have you registered it in the other machine?
Steve
|
|
|
|
|
|
Hello,
Is it possible to re-associate a socket with a different io completion
port? I have an open socket associated with one completion port, I
post a read, handle the read, then want to send some data back on the
socket but have the write complete event be queued to a different io
completion port.
[Big picture is that I have multiple thread pools in a server and want
to move some IO to another thread pool]
Best
Mike
|
|
|
|
|
Mike Curry - Canada wrote: Is it possible to re-associate a socket with a different io completion
port?
I don't believe so. The only way to disassociate a handle from an IO completion port is to close it.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have a non interactive service running under a local account. This service starts a process in each desktop by locating instances of explorer.exe then creating a primary token and calling CreateProcessAsUser using that token. Is there a way to get the desktop i.e. winsta0\default for the process I am goint to impersonate?
modified on Thursday, June 19, 2008 7:06 PM
|
|
|
|
|
rcardare wrote: by locating instances of explorer.exe then creating a primary token
That sounds interesting but I don't know what it means, could you be more specific?
led mike
|
|
|
|
|
I have a program running as a system service using the local system account (non interactive). This service then starts and monitors processes running interactively in the users desktop. I detect when a new user has logged in by monitoring instances of the explorer.exe and session id’s. When I have a new explorer.exe, I then impersonate the logged in user by getting the process token for explorer.exe process (OpenProcessToken) and creating a primary impersonation token (DuplicateTokenEx). Once I have the token I start the process that interacts with the user using CreateProcessAsUser and supply the token. The problem I would like to solve is setting the lpDesktop field to a proper value in the STARTUPINFO structure. I would like to get the windows station that is used for the explorer.exe process that I am impersonating. The satellite processes then communicate with the service through pipes which relays messages. I know starting the client process this way is not the best and will break post vista but I need a reliable way to keep the client processes running without having multiple processes monitoring for each desktop session. Any other ideas would be great... This has worked fine on windows server 2000 and XP which is in our production environment but when I moved this to windows 2003 I kept getting a parameter incorrect exception. I am reviewing the code and trying to set the values for what is knows to try and eliminate the error.
|
|
|
|
|
Thanks, that answers my question.
Now to dig in more to your question:
rcardare wrote: This service starts a process in each desktop
"in each desktop"? Does this mean you are working with multiple desktop sessions on the server using Terminal Services. If so you probably want to use the Terminal Services API[^]
led mike
|
|
|
|
|
The interactive window station, Winsta0, is the only window station that can display a user interface or receive user input. It is assigned to the logon session of the interactive user, and contains the keyboard, mouse, and display device. All other window stations are noninteractive, which means they cannot display a user interface or receive user input.
|
|
|
|
|
rcardare wrote: Is there a way to get the desktop i.e. winsta0\default for the process I am goint to impersonate?
Some window station functions are given here ->
http://msdn.microsoft.com/en-us/library/ms687107(VS.85).aspx[^]
Does these help... GetProcessWindowStation , EnumWindowStations .
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Has anyone used this control?
I'm working on a MDI application that has toolbars in both the MainFrame and the ChildFrame. I want to use large images ( 32x32 ) in the ChildFrame while using normal ( 16x16) in the MainFrame. When I try to do this the MainFrame ToolBar gets mangled, graowing larger and showing some of its images as well as some un-wanted ChildFrame images.
=======================================================
//MainFrame.cpp
const DWORD dwTBStyle = TBSTYLE_FLAT ;
const DWORD dwWndStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP /*| CBRS_GRIPPER*/ | CBRS_TOOLTIPS | CBRS_FLYBY /*| CBRS_SIZE_DYNAMIC*/ ;
if ( !m_wndToolBar.CreateEx(this, dwTBStyle, dwWndStyle) || ! m_wndToolBar.LoadToolBar(IDR_MAINFRAME) )
{
TRACE0( __LOC__ "Failed to create toolbar" ) ;
return( -1 ) ;
}
const CString strMainToolbarTitle( (LPCTSTR)IDS_MAIN_TOOLBAR ) ;
m_wndToolBar.SetWindowText( strMainToolbarTitle ) ;
m_wndToolBar.EnableDocking( CBRS_ALIGN_ANY ) ;
//ChildFrame.cpp
const DWORD dwTBStyle = TBSTYLE_FLAT ;
const DWORD dwWndStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP /*| CBRS_GRIPPER*/ | CBRS_TOOLTIPS | CBRS_FLYBY /*| CBRS_SIZE_DYNAMIC*/ ;
if ( !m_wndSectionBar.CreateEx(this, dwTBStyle, dwWndStyle) ||
!m_wndSectionBar.LoadToolBar( IDR_JOB2) ||
!m_wndSectionBar.SetButtons( HJobButtons, sizeof(HJobButtons) / sizeof(UINT) )
)
|
|
|
|
|
|
"static text"? What does that mean?
led mike
|
|
|
|
|
Its a control on which we put text
|
|
|
|
|
sumit.durg wrote: Its a control
If you mean a Windows control then:
sumit.durg wrote: In ATL
the fact that your using ATL does nothing to change how you change the Font of the Windows Control[^].
led mike
|
|
|
|
|
change the ID of that control...
create a control variable for that ...
now use that variable to change the text ...
|
|
|
|
|
Hi all,
Please anyone can tell me how can i add userID and Password function in SDI type application in VC++ 2005.
I m waiting for your valuable suggestions.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Can you more explain what do you want to do? make a new dialog for password and username or other thing?
|
|
|
|
|
yes sir,
i want use UserId and password function before starting the application.
according to this user or admin can use the application.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
So you need to make a dialogbox with two editboxs for get username and password (dont forget to set password on the property window of editbox that you need to get password).
|
|
|
|