Click here to Skip to main content
15,896,063 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Conforming a bitmap image to a particular resolution without resizing artefacts, and storing it as a PNG image in a database Pin
Sternocera26-Mar-09 13:12
Sternocera26-Mar-09 13:12 
GeneralRe: Conforming a bitmap image to a particular resolution without resizing artefacts, and storing it as a PNG image in a database Pin
Sternocera26-Mar-09 13:50
Sternocera26-Mar-09 13:50 
GeneralRe: Conforming a bitmap image to a particular resolution without resizing artefacts, and storing it as a PNG image in a database Pin
Stuart Dootson26-Mar-09 14:25
professionalStuart Dootson26-Mar-09 14:25 
GeneralRe: Conforming a bitmap image to a particular resolution without resizing artefacts, and storing it as a PNG image in a database Pin
CPallini26-Mar-09 22:49
mveCPallini26-Mar-09 22:49 
QuestionChanging icons for items in the list part of a Windows Explorer application [modified] Pin
Ben Aldhouse26-Mar-09 11:23
Ben Aldhouse26-Mar-09 11:23 
QuestionWindows scheduler question Pin
tom groezer26-Mar-09 11:17
tom groezer26-Mar-09 11:17 
AnswerRe: Windows scheduler question Pin
David Crow26-Mar-09 17:25
David Crow26-Mar-09 17:25 
QuestionMultiply Threads and Termination Pin
BobInNJ26-Mar-09 10:33
BobInNJ26-Mar-09 10:33 
AnswerRe: Multiply Threads and Termination Pin
CPallini26-Mar-09 11:04
mveCPallini26-Mar-09 11:04 
AnswerRe: Multiply Threads and Termination Pin
David Crow26-Mar-09 17:27
David Crow26-Mar-09 17:27 
QuestionSHBrowseForFolder and shell namespace extensions Pin
Greg Ingels26-Mar-09 9:40
Greg Ingels26-Mar-09 9:40 
AnswerRe: SHBrowseForFolder and shell namespace extensions Pin
Code-o-mat26-Mar-09 9:55
Code-o-mat26-Mar-09 9:55 
QuestionRun-time error in Matrix ADT Pin
Ma7moud El-Naggar26-Mar-09 9:35
Ma7moud El-Naggar26-Mar-09 9:35 
AnswerRe: Run-time error in Matrix ADT Pin
Stuart Dootson26-Mar-09 11:03
professionalStuart Dootson26-Mar-09 11:03 
GeneralOT - Welcome Pin
CPallini26-Mar-09 11:15
mveCPallini26-Mar-09 11:15 
GeneralRe: OT - Welcome Pin
Ma7moud El-Naggar31-Mar-09 8:58
Ma7moud El-Naggar31-Mar-09 8:58 
GeneralRe: OT - Welcome Pin
CPallini31-Mar-09 9:32
mveCPallini31-Mar-09 9:32 
QuestionWhat is the best solution for this problem?? Pin
Kiran Satish26-Mar-09 8:36
Kiran Satish26-Mar-09 8:36 
AnswerRe: What is the best solution for this problem?? [modified] Pin
CPallini26-Mar-09 8:56
mveCPallini26-Mar-09 8:56 
GeneralRe: What is the best solution for this problem?? Pin
Kiran Satish27-Mar-09 7:04
Kiran Satish27-Mar-09 7:04 
QuestionActive Directory ExecuteSearch enum results with LDAP_DIRSYNC_ANCESTORS_FIRST_ORDER Pin
Petr Stejskal26-Mar-09 6:16
Petr Stejskal26-Mar-09 6:16 
I'm having trouble with getting search results from Active Directory since I installed Microsoft Echange. After Exchange installation the enum order changed so that child SOME objects are enumerated before parent. Before installing Exchange everything was OK. Now I want to fix this behavior with following piece of code (but currently unsuccessfull). The flag LDAP_DIRSYNC_ANCESTORS_FIRST_ORDER does not work for me.

Here is the piece of code:

