|
Toni78 wrote:
I guess I will have to postpone my BIOS reading project, until I develop some skills in VxD.
I was just saying that a VXD will only work in windows 9X.
John
|
|
|
|
|
Hi!
I've got trouble when I try to use another Mailing Program than Outlook or Outlook Express (i.e. Incredimail, ...).
I'm using the Win32 API's functions (MAPISendMail, MAPISendDocument).
The message field is not the one I expect, and I can't attach any files. Incredimail adds "--------------Boundary-00=_U8SLQL80000000000000
Content-Type: Text/Plain
Content-Transfer-Encoding: " in the message field before my text.
Does anyone know how to fix these issues, or have another solution to send mails using Visual C++ 6?
Thks in advance!
Appstmd
http://www.appstmd.com
|
|
|
|
|
I have opened from my program IE6
How tu send message and press button eg. text in "search"and press "Go"
thanks
|
|
|
|
|
Use Spy++ to get the handle of the "Go" button. Get the parent of button and use SendMessage(parent_wnd_of_go_button, WM_COMMAND, 0, id_of_Go_button);
I think it would work... hope....
Rickard Andersson8
Here is my card, contact me later!
UIN: 50302279
E-Mail: nikado@pc.nu
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
Rather than manipulate IE with simulated keystrokes and such, why not just use IE Automation. You get way more functionality.
|
|
|
|
|
Hi,
I am trying desperately to print a report in Landscape
Mode with VC++, but even I try with "hDevMode" ... it
still always print in Portrait Mode:
<br />
CPrintDialog printDlg(FALSE, PD_RETURNDEFAULT | PD_RETURNDC);<br />
<br />
if (printDlg.DoModal() == IDCANCEL) return; <br />
<br />
<br />
HGLOBAL m_hDevMode;<br />
HGLOBAL m_hDevNames;<br />
<br />
PRINTDLG pd;<br />
pd.lStructSize = (DWORD) sizeof(PRINTDLG);<br />
<br />
DEVMODE FAR* pDevMode =<br />
(DEVMODE FAR*)::GlobalLock(m_hDevMode);<br />
LPDEVNAMES lpDevNames;<br />
LPTSTR lpszDriverName, lpszDeviceName, lpszPortName;<br />
HANDLE hPrinter;<br />
<br />
if (pDevMode) <br />
{<br />
pDevMode->dmOrientation = DMORIENT_LANDSCAPE;<br />
<br />
lpDevNames = (LPDEVNAMES)GlobalLock(pd.hDevNames);<br />
lpszDriverName = (LPTSTR )lpDevNames + lpDevNames->wDriverOffset;<br />
lpszDeviceName = (LPTSTR )lpDevNames + lpDevNames->wDeviceOffset;<br />
lpszPortName = (LPTSTR )lpDevNames + lpDevNames->wOutputOffset;<br />
<br />
::OpenPrinter(lpszDeviceName, &hPrinter, NULL);<br />
::DocumentProperties(NULL,hPrinter,lpszDeviceName,pDevMode,<br />
<br />
pDevMode, DM_IN_BUFFER|DM_OUT_BUFFER);<br />
<br />
::ClosePrinter(hPrinter);<br />
::GlobalUnlock(m_hDevNames);<br />
::GlobalUnlock(m_hDevMode);<br />
}<br />
<br />
<br />
CDC dc;<br />
CPrintInfo Info;<br />
CFont oFont;<br />
<br />
dc.Attach(printDlg.GetPrinterDC()); <br />
dc.SaveDC(); <br />
dc.m_bPrinting = TRUE;<br />
<br />
CString strTitle; <br />
strTitle.LoadString(AFX_IDS_APP_TITLE);<br />
<br />
DOCINFO di; <br />
::ZeroMemory (&di, sizeof (DOCINFO));<br />
di.cbSize = sizeof (DOCINFO);<br />
di.lpszDocName = strTitle;<br />
<br />
BOOL bPrintingOK = dc.StartDoc(&di); <br />
....................................<br />
....................................<br />
Can any one know why? To show you my problem I can
send "my small project" if you provide me your Email
address
I appreciate a lot anyone try to help me here
Thanks
|
|
|
|
|
From MSDN:
<big>CWinApp::GetPrinterDeviceDefaults
BOOL GetPrinterDeviceDefaults( PRINTDLG* pPrintDlg );</big>
<br>
Example<br>
void CMyApp::SetLandscapeMode()
{
PRINTDLG pd;
pd.lStructSize=(DWORD)sizeof(PRINTDLG);
BOOL bRet=GetPrinterDeviceDefaults(&pd);
if(bRet)
{
DEVMODE FAR *pDevMode=(DEVMODE FAR *)::GlobalLock(m_hDevMode);
pDevMode->dmOrientation=DMORIENT_LANDSCAPE;
::GlobalUnlock(m_hDevMode);
}
}
Give it a try...
Paolo
------
Why spend 2 minutes doing it by hand when you can spend all night plus most of the following day writing a system to do it for you? - (Chris Maunder)
|
|
|
|
|
Hi Paolo,
Thank you for your tip, I did try but when it comesto :
<br />
pDevMode->dmOrientation=DMORIENT_LANDSCAPE;<br />
a) I had an Error & could not continue! I attach my small project
PrintLandscape.zip & did send to you ... so that you can see the problem!
b) When I ran debugging until this ,I recognized that pDevMode equals
Zero's ... might be I did not initiallize right?
Can you help a bit more?
Many thanks
|
|
|
|
|
Hi,
I didn't get your attachment yet, but are you sure to call CWinApp::SelectPrinter after showing the dialog box?
Paolo
------
Why spend 2 minutes doing it by hand when you can spend all night plus most of the following day writing a system to do it for you? - (Chris Maunder)
|
|
|
|
|
Hi Paolo,
I did reply but with error return! I have just sent to you another one (my small project) with your true Email address. Would you please take a look.
Many thanks,
ATC
|
|
|
|
|
|
Hi Bart,
Thank for the offer, I did send ny project to your Email address! Hopefully, you can help me! I have been stuck for this problem very long time! I really appreciate any help from anyone.
Many thanks & Happy Eastern,
Anh
|
|
|
|
|
Hi Paolo,
What should I say ... THANK YOU VERY VERY MUCH! I just did as you suggested: CWinApp::CreatePrinterDC (after seting pDevMode) & now I can print in Landscape even the Control Panel was set with Portrait
I am really appreciate a lot what you have tried to help me! I am sorry about asking you spent a lot of time to solve my problem ... but you do not know how I happy I am now ... because of your help!
Thanks again Paolo & please forgive me if I make you frustrated!
Sincerely yours,
Anh
|
|
|
|
|
Hiya,
I have a CSplitterWndEx class derived from CSplitterWnd. I have these two functions to only allow the user to move the bar so that the right pane is between 100 & 200 px wide. I have a variable called m_ULWidth in the CMainFrame class, which stores the width of the pane. It works fine, except for two things...
1) When I minimize and restore the app, the width of the pane reverts back to 150 px (what I initialized it to in the constructor)
2) If I keep clicking and dragging the splitter towards the right, it will still move a few pixels to the right each time even though the pane is at 100 pixels wide.
int CSplitterWndEx::GetSplitterWidth(void)<br />
{<br />
return m_cxSplitterGap + (m_cxBorder * 2);<br />
}
void CSplitterWndEx::OnMouseMove(UINT nFlags, CPoint point)<br />
{<br />
CRect rect;<br />
this->GetParentFrame()->GetWindowRect(rect);<br />
ScreenToClient(rect);<br />
<br />
if (point.x > (rect.right - 200) && point.x < (rect.right - 100)) <br />
CSplitterWnd::OnMouseMove(nFlags, point);<br />
}
void CMainFrame::OnSizing(UINT fwSide, LPRECT pRect)<br />
{<br />
<br />
CFrameWnd::OnSizing(fwSide, pRect);<br />
CRect rect;<br />
int width, ideal;<br />
m_wndSplitterLR.GetColumnInfo(1,width, ideal);<br />
m_ULWidth = width;<br />
}
void CMainFrame::OnSize(UINT nType, int cx, int cy)<br />
{<br />
CFrameWnd::OnSize(nType, cx, cy);<br />
<br />
if(m_ULWidth < 100)<br />
m_ULWidth = 100;<br />
if(m_ULWidth > 200)<br />
m_ULWidth = 200;<br />
<br />
if ( m_bInitSplitter && nType != SIZE_MINIMIZED )<br />
{<br />
m_wndSplitterLR.SetColumnInfo( 0, cx - m_ULWidth - m_wndSplitterLR.GetSplitterWidth(), 100);<br />
m_wndSplitterLR.SetColumnInfo( 1, m_ULWidth, 75);<br />
m_wndSplitterLR.RecalcLayout();<br />
<br />
}
Any suggestions?
Shutter
|
|
|
|
|
Hi, everyone!
When using pointers, we often meet with such troubles,
one problem is the ownership - who (which function)
is responsible for deleting the pointer? Another problem is
there's no standard way that you can tell if a pointer points
to the heap or to the stack. If it's to the heap, then
you can delete it; if it points to the stack, then you'd better
not use delete on the pointer.
I have searched some materials on the problem. One solution others
suggested is using const pointer (for example, int * const). But I do
not understand why it can resolve the trouble. (Other solutions include
smart pointers and reference.)
Can anyone show me an example?
Thanks in advance,
George
|
|
|
|
|
I think this is more of an academic discussion than something you will do in your profession. In the last 6 years I have written 300 thousand lines of code and I have never for a minute thought about any of this discussion. If a function is passed a pointer 99.99% of the time the function should not delete it. If a function returns a pointer the documentation should describe how to delete it. There is more than just on the stack or heap. You can allocate memory with new, malloc, through COM or one of the VirtualAlloc functions. Deleting it with the wrong one will lead to problems.
John
|
|
|
|
|
Thanks, John buddy!
George
|
|
|
|
|
I remember reading in Scott Meyers' book More Effective C++ that it's basically impossible to tell from just a pointer whether it points into the heap or elsewhere. And on deciding who deletes the pointer, this can probably best be achieved with comments. I do not see how const pointer would help.
|
|
|
|
|
Thanks, Philnessosity buddy!
George
|
|
|
|
|
I open a Modeless dialog. But this dialog is always on top over my Main App. I want to be able to go back to my main app with the dialog in the back. How can I do that?
I also want the dialog to get its own button on the taskbar. I have done that before but can’t figure out how I did that.
I do get both of these behaviors if I show the dialog from it’s own gui thread. But I was hopping to avoid that
/Mathias
|
|
|
|
|
|
Create the dialog with a parent of NULL to let it go under your app, and add the WS_EX_APPWINDOW extended style to give it a taskbar button.
--Mike--
Yeah, payin' the bills with my mad programming skillz.
Defraggin' my hard drive for thrills.
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
Hi:
I have recently created a "Win32 Application" project or, more accurately "A Simple Win32 Application".
but i need to use a Worker-Thread in this app so i useed
AfxBeginThread()function,but when i want to compile project,i receive the following error:
error C2065: 'AfxBeginThread' : undeclared identifier
Is it possible to use this function in Win32 Application ?
Please Help me.
Best Regards.
|
|
|
|
|
Nope. AfxBeginThread is declared in afxwin.h , which is a part of MFC framework.
In Win32 apps, use _beginthread instead.
Regards,
BB
|
|
|
|
|
Win32 apps should use _beginthreadex , not _beginthread.
|
|
|
|