|
Hi i want to impersonate the process in SYSTEM, Logged in user and specified user.
for Specified user i am giving the username and password and impersonation is working fine. The code is taken from http://msdn.microsoft.com/en-us/library/aa379608(VS.85).aspx[^]. The main process starts in SYSTEM account so by only using CreateProcess() api i can handle the case of SYSTEM user. But i am not finding any way to handle the logged in user case. How to get the token for logged in user?
Any help in this context is really appreciated.
|
|
|
|
|
Using Visual Studio 2005 with Client and Server projects, I would now like to clone the client project several times - all within the same solution. This is to keep all the include/libs and other project setting the same.
In the past I just added a new project and copied the code in and redone all the other project settings.
Are they another way to do this. Renaming just causes problems
Many thanks,
Andy.
|
|
|
|
|
Andy202 wrote: Renaming just causes problems
I personally just copy the project (.prj) file (using Windows Explorer), rename it, open the file in
a text editor, and do all the renaming there (the project file is XML).
Then the new project can be added to a solution in the IDE, where the project files from
the cloned project can be removed.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hey Mark, what's the context for this need? Why do I need a cloned project in the same solution? Or even at all?
led mike
|
|
|
|
|
I've done it making plugin modules so I don't have to set up
duplicate settings for new module projects. Just a copy of an existing
project folder is easy, but renaming just the project file name still leaves
the old project name in the project settings XML.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
One thing to watch is there's a GUID in the project file that links it to the solution. When you copy the project file, you need to generate a new GUID so that the new, cloned project has a different GUID from it's predecessor.
|
|
|
|
|
Good to know! Thanks Gary!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You're welcome. I had to reverse-engineer the Visual Studio project and solution file formats a while back in order to automate our product branching process. I still don't understand it completely, but I found an approach that works for what we need.
|
|
|
|
|
Using Visual C++ 6.0 MFC in SDI application
I don't understand how to clear the client window that I had been drawing in when the user selects the menu item "New" from the main File menu. What code should be used to clear the old window and where should that code go?
Thanks!
|
|
|
|
|
You can update all views then put a handler in View class and clean the view in the handler.
-@SuDhIrKuMaR@-
|
|
|
|
|
Hello all,
I am working on Client Server architecture.In this multiple servers,
multiple Clients can be there.I am facing one problem here please suggest some solution for that....
take an example If I have two servers running on two different computers A & B.I have database on computer A. Both servers are connected to same database which is lying on A. Now if my A server has done some operation like Add or Delete data in database then How it can be reflected in Server B cache.
I mean how server B can be intimated that this operation has been done so it can get that perticular record only from database.
I can't take all data because I have around 5 lakhs of records in database so fetching all 5 lakhs records for one single record is not feasible & it will take too much time also.
So is there any other way than broadcasting and changing in database.please suggest me.
|
|
|
|
|
I have SQL Server 2005 instaled in a server system
Can I programatically connect to this database system (using a VC application .exe) and execute
a SQL query to create a table and insert/update few records into it.
Do we have MFC Classes and appropriate member functions to do the above task ?
Thanks in advance.
|
|
|
|
|
Do you know about this page http://www.codeproject.com/KB/database/[^]?
BTW it's a secret: don't divulgate.
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
|
|
|
|
|
CPallini wrote: BTW it's a secret: don't divulgate.
Dont worry you can tell us your secrets only 5,197,414 members can be see them.
|
|
|
|
|
Hamid. wrote: only 5,197,414
You're wrong.
Hint: you don't need being a member to see posts and replies.
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
|
|
|
|
|
Yeah you right dont need ,so hurry up to divulgate secrets .
|
|
|
|
|
ODBC, ADO database connectivity- CDatabase, CDaoDatabase class etc. will help you.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I have a Visual C++ program which has compiled and run many times through various editings.
Suddenly today it has started faulting with these 16 unresolved externals. What is happening?
1>IMAGES.obj : error LNK2001: unresolved external symbol _GdipGetImageEncodersSize@8
1>IMAGES.obj : error LNK2001: unresolved external symbol _GdipGetImageEncoders@12
1>IMAGES.obj : error LNK2001: unresolved external symbol _GdiplusStartup@12
1>IMAGES.obj : error LNK2001: unresolved external symbol _GdipCreateBitmapFromFile@8
1>IMAGES.obj : error LNK2001: unresolved external symbol _GdipCreateBitmapFromFileICM@8
1>IMAGES.obj : error LNK2001: unresolved external symbol _GdipFree@4
1>IMAGES.obj : error LNK2001: unresolved external symbol _GdipAlloc@4
1>IMAGES.obj : error LNK2001: unresolved external symbol _GdipCloneImage@8
1>IMAGES.obj : error LNK2001: unresolved external symbol _GdipDisposeImage@4
1>IMAGES.obj : error LNK2001: unresolved external symbol _GdipCreateHBITMAPFromBitmap@12
1>IMAGES.obj : error LNK2001: unresolved external symbol _GdipGetImageWidth@8
1>IMAGES.obj : error LNK2001: unresolved external symbol _GdipGetImageHeight@8
1>IMAGES.obj : error LNK2001: unresolved external symbol _GdiplusShutdown@4
1>IMAGES.obj : error LNK2001: unresolved external symbol _GdipCreateBitmapFromGdiDib@12
1>IMAGES.obj : error LNK2001: unresolved external symbol _EncoderQuality
1>IMAGES.obj : error LNK2001: unresolved external symbol _GdipSaveImageToFile@16
1>C:\2d\ppp_vc\Release\ppp_vc.exe : fatal error LNK1120: 16 unresolved externals
|
|
|
|
|
Did you import gdiplus.lib?
|
|
|
|
|
You probably forgot to link against gdiplus.lib.
|
|
|
|
|
Thanks; please how do I link against gdiplus.lib?
|
|
|
|
|
Depends of the IDE you are using. For VC2005: open your project properties -> "Configuration Properties" -> "Linker" -> "Input" and add "gdiplus.lib" in the "Additional Dependecies" option.
|
|
|
|
|
put this in your stdafx.h under your include.
#pragma comment(lib, "GdiPlus")
|
|
|
|
|
Thanks. #pragma comment(lib, "GdiPlus") works.
|
|
|
|
|
Guys,
I have a small problem.
Our product, a monstruous C++ application (MFC I think) provides functions for automation. It allows you to create other applications that can click a button, set/get text from various controls etc...
One of the things I do in code is read out a column from a list. (CListView??)
This is where the problem lies, occasionally, apparently completely random and without any clear reason (at least, not as far as we could discover ) it fails to read out the value although there is one in the list. I have never ever been able to reproduce it on my Dev machine (Xp), but on the test machine it happens (Windows 2000). After some analysis I figured it must be some data corruption, because if you refresh the data from our application it suddenly works correctly again (refreshing takes too long so we try to avoid it).
Question: Could this be Windows 2000 related? Maybe it's fixed in a SP?
I tried google, but I'm not sure what to search on...
Many thanks.
|
|
|
|