|
Have you tried using ADSI?
You should be able to use it with 9x platforms. See Active Directory Service Interfaces[^]
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Does ASDI require Ms Exchange? I need something that only have dependencies to Windows(9x, NT) and no more.
thanks.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
I have a CScrollView (my private class is U_W_SCROLL_VIEW) and try to draw it invisible to the screen and export the drawn picture into an enhanced metafile.
The drawing is not right and I am getting various error or assertion failures in debug mode.
Can anyone point me to anything that I might be missing or doing wrong??
Any help welcome.
Here is the code
AB_BOOL<br />
U_W_SCROLL_VIEW::handle_metafile_save(const AB_Text& filename)<br />
{<br />
AB_Integer handler;<br />
MetaNode * pMetaNode;<br />
CMetaFileDC * pDCMetaFile;<br />
DWORD dwError;<br />
<br />
CMDIChildWnd* pChildFrame = (CMDIChildWnd*)GetParent();<br />
pChildFrame->ShowWindow(SW_HIDE);<br />
<br />
if( ::GetLastError() )<br />
::SetLastError(0);<br />
<br />
OnInitialUpdate();<br />
<br />
if( dwError = ::GetLastError() )<br />
goto failed;<br />
<br />
handler = request_create_metafile();<br />
<br />
pMetaNode = (MetaNode*)handler.to_long();<br />
pDCMetaFile = pMetaNode->pDCMetafile;<br />
<br />
set_export_metafile(handler, filename);<br />
<br />
OnPrepareDC(pDCMetaFile, NULL);<br />
if( dwError = ::GetLastError() )<br />
goto failed;<br />
<br />
OnDrawn(pDCMetafile);<br />
<br />
.........................<br />
}<br />
<br />
void<br />
U_W_SCROLL_VIEW::OnInitialUpdate()<br />
{<br />
TEXTMETRIC tm;<br />
CRect clientRect;<br />
CClientDC dc(this);<br />
<br />
m_hDC = dc.GetSafeHdc();<br />
<br />
if( abstract_logic->isExporting() ) {<br />
dc.SetWindowOrg(0, 0);<br />
}<br />
<br />
CFont* pOldFont = dc.SelectObject(&m_font);<br />
dc.GetOutputTextMetrics(&tm);<br />
m_sizeLine.cx = tm.tmAveCharWidth;<br />
m_sizeLine.cy = tm.tmHeight + tm.tmExternalLeading;<br />
dc.SelectObject(pOldFont);<br />
<br />
GetClientRect(clientRect);<br />
m_sizePage.cx = clientRect.Width();<br />
m_sizePage.cy = clientRect.Height();<br />
<br />
int rem_x = m_sizePage.cx % m_sizeLine.cx;<br />
int rem_y = m_sizePage.cy % m_sizeLine.cy;<br />
<br />
m_sizePage.cx -= rem_x;<br />
m_sizePage.cy -= rem_y;<br />
<br />
::SetClassLong( this->m_hWnd, GCL_HCURSOR, NULL );<br />
<br />
m_hDefaultCursor = ::LoadCursor( NULL, IDC_ARROW );<br />
m_hCursor = m_hDefaultCursor;<br />
::SetCursor(m_hCursor);<br />
<br />
SetScrollSizes( MM_TEXT, m_sizeScroll, m_sizePage, m_sizeLine );<br />
}<br />
<br />
void<br />
U_W_SCROLL_VIEW::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo)<br />
{<br />
<br />
HDC hAttribDC = this->m_hDC;<br />
<br />
metafiles.RemoveAll();<br />
<br />
m_hDC = pDC->GetSafeHdc();<br />
<br />
abstract_logic->handle_draw_persistent();<br />
<br />
AB_Integer left, top, right, bottom;<br />
<br />
abstract_logic->get_view_total_size(left, top, right, bottom);<br />
<br />
if( !request_begin_export_metafile(left, top, right, bottom) )<br />
return;<br />
<br />
m_hDC = pDC->GetSafeHdc();<br />
<br />
pDC->SetAttribDC(hAttribDC);<br />
<br />
<big> <br />
CScrollView::OnPrepareDC(pDC, pInfo);<br />
<br />
</big> pDC->SetMapMode(MM_TEXT);<br />
}<br />
<br />
<br />
AB_BOOL<br />
U_W_SCROLL_VIEW::request_begin_export_metafile(<br />
AB_Integer& left,<br />
AB_Integer& top,<br />
AB_Integer& right,<br />
AB_Integer& bottom )<br />
{<br />
MetaNode * pMetaNode = (MetaNode*) m_hExporting.to_long();<br />
CMetaFileDC * pDCMetaFile = pMetaNode->pDCMetafile;<br />
<br />
CDC * pDC = GetDC();<br />
<br />
int factor_x = ceil( (pDC->GetDeviceCaps(HORZSIZE) * 100.0)/ pDC->GetDeviceCaps(HORZRES));<br />
int factor_y = ceil( (pDC->GetDeviceCaps(VERTSIZE) * 100.0)/ pDC->GetDeviceCaps(VERTRES));<br />
<br />
CRect rect( 0, 0, (right.to_long() - left.to_long() + 10) * factor_x,<br />
(bottom.to_long()- top.to_long() + 10) * factor_y );<br />
<br />
if (!pDCMetaFile ->CreateEnhanced(pDC, m_psExporting->data(), &rect, NULL))<br />
{<br />
::SetLastError(-1);<br />
<br />
return AB_FALSE;<br />
}<br />
<br />
HDC hDC = pDCMetaFile->GetSafeHdc();<br />
<br />
SetGraphicsMode(hDC, GM_ADVANCED);<br />
pMetaNode->bounds.left = left.to_long();<br />
pMetaNode->bounds.right = right.to_long() + 10;<br />
pMetaNode->bounds.top = top.to_long();<br />
pMetaNode->bounds.bottom = bottom.to_long() + 10;<br />
<br />
return AB_TRUE;<br />
}<br />
<br />
void<br />
U_W_SCROLL_VIEW::OnDraw(CDC* pDC)<br />
{<br />
XFORM xForm;<br />
RECT inv_rect;<br />
MetaNode* meta_node;<br />
POSITION pos;<br />
<br />
if( m_bInRepaint )<br />
return;<br />
<br />
m_bInRepaint = TRUE;<br />
m_hDC = pDC->GetSafeHdc();<br />
<br />
m_bPrinting = FALSE;<br />
AB_Integer left, top, right, bottom;<br />
<br />
request_get_metafile_bounds(m_hExporting, left, top, right, bottom);<br />
<br />
inv_rect.left = left.to_long();;<br />
inv_rect.top = top.to_long();<br />
inv_rect.right = right.to_long();<br />
inv_rect.bottom = bottom.to_long();<br />
COLORREF clr = ::GetSysColor(COLOR_WINDOW);<br />
<br />
<big>
pDC->FillSolidRect(&inv_rect, clr);<br />
</big><br />
SetGraphicsMode(m_hDC, GM_ADVANCED);<br />
<br />
ModifyWorldTransform( m_hDC, &xForm, MWT_IDENTITY );<br />
<br />
Scale(m_hDC);<br />
Translate(m_hDC);<br />
<br />
pos = metafiles.GetHeadPosition();<br />
while( pos != NULL )<br />
{<br />
meta_node = (MetaNode*)metafiles.GetNext(pos);<br />
::PlayEnhMetaFile(m_hDC,meta_node->hMetafile,&(meta_node->bounds));<br />
}<br />
<br />
RestoreIdentityDC(m_hDC);<br />
}<br />
|
|
|
|
|
Hi I am developing one small windows service runs on Windows 2000. It retrieves the mails from the mail box of the Microsoft Exchange User using MAPI function calls. When I am doing the same thing from my Win32 Console Application I am getting the mails from Inbox. But if i try to put that into Service, it shows it cannot obtain folder ?
Is it like MAPI call doesn't work in Service. ? What seems to be error ?
Regards
Mike
|
|
|
|
|
MAPI will require a mail client to be running in order for it to work correctly, otherwise a dialog asks for connection details. Since services run without the desktop, dialogs can not appear.
I would also check the access rights for the account that the service runs under.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Hi
I have a MFC Dialog window. I have created a modelless window which in turn creates another modelless window. The parent of all the modelless window is desktop.
Now the problem is that while pressing Alt+Tab I cannot see the Icon corresponding to the Main Dialog window (Model). But I can see the icon for all other windows(modelless, only if I set the parent to desktop).
All the windows have the same icon.(IDR_MAINFRAME)
What could be the problem?
Regards
The Best Relligion is Science.
Once you understand it, you will know God.
|
|
|
|
|
My command line call might look like "sth.exe file1.txt file2.txt file3.txt".
How can i parse such a command line in an SDI application?
I've already tried ParseCommandLine(cmdInfo) and then cmdInfo.m_strFileName, but this only gives me the first parameter. How can i get the rest?
|
|
|
|
|
You can use
LPTSTR GetCommandLine(void);
to retrieves the command-line string for the current process.
And then pass the value obtained to
LPWSTR* CommandLineToArgvW(<br />
LPCWSTR lpCmdLine,<br />
int* pNumArgs<br />
);<br />
to convert the command line to an argv style array of strings.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
you can directly access _argc and _argv if you want to. Just include stdlib.h in the stdafx.h and there you go.
|
|
|
|
|
Hi
I have a process(root) which spawns other processes to get its work done. These children in turn may spawn more processes and so on. I want to obtain the memory used by all of these processes at a point of time from the root process(very 1st process).
So, I neeed 2 things:
First is to obtain all the process handles of this process tree.
So, Is there a way to find all the child processes for a particular process. Right now I am using "CreateToolhelp32Snapshot" to obtain a snapshot of all the processes in the system and then looking for the processes which have root process as their parent. Doing this recursively to obtain the whole process tree.
Is there a better approach available for doing this?
Secondly, get the memory used by process. Is there an API available to do this? Can not use "PSAPI" as its not for Win95, 98.
Thanx
kapil
|
|
|
|
|
See if EnumProcesses() or the Process32First() /Process32Next() pair help you.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Enumerate processes in a manner that obtains each process identifier. I am not sure how to detect they are part of same group or not.
To determine how much memory each one is using,
You can adjust each process token to add SE_DEBUG privilege.
Then OpenProcess to get handle from process identifier, then enumerate memory used by process using VirtulQueryEx.
|
|
|
|
|
I have CTreeView object, that changing dynamically when user add new level. How can I add new level in any place in Tree.
I mean not only parent level but also child level.
Thanks in advance, Bilas.
|
|
|
|
|
Hi
HTREEITEM hRoot = m_ctrlTree.InsertItem("ROOT",0,0);
HTREEITEM hChild = m_ctrlTree.InsertItem("Child",hRoot,TVI_LAST);
HTREEITEM hGrandChild = m_ctrlTree.InsertItem("Grand Child", hChild,TVI_LAST);
Hope this may help you.
Regards
The Best Relligion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Ok. But my Tree craates by reading file with structure:
1 Parent1
11 Child 1
111 Child 11
112 Child 112
...
12 Child 2
...
2...
Can someone help me how to build tree by reading this file?
Thanks in advance
|
|
|
|
|
I'm not advanced in programming, so I need some help in my case
I need to realize 2 function in my program:
- load html-documents in window
- organize function "Find..." that find text on this document.
I did it in next way: I added in my project class CRightHTMLView, that has CHtmlView class as base class:
class CRightHTMLView : public CHtmlView
{
...
}
Than I load this class as right side of my splitted window in MainFrm.cpp:
my_RightView = RUNTIME_CLASS( CRightHTMLView );
my_LeftView = RUNTIME_CLASS( CLeftView );
As result I have:
+======+=============+
| | |
| | |
|CView | CHTMLView |
| | |
| | |
+------+-------------+
Than I realised loading html files in right window. But do not know how to realize find-function, that must find text
on loaded document. I have the next idea: send to Windows event "Ctrl+F", and than call this event everytime when user
select the specified menu: File->Find... But I do not know how to do this. Maybe this is not the best way to find text.
Actually, I think that class CHTMLView has specific function to search text.
I'll be very thanksfull to everybody hwo can help me. It's really very important for me to finish my program as soon as I can.
Thanks in advance, Bilas.
|
|
|
|
|
http://support.microsoft.com/kb/q175513/[^]>]
FILE: Invoke Find, View Source, Options Dialog Boxes for WebBrowser
http://blog.joycode.com/jiangsheng
http://blog.csdn.net/jiangsheng
Command what is yours
Conquer what is not
---Kane
|
|
|
|
|
Hi can someone show me how I lock a dialog window so the user canot move the dialog with there mouse. EG: I want the dialog to remain in the center of the window and only be able to exit the dialog not move it around in the window
THanks
|
|
|
|
|
A simple method is to override the WM_WINDOWPOSCHANGING message (OnWindowPosChanging).
<code>
<font color="green">
void CMyDlg::OnWindowPosChanging(WINDOWPOS* lpwndpos)
{
lpwndpos->flags |= (SWP_NOMOVE | SWP_NOSENDCHANGING);
CDialog::OnWindowPosChanging(lpwndpos);
}
</code>
I Dream of Absolute Zero
|
|
|
|
|
Hi RChin,
Thanks but my dialog windows still moves maybe I havent implemented correctly can you give me an example how to make this work
Thanks
|
|
|
|
|
Hi,
I am looking for a Visual C++ 6.0 compatible plotting library with 3D plot. Some features like saving the plot would be nice as well. (library can be commercial).
Thanks,
and
|
|
|
|
|
You might want to look at GigaSoft ProEssentials - www.gigasoft.com
Karl - WK5M
PP-ASEL-IA (N43CS)
<kmedcalf@ev1.net>
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Hi all:
How can I specify the height and width of the window appeared after I click the Date Time Picker Control?
Thanks!
|
|
|
|
|
How about
CWnd::MoveWindow(...)
(a confusing function name by Ms)
Sonork 100.41263:Anthony_Yio
|
|
|
|
|