|
Irrelevant.
The question is another: can the OS invoke something different than main?
That does not depend on C++ specs, but on how the linker is instructed.
What about WinMain ?!?
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
No. The question was: "Can main() be overloaded?". The answer is no. However, the standard does not enforce the existence of "main" - it leaves it up to the implementation how the entry point of a program is defined. But if the entry point is main, "it shall not be overloaded"...
|
|
|
|
|
Please read all the post: just four line up yours, the OP clarified we where all misleading his originally malposed question!
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
In Windows, distribute it as a DLL and use the runDLL32 (something like that) to pick your entry point.
I imagine *nix has a similar utility.
|
|
|
|
|
not sure about overloading, but it can be called just like a regular function.
12 Days o Christmas
|
|
|
|
|
...not in a "well formed c++ program" according to c++ standard.
|
|
|
|
|
Hi all,
Its been long but I am back with another puzzling question...
Does anybody who has worked on ADSI can help me out to read 'User must change password at next logon' using LDAP. I do know how to set the values by using 'pwdlastset' but I am not able to search for a way to read it.
Can somebody throw a light on it.
-Kushagra
|
|
|
|
|
I dont know the exact answer to your question, usually I use a tool like http://ldaptool.sourceforge.net/[^] to browse for attributes and view them, then try and read the attribute once I know what Im looking for/at
If you dont have such, use that or search for [LDAP Explorer] for example
'g'
|
|
|
|
|
that doesnot help me out... as I am working on ADSI and using LDAP just for authentication..
|
|
|
|
|
|
Finally I was able to figure this stuff out...
Check this out: http://msdn.microsoft.com/en-us/library/ms974598.aspx
We will have to query for 'PasswordLastChanged' and if it fails with error code E_ADS_PROPERTY_NOTFOUND , then we have the password option set as 'User must change password at next logon'.
Hope this helps someone in future.
-Kushagra
|
|
|
|
|
Continued from http://www.codeproject.com/Messages/3565121/help-needed-about-help.aspx
If s is a char* -type variable containing the name of a *.chm-type file, please how do I call it as a help file?
With the old help I used a format like:
case _HELP_: WinHelp(wn,PROGNAME".HLP",HELP_CONTENTS,0); goto DEF;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A link in that earlier thread led me to an application that can decompile .HLP files into .RTF files. Thanks.
I still have an old help-maker called HELPGEN that translates from its scripting input language to .RTF and then separately from .RTF to .HLP .
Please, where is a simple-to-use application which can translate from such .RTF's to .CHM ?
|
|
|
|
|
According to MSDN, how about:
case _HELP_: HtmlHelp(wn, s, HH_DISPLAY_TOC, (DWORD_PTR)NULL);
Also see Google: Converting WinHelp HtmlHelp. Hope this helps
/M
|
|
|
|
|
Can you use ShellExecute() ?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
When you are in the MFC context :
CYourApp::CYourApp()
{
EnableHtmlHelp();
}
BEGIN_MESSAGE_MAP(CYourApp, CWinApp)
ON_COMMAND(ID_HELP, OnHelp)
END_MESSAGE_MAP()
BOOL CYourApp::InitInstance()
{
...
CString cszHelpFile(_T("C:\\test.chm"));
m_pszHelpFilePath = _tcsdup(cszHelpFile);
...
}
#define HLP_INDEX 0 // index of the desired page
void CYourApp::OnHelp()
{
HtmlHelp(HLP_INDEX, HH_HELP_CONTEXT);
}
Use also: /*virtual*/ void CWnd::HtmlHelp(DWORD_PTR dwData, UINT nCmd /*= 0x000F*/)
virtual void BeHappy() = 0;
|
|
|
|
|
PROGNAME".HLP" isnt a proper string so it doesnt work
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
#define PROGNAME "myapp"
makes it a proper string
|
|
|
|
|
you guys are so evil
|
|
|
|
|
Jedi stuff. Don't try it at home...
|
|
|
|
|
Actually,
#define PROGNAME "myapp"
#define HELPFILE PROGNAME##".hlp"
const TCHAR *helpFileName = HELPFILE;
that works.
|
|
|
|
|
Actually, actually , the last two lines you added does not affect
PROGNAME".HLP" at all.
|
|
|
|
|
Well duh.
The intention was to illustrate how one could accomplish that effect of token pasting correctly. I guess you missed it.
|
|
|
|
|
Sorry mate!
I was reading "that works" as if my reply didn't.
|
|
|
|
|
Hello everyone !
The test dialog will showing ,when the mouse double clicked on the MDIView.
Now I want to get the CMDIView's pointer in test dialog member function,and then to call "CMDIView::OnDraw" to update the windows.
the code like this:
/////////////////////////////////////////////////////////////////
// MDIView.h
#include "TestDlg.h"
class CMDIView : public CView
{
public:
CTestDlg *m_pTestDlg;
CWnd *m_pWnd;
}
CMDIView::CMDIView()
{
m_pTestDlg = new CTestDlg();
m_pTestDlg.Create(IDD_TEST_DLG,this);
m_pTestDlg.ShowWindow(SW_HIDE);
m_pTestDlg.UpdateWindow();
}
void CMDIView::OnLButtonDblClk(UINT nFlags, CPoint point)
{
m_pTestDlg.InitDlg("Hello",this);
m_pTestDlg.ShowWindow(SW_SHOWNORMAL);
}
CMDIView::OnDraw(CDC *pDC)
{
//Here will get the document pointer to draw the element.
GetDocument()->DrawAllItem(..);
}
// MDIView.h over.
/////////////////////////////////////////////////////////////////
now here is the dialog's member function:
/////////////////////////////////////////////////////////////////
class CTestDlg : public CDialog
{
public:
CWnd *m_pWnd;
//......
}
CTestDlg::InitDlg(CString strTitle,CWnd *pWnd)
{
SetWindowText(strTitle);
m_pWnd = pWnd;
ASSERT( m_pWnd != NULL);
}
void CTestDlg::OnBtnEdit()
{
//Now I want to get the CMDIView's pointer,and then to call CMDIView::OnDraw
//Then how to write?
......
}
I try to use this way ,but failed too,please help me...
m_pWnd->Invalidate();
m_pWnd->UpdateData(FALSE);
Thanks for you reply !
Best Regards !
|
|
|
|
|
Just set the parent in the dialog construction :
class A;
class B
{
A* m_pA;
public:
B(A* pA) { m_pA = pA; }
bool TestParent() {
if (m_pA) m_pA->CallMe();
return (NULL != m_pA);
}
};
class A
{
B* m_pB;
public:
A() { m_pB = new B(this); }
~A() { if (m_pB) delete m_pB; }
void CallMe() {}
};
virtual void BeHappy() = 0;
|
|
|
|