|
Hello,
I am trying to make an SDI applicaiton with a form view.
When this type of applicaiton is generated in MFC, the main window is sized according to the size of the dialog or the screen size.
If the window size is smaller than the dialog, scroll bars appear so that the dialog can be scrolled inside the view.
When I generate this same type of applicaiton in WTL, the dialog is clipped if the view size is smaller than the dialog, and the size is based only on the screen size.
I can change the size of the main window by initializing a rect in the Run function before calling wndMain.CreateEx(NULL,rc).
However, I would like to duplicate the functionality of the MFC applicaiton.
How do I get the correct size for the main window?
How do I get the scroll bars to appear if the view is smaller than the dialog?
|
|
|
|
|
I used ATL to realize my NSE. But I'd like to use DefView instead of customized list view in my NSE. So I had to implement IShellFolder2. However error(Heap corruption) happens every time when I debugging the NSE. Do you know what's the reason or how shall I implement the IShellFolder2.
|
|
|
|
|
|
I tried to download the mailer sample from http://msdn.microsoft.com/en-us/library/6c3k2z70(VS.80).aspx but everytime I get this message
========== Rebuild All: 0 succeeded, 0 failed, 2 skipped ==========
It is not building the project. everytime it just skips it. I do not know what does that mean? How can I get this code to compile? I am using VS 2008, win XP.
Thanks.
the fruits of your success will be in direct ratio to the honesty and sincerity of your own efforts in keeping your own records, doing your own thinking and, reaching your own conclusions.
..surviving in autumn..in love with spring..
|
|
|
|
|
you must activate the projects in the build manager. You find it in the "Build" Menu.
Greetings from Germany
|
|
|
|
|
thanks for the reply. Yes, now I am able to compile it now but that sample did not meet my requirement so I left it long back.
the fruits of your success will be in direct ratio to the honesty and sincerity of your own efforts in keeping your own records, doing your own thinking and, reaching your own conclusions.
..surviving in autumn..in love with spring..
|
|
|
|
|
hi,
i want to define an enum type variable on the Interface ,
so i have defined an enum within interface and then take a property from this enum,
but have encountered with a compile time error !?
what is my mistake and what is its solution?
interface IXFSReceipt : IDispatch
{
enum RPtrResolution
{
RPTR_RESOLUTION_LOW,
RPTR_RESOLUTION_MEDIUM,
RPTR_RESOLUTION_HIGH,
RPTR_RESOLUTION_VERYHIGH
};
HRESULT Resolution([out, retval] RPtrResolution* pVal);<<<<<<<< ERROR1
HRESULT Resolution([in] RPtrResolution newVal);
};
ERROR1 : error MIDL2025 : syntax error : expecting a type specification
modified on Friday, June 27, 2008 4:44 PM
|
|
|
|
|
You have to define a typedef for the enum.
This should do the trick:
typedef enum RPtrResolution{
RPTR_RESOLUTION_LOW,
RPTR_RESOLUTION_MEDIUM,
RPTR_RESOLUTION_HIGH,
RPTR_RESOLUTION_VERYHIGH
}RPtrResolution;
[
Your Interface UID and etc...
]
interface IXFSReceipt : IDispatch
{
HRESULT Resolution([out, retval] RPtrResolution* pVal);
HRESULT Resolution([in] RPtrResolution newVal);
};
Please tell me how it worked
JO
|
|
|
|
|
Hi all,
I am making auto installer of a list of softwares via CTreeItem. What I do is that to fill in the CTreeItems I get the items from the system registry which I can do successfully now what I need to do is to find out what is being highlighted from the Items at the press of my button then it will install that software from a specified source.
Any ideas on how it is being done?
thanks,
Jayjay
|
|
|
|
|
Hi all,
I am having this issue that when I create a treeviewlist it causes my main dialog to crash when I close it. Here is my code:
here is my class
#define DDX_CONTROL_IMPL(x) \
class x##_ddx : public CWindowImpl<x##_ddx, x> \
{ public: DECLARE_EMPTY_MSG_MAP() };
class CMainDlg : public CDialogImpl<CMainDlg>, public CUpdateUI<CMainDlg>,
public CWinDataExchange<CMainDlg>,public CCustomDraw<CMainDlg>,public CDialogResize<CMainDlg>
{
protected:
HKEY Regentry;
DWORD dwData, dwDisp;
CTreeViewCtrlExImpl UpdateList;
CButton Install;
void QueryProductTree();
public:
enum { IDD = IDD_MAINDLG };
BEGIN_MSG_MAP(CMainDlg)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
COMMAND_ID_HANDLER(IDC_PREF, OnPreference)
COMMAND_ID_HANDLER(IDC_INSTALL, OnInstall)
END_MSG_MAP()
BEGIN_DDX_MAP(CMainDlg)
DDX_CONTROL(IDC_INSTALLTREE, UpdateList)
END_DDX_MAP()
BEGIN_UPDATE_UI_MAP(CMainDlg)
END_UPDATE_UI_MAP()
BEGIN_DLGRESIZE_MAP(CMainDlg)
DLGRESIZE_CONTROL(IDC_INSTALLTREE, DLSZ_SIZE_X|DLSZ_SIZE_Y)
END_DLGRESIZE_MAP()
LRESULT OnInitDialog(UINT , WPARAM , LPARAM , BOOL& );
LRESULT OnCancel(WORD , WORD wID, HWND , BOOL& );
LRESULT OnPreference(WORD , WORD wID, HWND , BOOL& );
LRESULT OnInstall(WORD , WORD wID, HWND , BOOL& );
};
#endif
Then here is my main code
LRESULT CMainDlg::OnInitDialog(UINT , WPARAM , LPARAM , BOOL& )
{
CenterWindow();
HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDD_MAINDLG),
IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
SetIcon(hIcon, TRUE);
HICON hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDD_MAINDLG),
IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
SetIcon(hIconSmall, FALSE);
if (RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\Redmap Update Manager\\Parameters\\ManagePoint",
0, 0, REG_OPTION_NON_VOLATILE,
KEY_ALL_ACCESS, NULL, &Regentry, &dwDisp))
{
printf("Could not create the registry key.");
return 0;
}
dwData = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE |
EVENTLOG_INFORMATION_TYPE;
Install.Attach(GetDlgItem(IDC_INSTALL));
UpdateList.Attach(GetDlgItem(IDC_INSTALLTREE));
QueryProductTree();
return TRUE;
}
LRESULT CMainDlg::OnCancel(WORD , WORD wID, HWND , BOOL& )
{
RegCloseKey(Regentry);
Regentry = NULL;
delete Regentry;
if (this->m_hWnd != NULL)
EndDialog(wID);
return 0;
}
void CMainDlg::QueryProductTree()
{
CTreeItem mPoint, Rrite;
mPoint = UpdateList.InsertItem ( _T("ManagePoint"), TVI_ROOT, TVI_LAST );
mPoint.AddTail ( _T("ManagePoint 4.3.2.58"), 0 );
mPoint.AddTail ( _T("ManagePoint 4.3.2.83"), 0 );
Rrite = UpdateList.InsertItem ( _T("Re-Rite"), TVI_ROOT, TVI_LAST );
Rrite.AddTail ( _T("Re-Rite 6.1.0.11"), 0 );
Rrite.AddTail ( _T("Re-Rite 6.1.0.23"), 0 );
return;
}
Is there something I lack? Is there something I need to close?
Thanks,
Jayjay
|
|
|
|
|
I got it now I have to destroy the tree and give a value of NULL.
|
|
|
|
|
How can i get the look of satus bar as a installation form ( like we see in the installation of any component of MicroSoft progess bar). In the standerd my it is not looking good.
|
|
|
|
|
I want smooth XP type status bar, where as it seems to be WIN' 98 status bar. How can i do this.
|
|
|
|
|
Sounds like you need to set the PBS_SMOOTH[^] style for the progress bar
|
|
|
|
|
Style should be like XP, Not like Windows-98
|
|
|
|
|
Define what you mean by 'XP rather than Windows 98'...
If you mean using themed controls, then you need to add a manifest, as described here[^].
|
|
|
|
|
thanks for reply, can you tell me how to add manifest file in ATL project ( in Visual Studio 6.0)
|
|
|
|
|
This page[^] describes the process pretty well. Summarised, you do the following:
1. Add a file called 'MyApp.manifest' to your project. Put the following text into it, replacing the bits in italics with text that's appropriate for your application.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="your app's version"
processorArchitecture="X86"
name="your app's name"
type="win32"
/>
<description>A Description of your application</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
2. Add the following line to your project's resource file (the one with the .RC extension).
1 RT_MANIFEST "MyApp.manifest"
3. Rebuild your application
|
|
|
|
|
Hi all,
I've created simple ATLproject from VS2008 and added a simple object.
The object should return the map<> collection through interface method.
How can I do this?
Maybe I should use SAFEARRAY?
If it is possible please point me to the article about using this.
|
|
|
|
|
This question shows you don't understand COM properly: you can't return a std::map from a COM interface method.
Steve
|
|
|
|
|
To expand (slightly) on what Stephen's said - you can't return a std::map from a COM object. Instead, you would probably return an IEnumXXXX interface that allowed the user of your object to iterate over the map contents (see this article[^] for more details).
However, I would suggest you get comfortable with COM & ATL first before trying a more advanced topic like this
|
|
|
|
|
Thanks for help,
I found the following article on MSDN about collections
http://msdn.microsoft.com/en-us/library/3stwxh95(VS.71).aspx
and tried. All works fine.
|
|
|
|
|
How about returning the value as one of the out parameter...
|
|
|
|
|
|
Hi all,
How to I create a Check List Box? I need to create it without the column just a list of items. What do I need to create? What else should I know?
I tried this one but it is not exactly what I need
http://69.10.233.10/KB/wtl/wtl4mfc5.aspx[^]
Thanks,
Jayjay
|
|
|
|
|