void ImportComputersFromAd()
{
CComPtr<IDirectorySearch> pSearch;
HRESULT hr = ::ADsGetObject(L"LDAP://DC=mydomain", IID_IDirectorySearch, (PVOID*)&pSearch);

ADS_SEARCHPREF_INFO rgSearchPrefs[4];
DWORD dwNumPrefs = 0;
rgSearchPrefs[dwNumPrefs].dwSearchPref = ADS_SEARCHPREF_SEARCH_SCOPE;
rgSearchPrefs[dwNumPrefs].vValue.dwType = ADSTYPE_INTEGER;
rgSearchPrefs[dwNumPrefs].vValue.Integer = ADS_SCOPE_SUBTREE;
dwNumPrefs++;

ADS_PROV_SPECIFIC dirsync;
dirsync.dwLength = 0;
dirsync.lpValue = NULL;

rgSearchPrefs[dwNumPrefs].dwSearchPref = ADS_SEARCHPREF_DIRSYNC;
rgSearchPrefs[dwNumPrefs].vValue.dwType = ADSTYPE_PROV_SPECIFIC;
//rgSearchPrefs[dwNumPrefs].vValue.ProviderSpecific.dwLength = sizeof(dirsync);
rgSearchPrefs[dwNumPrefs].vValue.ProviderSpecific = dirsync;
dwNumPrefs++;

rgSearchPrefs[dwNumPrefs].dwSearchPref = ADS_SEARCHPREF_DIRSYNC_FLAG;
rgSearchPrefs[dwNumPrefs].vValue.dwType = ADSTYPE_INTEGER;
rgSearchPrefs[dwNumPrefs].vValue.Integer = LDAP_DIRSYNC_ANCESTORS_FIRST_ORDER;
dwNumPrefs++;

hr = pSearch->SetSearchPreference(rgSearchPrefs, dwNumPrefs);

LPOLESTR pszAttribute[] = { L"ADsPath"};
CONST DWORD dwAttrNameSize = 1;

ADS_SEARCH_HANDLE hSearch;
hr = pSearch->ExecuteSearch(L"(|(objectClass=computer)(objectClass=organizationalUnit))", pszAttribute, dwAttrNameSize, &hSearch);
while(pSearch->GetNextRow(hSearch) != S_ADS_NOMORE_ROWS)
{
for(DWORD x = 0; x < dwAttrNameSize; x++)
{
ADS_SEARCH_COLUMN col;

HRESULT hr2 = pSearch->GetColumn(hSearch, pszAttribute[x], &col);
if(hr2 != E_ADS_PROPERTY_NOT_FOUND // 0x8000500d - The directory property cannot be found in the cache
&& hr2 != 0x8007200a // The specified directory service attribute or value does not exist.
&& hr2 != E_ADS_COLUMN_NOT_SET //0x80005010 - The specified column in the Active Directory was not set.
&& hr2 != 0x80005008)
{
CComPtr<IADs> srpiads;
hr2 = ::ADsGetObject(col.pADsValues->CaseIgnoreString, IID_IADs, (PVOID*)&srpiads);

//pThis->AddComputerProperties(srpiads);

pSearch->FreeColumn(&col);
}
}
}
pSearch->CloseSearchHandle(hSearch);
}
QuestionHow to set Header and footer in Excel file With use of MFC in VC++6.0 [modified] Pin
rocky8226-Mar-09 6:06
rocky8226-Mar-09 6:06 
AnswerRe: How to set Header and footer in Excel file With use of MFC in VC++6.0 Pin
Michael Schubert26-Mar-09 6:16
Michael Schubert26-Mar-09 6:16 
GeneralRe: How to set Header and footer in Excel file With use of MFC in VC++6.0 Pin
led mike26-Mar-09 8:35
led mike26-Mar-09 8:35 
JokeRe: How to set Header and footer in Excel file With use of MFC in VC++6.0 Pin
CPallini26-Mar-09 9:16
mveCPallini26-Mar-09 9:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.