|
Look at the keys under HKLM\software\Microsoft\Windows\CurrentVersion\uninstall
|
|
|
|
|
Thank you very much , but is there a way to get datas of MSI-style installed sws ? For ex. how can i get publisher or version data from registry ?
Regards
|
|
|
|
|
Did you bother opening the registry and navigating to that hive? You have the publisher, version and all other information there.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
There are APIs for getting that info from MSI. The APIs all start with Msi so they'll be easy to find.
|
|
|
|
|
Thank you Michael , but as you can see from my first post :
i cant use MSI in my project , it must be via registry.
|
|
|
|
|
See here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello all,
There is something that I'm missing in VC++2005, and I wanted to ask if it is possible or not.
In VC++6 you were able to modify one line of code and continue executing the program with that modification active... is this possible with the new VC++?
As always thank you in advance.
|
|
|
|
|
Yes, this is possible. You will have to enable "Program database for edit and continue (/ZI)" in your project options.
|
|
|
|
|
Hello,
I've gone to "Project -> properties -> Configuration properties -> C/C++ -> General -> DEBUG INFORMATION FORMAT" and I've seen that "Program Database for Edit & Continue (/ZI)" was already selected.
Do I'm missing something?
Thank you in advance for your feedback.
|
|
|
|
|
Well, question is... is it not working? What's the problem?
Try to edit the file in the middle of the program and see if it does a rebuild during execution.
|
|
|
|
|
It doesn't, it appears a messagebox that says:
---------------------------
Microsoft Visual Studio
---------------------------
This source file has changed. It no longer matches the version of the file used to build the application being debugged.
---------------------------
OK
---------------------------
And then I can see how the program pointer (the current execution line is not following the right line... So the text has changed, but the compiler doesn't know that...
Could you give me an advice?
Thank yu in advance for your feedback.
|
|
|
|
|
Hmm, sorry -- I don't know then. I've only had this behavior work for me by default, which I then disabled (from /ZI to /Zi). I don't have any other suggestions.
|
|
|
|
|
Yes, it's called edit and continue and the project has to have the right settings. I don't recall the section, but when doing debug settings it's where you set the kind of .pdb files to build.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
hi guys
anyone has any idea or know how to,
i hv a dialog based application, in tht suppose i want to bind notepad, bind mean, notepad will be inside the application and should behave as a child to my dialog, ie, u see a button or editbox they are bind to dialog n they act as a child to the app n they move with the app, same way in my app notepad has to do, move with the dialog.if i click some where out of ma app n then again click on ma app notepad should be in its place.
any idea,
thanks
|
|
|
|
|
There is a technology for that - OLE. To do what you want, first the client side (e.g. notepad) should support OLE activization/embedding. Second, your app should support the facilities of OLE controllers. As far as i know, Notepad is not an OLE client, so it cannot 'bound' (as you call) to other applications. For more details, search for 'OLE Visual Editing' in the web.
--
=====
Arman
|
|
|
|
|
Dear all
what happened when the issue occurred below? thanks.
fatal error RC1015: cannot open include file 'res\OhMyGod.rc2'.
Li Zhiyuan
30/06/2007
|
|
|
|
|
You might want to read this. Without more information, we couldn't tell you anything more helpful than what's at that link.
|
|
|
|
|
hi i have to run a command in command window as administrator. how to do this using mfc. pls help me
|
|
|
|
|
One way would be to make sure your MFC app has a manifest file with a "trustInfo" section and the requestedExecutionLevel level="asAdministrator"
That will make any process spawned by the MFC app run at the security level of "Administrator".
There may be more elegant solutions to this but this seems to work ok.
|
|
|
|
|
Hello.
I'm trying to figure out how to determine on which disk is Windows installed. I need to do this so that I can get additional infos afterwards about it, like Model Number, Serial Number, etc.
I don't need the partition letter (C:, etc), that's easy to get, but on which disk that partition is located (Primary Master (\\.\PhysicalDrive0), Primary Slave (\\.\PhysicalDrive1), etc).
Also, I don't want to use WMI.
Any help is greatly appreciated. Thanks alot.
|
|
|
|
|
Heres what I would do:
Step 1.) Read the %WINDIR% environment variable and parse what it returns. Lets say it returns C:\Windows\...
Step 2.) Save the drive letter "C:" into a buffer lets say szDrive[3].
Step 3.) Use the QueryDOSDevice() function to see which physical drive.
char szBuf[256];<br />
BOOL bResult = QueryDosDevice(szDrive,szBuf,sizeof(szBuf));
Step 4.) If we also wanted to know partition information we could do something like:
sprintf(szPhysical,"%s%s","\\\\.\\",szDrive);<br />
hDevice = CreateFile(szPhysical,GENERIC_READ,FILE_SHARE_READ | FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_FLAG_SEQUENTIAL_SCAN,NULL);<br />
if (INVALID_HANDLE_VALUE != hDevice)<br />
{<br />
DWORD dwRet =0;<br />
bResult = DeviceIoControl(hDevice,IOCTL_DISK_GET_PARTITION_INFO,NULL,0,&p,sizeof(p),&dwRet,NULL);<br />
printf("PartitionNumber: 0x%x %d",p.PartitionNumber,p.PartitionNumber);<br />
}
There are plenty of other IoCtl calls you can do to get extended information such as disk geometry.
Best Wishes,
Randor (David Delaune)
|
|
|
|
|
Thanks alot for your help!
For Win2k or later QueryDosDevice doesn't return the actual disk index, but the path to the volume object, so in that case we need to call DeviceIoControl with IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS.
Here's the code to accomplish that (used code from Sysinternals's DiskExt):
DWORD GetDiskIndex(TCHAR DriveLetter) {
TCHAR volumePath[MAX_PATH];
HANDLE hVolume;
ULONG bytesWritten;
UCHAR DiskExtentsBuffer[0x400];
PVOLUME_DISK_EXTENTS DiskExtents = (PVOLUME_DISK_EXTENTS)DiskExtentsBuffer;
_stprintf( volumePath, _T("\\\\.\\%c:"), DriveLetter);
hVolume = CreateFile( volumePath,
GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, 0, NULL );
if( hVolume == INVALID_HANDLE_VALUE ) {
return -1;
}
DWORD dn = -1;
if (DeviceIoControl( hVolume, IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS,
NULL, 0, DiskExtents, sizeof(DiskExtentsBuffer), &bytesWritten, NULL )) {
dn = DiskExtents->Extents[0].DiskNumber;
}
CloseHandle(hVolume);
return dn;
}
|
|
|
|
|
Dear all
How to use webcam in VC++? thanks a lot.
Li Zhiyuan
30/06/2007
|
|
|
|
|
|
I try to use RegLoadKey with HKEY_LOCAL_MACHINE hive, but it returns ERROR_ACCESS_DENIED ,
the code below works for HKEY_CURRENT_USER hive , i couldnt figure out why it didnt for also HKEY_LOCAL_MACHINE
although i am setting privilige defined as msdn ( http://msdn2.microsoft.com/en-us/library/ms724889.aspx )
Can you help me ?
HKEY hive ;
LONG lReturn ;
char sFileName[12] = "c:\\test.dat";
SetPrivilege(SE_BACKUP_NAME,TRUE);
SetPrivilege(SE_RESTORE_NAME,TRUE);
RegOpenKeyEx(HKEY_LOCAL_MACHINE, "",0,KEY_READ, &hHive);
RegSaveKey(hHive,sFileName,NULL);
lReturn = RegLoadKey(HKEY_LOCAL_MACHINE,"newhklm\\",sFileName);
// lReturn becomes 5L which means ERROR_ACCESS_DENIED
My privilige function :
BOOL SetPrivilege(LPCTSTR lpszPrivilege, BOOL bEnablePrivilege)
{
TOKEN_PRIVILEGES tp;
LUID luid;
HANDLE hToken;
OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken);
if ( !LookupPrivilegeValue(NULL, lpszPrivilege, &luid) )
return FALSE;
tp.PrivilegeCount = 1;
tp.Privileges[0].Luid = luid;
if (bEnablePrivilege)
tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
else
tp.Privileges[0].Attributes = 0;
AdjustTokenPrivileges(hToken, FALSE, &tp, 0, (PTOKEN_PRIVILEGES) NULL, 0);
return ( (GetLastError()!=ERROR_SUCCESS)?FALSE:TRUE);
}
|
|
|
|
|