|
Mmmhhh ... so i tried following, and that´s really weird :
dialog based mfc app have an extra code in OnPaint() to draw the icon in the task bar, and this has to work no matter whether there is a caption or there is no caption. So i put a breakpoint into the onpaint method, and discovered that ... the IsIconic() method does not respond properly (return FALSE even if the app is minimized)!!! So there must be another piece of code which draws icons in the task bar...
I´ve copied the code in a OnButton method (because without border there is no minimialize button, so i´ve created one), so that i have :
void CTestDlg::OnButton()
{
ShowWindow(SW_MINIMIZE);
WINDOWPLACEMENT* lpwndpl=new WINDOWPLACEMENT;
GetWindowPlacement(lpwndpl);
CPaintDC dc(this);
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
dc.DrawIcon(x, y, m_hIcon);
}
and here the GetClientRect(&rect); returns {0,0,0,0} !! So, I´m quite as lost as ViolaCase now . Can Someone explain how this minimize thing functions, and why the overrided OnPaint() method is not used ??
~RaGE();
|
|
|
|
|
why my comboboxex doesn't show tooltip with mouse over editctrl? (cursor is edit's)
all difference i see comparing to another functional example is i have comboboxex, OnToolHitTest fills still absolutely the same, in calling function gets to TTM_ACTIVATE and HWND_TOP but nothing happens
(i tried when is over edit return edit's or comboboex's id etc. but all failed)
all is fine when mouse is not over edit resp. when i open it without edit (CBS_DROPDOWNLIST only)
has someone this problem?
t!
|
|
|
|
|
I've been looking at Memory Leak detectors and I've found this one 'Memory Sleuth 3' by Turbo Power. You can get a trial version here ...
http://www.turbopower.com/trialrun
They say 'Trial-Run Editions of TurboPower products are fully-working versions of our software. The only restriction is that your compiler's IDE is running. In other words, you cannot deploy your applications with the Trial-Run Editions.'
This sounds pretty handy to me, am I missing the catch?
Just in case anyone missed me going on about Memory Detectors recently, I found this one called GlowCode which I realy like, and you can get a free time limited trial here ....
http://www.glowcode.com/update.htm
If you are looking for this kind of tool too, try them and let me know what you think, because I can't decided which to choose.
Ali
|
|
|
|
|
Have you looked at the one Software Verification advertise on CP ? I got a copy for winning the C# screensaver contest, and while I've not had a chance to look at it too deeply, I'm impressed with what I have seen. I believe Rama won one as well, and so did James, maybe ask them also.
I seem to recall you are in the UK, and they are too, so that's probably a plus as well, in terms of support.
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
Good idea, I'll give it a try.
Anyone else who might be interested the link is ....
http://www.softwareverify.com
(I've put that in because the advert is not always on screen.)
Ali
|
|
|
|
|
Have you tried Nu Mega's bounds checker?
I used a version on NT (a while ago). It worked quite well, however, it did not work too well when I was coding some low level RPC stuff.
Jeremy.
"Hey man, Taliban, Tali me Banana."
|
|
|
|
|
Hi,
I have seen some rulers designed by VC++, but is there a
ruler designed as a timecode (hour, minute, second and frame,
with 1 second = 30 frames)?
Did you have any purpose or ideas?
Thanks in advance!
chen
|
|
|
|
|
Couldn't you just take the code for an existing ruler, and modify it?
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Hi all,
I would like to copy a file from a remote machine.Since the machine is running on WINDOWS 2000.I have to connect it using account name & password.Can anyone tell me how can i provide account name and password through program?.
With regards.
Shibu K.V.
Senior Research Associate.
VLSI ASIC Hardware Design Group
Electronics R&D Centre,Trivandrum
India
|
|
|
|
|
Use 'WNetAddConnection2'.
|
|
|
|
|
Hello, folks,
I got some trouble using MFC CDialog class in my DLL (MFC static linked DLL).
Though my DLL is made MFC static linked, when I use MFC classes to create a dialog (pop-up or child), I always got a window creation error.
I know I can create dialog using win32 SDK (i.e, using CreateDialog(..) or DialogBoxParam(..), I did them before !), but I still want to use MFC to create my dialog. Because I also have something like CListCtrl or CListView on that dialog.
Could anybody help me ? Or I should use win32 SDK instead ?
And, are "list control" and "list view" same ?
Any response would be appreciated.
|
|
|
|
|
Yo Yo~~ wrote:
Though my DLL is made MFC static linked, when I use MFC classes to create a dialog (pop-up or child), I always got a window creation error.
Post your code, pls ... The code is more likely to be wrong than the MFC dll
~RaGE();
|
|
|
|
|
/// on MyGUIDlg.cpp; a dialog based application
void CGUIDlg::OnViewLog()
{
DWORD r = 0;
r = ViewLogFile( this->m_hWnd );
}
/// on MyDLL.cpp; a MFC static linked DLL
DLLExport DWORD WINAPI ViewLogFile( HWND hParendWnd )
{
CWnd* pParentWnd = new CWnd();
pParentWnd->Attach( hParendWnd );
CEventLogDlg* pLogDlg = new CEventLogDlg( pParentWnd );
if ( pLogDlg != NULL )
{
pLogDlg->Create( IDD_EVENT_LOG, pParentWnd );
///IDD_EVENT_LOG is resource ID
pLogDlg->ShowWindow( SW_SHOW );
}
}
/// class CEventLogDlg
class CEventLogDlg : public CDialog
{
........
}
|
|
|
|
|
There may be a confusion about the resource you try to load. Called from an application, your DLL will try to load application's resource.
To be sure what you are loading, try this:
In the dialog constructor:
CMyDlg::CMyDlg(CWnd* pParent /*=NULL*/) : CDialog(/*CMyDlg::IDD*/)
{
HINSTANCE hInstance = GetModuleHandle(_T("MyDLL"));
VERIFY(hInstance);
HRSRC hResource = ::FindResource(hInstance, MAKEINTRESOURCE(IDD_MYRESOURCE), RT_DIALOG);
VERIFY(hResource);
HGLOBAL hTemplate = LoadResource(hInstance, hResource);
VERIFY(hTemplate);
InitModalIndirect((HGLOBAL)hTemplate, pParent);
FreeResource(hTemplate);
}
We do not inherit the Earth from our ancestors. We borrow it from our children.
Antoine de Saint Exupéry (1900-1944)
|
|
|
|
|
I tried your suggestion, put that code in my dialog's constructor and compiled the dll. Then in my app, I added the dialog's *.h file, but when I tried to compile my app, I got and error about an undefined symbol in the dialog box's header file:
#ifdef _USRDLL
#define DllExport __declspec( dllexport )
#else
#define DllExport __declspec( dllimport )
#endif
class DllExport CMyDlg : public CDialog
{
// Construction
public:
enum { IDD = IDD_MYDIALOG_DIALOG };
I know that IDD_MYDIALOG_DIALOG is defined in the dll's resource.h file. Do I also have to include it in my app's *.cpp ?
|
|
|
|
|
Thanks ! It really helps.
I tried your codes and added something in my DLL as follows. Then it worked !
/// in MyDLL.cpp
CMyDlg* InitMyDialog( HWND hParent )
{
CMyDlg* pMyDlg = NULL;
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
pMyDlg = new CMyDlg( CWnd::FromHandle( hParent ) );
if ( pMyDlg != NULL )
pMyDlg->ShowWindow( SW_HIDE );
return pMyDlg;
}
|
|
|
|
|
Hello gurus.
I'm currently programming am application for windows 2000 (in Visual Studio C++ 6.0).
It's a program that creates LDIF files that will be used to update a LDAP entries. (openLDAP)
I've run into one problem tough. Is there a function/library in VSC++ that is similar to the unix crypt()? (using md5 or the ldap {crypt})
Yes, I'm a beginner, but I'm learning.
|
|
|
|
|
Franz Granlund wrote:
Hello gurus.
Hi there.
Franz Granlund wrote:
Is there a function/library in VSC++ that is similar to the unix crypt()?
Try to use CryptoAPI. Maybe you will find it too complex, but it should fulfil your requirements.
|
|
|
|
|
Thank you for your answer, but that is way to complex for me.. =)
Do you know of any other library? Or could you help me get started? It's such a small application, that I don't wan't to spend to much time figuring the crypto-world out. (Yes, I wan't to learn someday, but not today. )
|
|
|
|
|
I am not sure if using some library would be easier. Try to write short pseudocode, what you are doing in your UNIX code and I will reply with MS Crypto API version.
|
|
|
|
|
First, thank you very much for trying to help me out!
Well, I wan't a crypt() functionality of a linux system that uses PAM and MD5 password enabled. (The linux dist is Redhat 7.3)
A short code written and compiled under linux:
#include <crypt.h>
int main()
{
char p[100]; // Allocate this dynamically later..
char s[100];
char *e;
strcpy(p, "fan");
strcpy(s, "xe");
e = crypt(p, s);
printf("Password: %s\nEncrypted: %s\n",p, e);
return 0;
}
The output:
$ ./m
Password: fan
Encrypted: xeY7nbSvmz7jU
Hope you get some information from this code..
Again, thank you for trying to help.
|
|
|
|
|
Well, when it is Linux, you have to have sources for it, including crypt() function, have you tried to port to Win32? And, do you expect to get the same result (xeY7nbSvmz7jU), or you just do not care and encrypted password is enough for you (I mean, you do not require interoperability then between your new code on Windows and old code on Linux)?
|
|
|
|
|
try crypto++. i think there is a tutorial somewhere on this site for it.
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
Franz,
See this article.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Anyone have free HTML Syntax Hilighting Class (MFC or ATL)? I found one at CP, but its not the best implementation...
Thank you!
|
|
|
|