|
Handle the TTN_NEEDTEXT notification in your CMainFrame class (you have to add it manually, not from ClassWizard). Inside the notification function, you can check what the ID of the item is, and if it's your special toolbar button, you can specify your own text to be displayed. I can set up a small demo if you want.
Chris Richardson
C/C++ Include Finder[^]
|
|
|
|
|
Thank you very, very much. You have just saved an entire day of screwing around. This is exactly what I needed.
|
|
|
|
|
|
Hi,
Does somebody know a secure solution to ensure that the DLL an application
is talking to hasn't been replaced with a fake one?
I am thinking about implementing a "handshaking" procedure. With this
method, the application sends a "challenge" random message to the DLL. The DLL responds with a value calculated using a one-way hash function. The application checks the response against its own calculation of the expected hash value. If the values match, the authentication is acknowledged; otherwise the application is terminated.
Do you know other/better solutions?
Remark: I am developing both the application part and the DLL part.
Thanks.
antoine
|
|
|
|
|
antoine_boillier wrote:
The DLL responds with a value calculated using a one-way hash function. The application checks the response against its own calculation of the expected hash value.
the cracker finds this one-way hash function in the DLL and implements it in his own DLL.
it's a tough problem.
-c
Be very, very careful what you put into that head, because you will never, ever get it out. --Thomas Cardinal Wolsey
|
|
|
|
|
This is usually done by cryptographically signing the dll. This too is not fool-proof.
|
|
|
|
|
I have a property sheet that contains 5 property pages. One of my pages (let’s call it the summary page for this discussion) is not initially visible, and contains a list control that keeps track of all interaction with the other pages. When I first run the program, I can’t write anything to the summary page until I select the summary tab. I believe it’s because the OnInitDialog member function hasn’t been called for the summary page, until it’s displayed for the first time. Unfortunately, I configure my list control (set up headings) in the OnInitDialog member function of the summary page, and until I do, I can’t use it!
Is there something I can do to force all property pages to “initialize” prior to being displayed for the first time
I’ll keep searching for the answer myself, but I find that someone usually posts the answer before I find it!
Thanks
|
|
|
|
|
work_to_live wrote:
Is there something I can do to force all property pages to “initialize” prior to being displayed for the first time
You can do this on a page-by-page basis. Add the PSP_PREMATURE style to the PROPSHEETPAGE struct for each page you want created right away.
--Mike--
The Internet is a place where absolutely nothing happens.
-- Strong Bad
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
Hi! I'm a sig virus. Attach me to the end of your sig to help me take over the world!
|
|
|
|
|
That sounded like it would work, but here's what happened...
I'm using MFC (may be the problem), CPropertySheet and CPropertyPage.
Here's how I modified the style...
m_cResultsPage.ModifyStyle(0,PSP_PREMATURE);
Then I added all the pages...
m_cSheet.AddPage(&m_cConfigPage);
m_cSheet.AddPage(&m_cCommandPage);
m_cSheet.AddPage(&m_cMeasurePage);
m_cSheet.AddPage(&m_cAlarmsPage);
m_cSheet.AddPage(&m_cIdentPage);
m_cSheet.AddPage(&m_cResultsPage); // This is my summary page
m_cSheet.Create(this, WS_CHILD | WS_VISIBLE, 0);
But I failed the debug assertion in ModifyStyle!...
BOOL CWnd::ModifyStyle(DWORD dwRemove, DWORD dwAdd, UINT nFlags)
{
ASSERT(::IsWindow(m_hWnd));
if (m_pCtrlSite == NULL)
return ModifyStyle(m_hWnd, dwRemove, dwAdd, nFlags);
else
return m_pCtrlSite->ModifyStyle(dwRemove, dwAdd, nFlags);
}
Still searching...
|
|
|
|
|
As soon as I hit the submit button, I realized what I had done wrong. I had to directly manipulate the prop sheet structure as follows...
m_cResultsPage.m_psp.dwFlags |= PSP_PREMATURE;
Then it worked!
Thanks
|
|
|
|
|
work_to_live wrote:
I had to directly manipulate the prop sheet structure as follows...
That's it
--Mike--
The Internet is a place where absolutely nothing happens.
-- Strong Bad
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
Hi! I'm a sig virus. Attach me to the end of your sig to help me take over the world!
|
|
|
|
|
Consider ShowWindow().
Kuphryn
|
|
|
|
|
I don't want to display, or flash the page. I want to be able to use the controls before it's selected for the first time.
|
|
|
|
|
Is it possible to add a bitmap as a "top-level" menu item in a window's menu bar? I understand you can use bitmaps in submenus as owner-draw type menus, but I'm having trouble adding a bitmap to the toplevel menu. Any help would be much appreciated
Thanks,
Ben
|
|
|
|
|
You could just make the top section of your application have the bitmap menu bar displayed and when a user clicks on one of the sections pop up a context menu.
|
|
|
|
|
I recently upgraded my system from win98 to win2k (I know I'm a little behind on OS's) and I reinstalled VC++ 6.0 and when I compile a program that compiled perfectly under win98 it gives me these linker errors:
ShellTree.obj : error LNK2001: unresolved external symbol "public: struct _ITEMIDLIST * __thiscall CShellPidl::CopyITEMID(struct IMalloc *,struct _ITEMIDLIST *)" (?CopyITEMID@CShellPidl@@QAEPAU_ITEMIDLIST@@PAUIMalloc@@PAU2@@Z)<br />
ShellTree.obj : error LNK2001: unresolved external symbol "public: struct _ITEMIDLIST * __thiscall CShellPidl::ConcatPidls(struct _ITEMIDLIST const *,struct _ITEMIDLIST const *)" (?ConcatPidls@CShellPidl@@QAEPAU_ITEMIDLIST@@PBU2@0@Z)<br />
ShellTree.obj : error LNK2001: unresolved external symbol "public: int __thiscall CShellPidl::GetName(struct IShellFolder *,struct _ITEMIDLIST *,unsigned long,char *)" (?GetName@CShellPidl@@QAEHPAUIShellFolder@@PAU_ITEMIDLIST@@KPAD@Z)<br />
ShellTree.obj : error LNK2001: unresolved external symbol "public: int __thiscall CShellPidl::GetItemIcon(struct _ITEMIDLIST *,unsigned int)" (?GetItemIcon@CShellPidl@@QAEHPAU_ITEMIDLIST@@I@Z)<br />
ShellTree.obj : error LNK2001: unresolved external symbol "public: int __thiscall CShellPidl::DoTheMenuThing(struct HWND__ *,struct IShellFolder *,struct _ITEMIDLIST *,struct tagPOINT *)" (?DoTheMenuThing@CShellPidl@@QAEHPAUHWND__@@PAUIShellFolder@@<br />
PAU_ITEMIDLIST@@PAUtagPOINT@@@Z)<br />
ShellTree.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall CFileName::~CFileName(void)" (??1CFileName@@UAE@XZ)<br />
ShellTree.obj : error LNK2001: unresolved external symbol "public: bool __thiscall CFileName::Exist(void)" (?Exist@CFileName@@QAE_NXZ)<br />
ShellTree.obj : error LNK2001: unresolved external symbol "public: __thiscall CFileName::CFileName(class CString)" (??0CFileName@@QAE@VCString@@@Z)<br />
Release/autorun.exe : fatal error LNK1120: 8 unresolved externals<br />
Error executing link.exe.
Is there a quick fix to make thiese errors go away, or will I have to rewrite the program?
|
|
|
|
|
Have you tried cleaning everything and doing a complete rebuild?
You can pick your friends, and you can pick your nose, but you can't pick your friend's nose.
|
|
|
|
|
I'm not sure what you mean by cleaning everything.
have "rebuilt all"
thanks.
|
|
|
|
|
I'm such a dolt. It didn't work because two of my modules weren't included in the project. duh. I feel so stupid.
|
|
|
|
|
Hey everyone!
I'm currently working on my C++ Win32 API wrapper class. There are certain things I have to take care of myself (even though in many cases I'm pretty unsure why after all), like proper sizing of the statusbar. I have a class for the statusbar, and it installs a hook into the WM_SIZE message so it resizes itself once the parent window receives a WM_SIZE message. I didn't get SetWindowPos to work in the sizing handler of the Statusbar, so I use ResizeWindow (Don't have it hand right now, but I think that was the function). Now, if I have another control in the window and parts of that control hide under the status bar, that works fine. But once I click on (or even move over) that control, it paints the hidden parts of itself over the statsbar - NOT good-looking! So, my question is, what do I need to do to prevent the status bar from being drawn over? Are there any flags I have to set during initialization? Or is there anything special I have to consider for the child controls? Any help would be greatly appreciated!
tilli
|
|
|
|
|
I would like to assign the context sensitive help ID for a given CWnd. My CWnd has a CScrollView as its parent. Any ideas would be appreciated.
Chad Scates
|
|
|
|
|
You should be able to adapt code from my article which does this for a CFormView which inherits from CScrollView.
http://www.codeproject.com/winhelp/ContextHelp.asp[^]
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
Not exactly what I needed, but pretty close. Five minutes of tweaking with the use of that article and I was done. Thanks!
|
|
|
|
|
Hi, I'm using the following function to send an email from my VC++ 6 application:
_________________
BOOL CEasyUpdateDlg::SendMail(CHAR *lpszFrom, CHAR *lpszTo, CHAR *lpszSubject, CHAR *lpszMessage)<br />
{<br />
BOOL bSent = FALSE;<br />
HINSTANCE hMAPI = ::LoadLibrary(_T("mapi32.dll"));<br />
if(0==hMAPI) <br />
return bSent;<br />
typedef ULONG (FAR PASCAL *PFN_MAPILogon)(ULONG,LPTSTR,LPTSTR,FLAGS,ULONG,LPLHANDLE); <br />
typedef ULONG (FAR PASCAL *PFN_MAPISendMail)(LHANDLE,ULONG,lpMapiMessage,FLAGS,ULONG); <br />
typedef ULONG (FAR PASCAL *PFN_MAPILogoff)(LHANDLE,ULONG,FLAGS,ULONG); <br />
PFN_MAPILogon MAPILogon = (PFN_MAPILogon)::GetProcAddress(hMAPI,"MAPILogon");<br />
PFN_MAPISendMail MAPISendMail = (PFN_MAPISendMail)::GetProcAddress(hMAPI,"MAPISendMail"); <br />
PFN_MAPILogoff MAPILogoff = (PFN_MAPILogoff)::GetProcAddress(hMAPI,"MAPILogoff");<br />
if((0!=MAPILogon)&&(0!=MAPISendMail)&&(0!=MAPILogoff)) <br />
{ <br />
LHANDLE session = 0; <br />
VERIFY(SUCCESS_SUCCESS==MAPILogon(0,0,0,MAPI_NEW_SESSION,0,&session)); <br />
ASSERT(0!=session); <br />
MapiRecipDesc recipient; <br />
::ZeroMemory(&recipient,sizeof(recipient)); <br />
recipient.ulRecipClass = MAPI_TO; <br />
recipient.lpszName = lpszTo; <br />
MapiMessage message; <br />
::ZeroMemory(&message,sizeof(message)); <br />
message.lpszSubject = lpszSubject; <br />
message.lpszNoteText = lpszMessage; <br />
message.nRecipCount = 1; <br />
message.lpRecips = &recipient; <br />
bSent = SUCCESS_SUCCESS == MAPISendMail(session,0,&message,0,0);<br />
} <br />
::FreeLibrary(hMAPI); <br />
return bSent;<br />
<br />
}
_________________
I have found that when I try to send a mail using:
CHAR *lpszTo="whoever@whatever.com" it works great,
but if I do:
CHAR *lpszTo="person1@whatever.com; person2@whatever.com"
no emails are send.
How can I use it to send a mail to several people, not just one recipient?
Thanks so much!
F
|
|
|
|
|
You need to have one MapiRecipDesc for each address you are sending the email to. So in your SendMail function, break up the lpszTo into multiple strings, allocate a MapiRecipDesc array that can hold the required number of items, then have a loop that fills in each MapiRecipDesc in the array. Now, make message.nRecipCount have the correct number instead of 1, and make message.lpRecips point to the MapiRecipDesc array that you allocated. Don't forget to delete the MapiRecipDesc array when you're done.
Chris Richardson
C/C++ Include Finder[^]
|
|
|
|
|