|
Wow, please keep me in mind when you release this. My Email is darrollwalsh@hotmail.com. Send me a copy when you post it. I was only keeping it simple because of my lack of knowlade in using plugins. I think I will be able to expand my app when you let this baby out. Just add how to add it to an existing DLG app. Thatnk in advance.
Darroll
Not one person lives in the present. Only the past. I can prove it.
|
|
|
|
|
i've put an HWND created by IShellView:CreateViewWindow in a CView. when i resize the window, the display is broken, especially when i set the view to DETAILS, and resize the windows horizontally : the display of the right-hand scrollbar is broken.
you can easily try it by creating an MFC appwizard project, SDI, and use CHtmlView as base class for the view class. in the view .cpp file, change the line :
Navigate2(_T("http://www.microsoft.com/visualc/"),NULL,NULL);
to :
Navigate2(_T("c:\\"),NULL,NULL);
you won't even have to set to DETAILS mode, just resize the window horizontally and you'll see right-hand scrollbar won't be displayed correctly.
how to correct this ? (no one will have the answer i'll bet)
|
|
|
|
|
I've had a similar problem with another activeX control, the scrolbar disapears when you resize.
I added
::RedrawWindow('HWND OF YOUR WINDOW',NULL,NULL,RDW_FRAME |RDW_ERASE|RDW_INVALIDATE|RDW_ALLCHILDREN );
After the MoveWindow function, it seemed to get it alright.
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
thank you very much.
i've also added your line in the OnDraw function because i also got the problem when the application starts...
|
|
|
|
|
Anyone has any idea how to initialize a listbox with file names matching a given criterion? I'd like the listbox to display all .txt files in a directory. Thanks,
Ralf.
ralf.riedel@usm.edu
|
|
|
|
|
|
Because it doesnt work! I am suspecting that maybe I dont have the right parent for a control on a CFormView form.
THe SendMessage API is being called with handles obtained from:
CMDIFrameWnd *pFrame =
(CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
CMDIChildWnd *pChild =
(CMDIChildWnd *) pFrame->GetActiveFrame();
CProgressBarCZipView *pView = (CProgressBarCZipView *) pChild->GetActiveView();
long parentHandle = (long)pView->GetSafeHwnd();
CButton *pBar = (CButton*)GetDlgItem(IDC_BUTTON3);
long hPbHandle = (long)pBar->GetSafeHwnd();
_CllRemoteCall p;
p.CreateDispatch("DllwithForm.Class1");
p.TestButton(hPbHandle,parentHandle);
This call suposedly causes the SendMessage to execute (or not !)
SendMessage(parentHAndle, WM_COMMAND, 0, buttonHandle)
but I'm still doing something wrong.
Any ideas ?
Thanks,
ns
|
|
|
|
|
wParam (3rd arg) in SendMessage call should be the button ID, not the button handle. It should look more or less like this:
SendMessage(parentHandle, WM_COMMAND, IDC_BUTTON3, 0);
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
It didnt like the ordering of the parameters and crashed. I found from MSDN:
WM_COMMAND
The WM_COMMAND message is sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated.
A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd,
WM_COMMAND,
WPARAM wParam,
LPARAM lParam
);
so I did
SendMessage(parentHAndle, WM_COMMAND, 0, buttonHandle)
Doesnt crash now, but alas my poor lowly button remains untriggered(I havent graduated to your idea of custom messages yet )
I fear its maybe time to look into shared memory, which is not going to be easy.
If only the sendmessage worked...BTW I also tried sending in the ID of the button instead of the handle so that the SendMessage could use it, but still not.
You have really put a lot of time into my problem and I want to say that I appreciate it very much.
Thanks,
ns
|
|
|
|
|
Try with both ID and handle:
SendMessage(parentHandle, WM_COMMAND, ID_BUTTON, buttonHandle);
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
That made it very unhappy....crashed grandly.
Thanks,
ns
|
|
|
|
|
Try this:
<br />
SendMessage(parentHandle, WM_COMMAND, MAKELONG( IDC_BUTTON3, BN_CLICKED ), buttonHandle );<br />
Chris Richardson
|
|
|
|
|
Does anyone here have an example of a User Interface library for AD Schema modifications?
I am working on some additional attributes for a user and need to place a new tab in the properties window (like Exchange does) so the admin has a way to set the properties.
|
|
|
|
|
I am trying to get to get a tree conrol to place the text that it selects at the very top of its corresponding view. I have tried the following code (as is, and with adding/subtracting a value to it) and the result is always that the highlighted text is 1 line above the visible line. Without the LineScroll code, then the selection (highlight) may/may not appear within the visible view, depending upon the direction of the next line.
sSecondPart = sItemData.Right(sItemData.GetLength()-sFirstPart.GetLength());
CMainFrame* pMDIFrame = (CMainFrame*)AfxGetMainWnd();
ASSERT(pMDIFrame);
CChildFrame* pMDIChild = (CChildFrame*)pMDIFrame->MDIGetActive();
ASSERT(pMDIChild);
CEJOrganizerView* pView = (CEJOrganizerView*) pMDIChild->m_wndSplitter.GetPane(0,1);
CRichEditCtrl& rCtrl = pView->GetRichEditCtrl();
int iStart = rCtrl.LineIndex(atoi(sSecondPart));
int iEnd = rCtrl.LineIndex(atoi(sSecondPart)+1);
int iFirstVisible = rCtrl.GetFirstVisibleLine();
// This doesn't work as intended,
rCtrl.LineScroll(rCtrl.LineIndex(atoi(sSecondPart)) - iFirstVisible,0);
rCtrl.SetSel(iStart,iEnd);
if I use: rCtrl.LineScroll(-iFirstVisible,0) then the selected text is always in view, but it is always toward the bottom of the view.
Thanks
Wade Holt
|
|
|
|
|
Ok, so how do I get from:
double x = .0625;
CString s;
s.Format("???",x);
so that s looks like: 6.25000000000000000E-02
Nitron
_________________________________________--
message sent on 100% recycled electrons.
|
|
|
|
|
s.Format("%.16E",x) - i think...
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
|
Try this:
double fp = .0625;<br />
CString s;<br />
s.Format( "%e", fp );
// Fazlul
Get RadVC today! Play RAD in VC++
http://www.capitolsoft.com
|
|
|
|
|
Nitron wrote:
so that s looks like: 6.25000000000000000E-02
This should do it:
s.Format(_T("%.15e\n"), x);
Nick Parker
The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown
|
|
|
|
|
Nitron
_________________________________________--
message sent on 100% recycled electrons.
|
|
|
|
|
CProgressBarCZipView *pView = (CProgressBarCZipView *) pChild->GetActiveView();
long hPbHandle = (long)pView->GetSafeHwnd();
CButton *pBar = (CButton*)GetDlgItem(IDC_BUTTON3);
long hPbHandle = (long)pBar->GetSafeHwnd();
Thanks,
ns
|
|
|
|
|
Yes, except that you mistakenly (typo) overwrote hPbHandle .
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
What is the best way to set up a timer for a process that will take an hour or two?
_____________________
"So in the interests of survival, they trained themselves to be agreeing machines instead of thinking machines. All their minds had to do was to discover what other people were thinking, and then they thought that, too."
Breakfast of Champions, Kurt Vonnegut
|
|
|
|
|
By 'process' you mean Windows process which has some timeout period in your case? Or some general activity?
You have number of options - classic Window timers, waitable timers, WaitForXXX APIs.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
The user sets the timeout period.
_____________________
"So in the interests of survival, they trained themselves to be agreeing machines instead of thinking machines. All their minds had to do was to discover what other people were thinking, and then they thought that, too."
Breakfast of Champions, Kurt Vonnegut
|
|
|
|