|
Thank you so much guys! Works exactly like I wanted it to! The private struct technique is the easiest. Now i'm going to try the interface way.
Thanks again.
Really appreciated it!!
|
|
|
|
|
LONGLONG Date; //number of 100ns intervals since January 1st 1601 at * 00:00 UTC
How can i convert this to COleDateTime (or some other date structures)
I don't believe in failure. It is not failure if you enjoyed the process.
|
|
|
|
|
... FILETIME Structure Link[^]
I don't believe in failure. It is not failure if you enjoyed the process.
|
|
|
|
|
Hi to all,
in one of my applications ,i have to add a treeview to a combobox,
i searched a lot to find an article on this, but unable to find.
plz friends suggeswt me,or provide the url on how to add treeview to a combobox
thx in advance
Nagaraju
|
|
|
|
|
|
Hi..
I want to write a SMTP protocol using sockets....can any one suggest me.
Thanks
-murad
|
|
|
|
|
Abbas Murad wrote: I want to write a SMTP protocol using sockets....can any one suggest me.
Learn the Simple Mail Transfer Protocol[^] and implement it using sockets.
|
|
|
|
|
|
Hi,
I have a question regarding serial I/O.
...
I have been programming in MFC to interface Serial Ports
in Windows NT in order to read/write them in Overlapped as well as
in non-overlapped mode.
...
It worked fine all the time.
...
But I have a question regarding serial port.
...
That,
1) I open COM1 port in non-overlapped (Blocking I/O) mode
2) I Create a seprate thread, in which I attemp to read five Characters.
using "ReadFile" function.
3) Now, this function will not return unless I get all the five Characters
(As I have forced the "Read Timeouts" and "Write Timeouts" in
COMMTIMEOUTS structure to zeros)
4) But in case if I want to abort without further waiting for the arrival
of characters, I would have to abort the thread "Pre-matureally" ...
5) How can I do this, since the thread is simply blocked in waiting for
characters, as the "ReadFile" function has still not returned.
6) The application window closes, but the Thread keeps on running behind.
...
Basically I want my thread to terminate alongwith when application terminates.
But I dont get it through...
...
I will be very thankful for your assistance ...
...
|
|
|
|
|
There are only two ways for a call to ::ReadFile() on a serial device to return when opened in non-overlapped mode:
1. the device has received the number of bytes you wanted to read
2. there was a timeout due to the COMMTIMEOUTS settings, either there was too much time between two consecutive bytes or the whole operation took too much time to complete
There is no way to get passed this because this is how the system works.
It would be tempting to look at ::CancelIo(), but it can only be used in overlapped mode and by the thread that issued the read request.
--
Roger
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"No one remembers a coward!" - Jan Elfström 1998 "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above
|
|
|
|
|
Abruptly, you can call the TerminateThread from the main thread.
Or (better) you can handle all that stuff using OVERLAPPED I/O.
|
|
|
|
|
When I use Adobe PhotoShop's Crop Tool. It creates a subwindow helping me to select image scope. The subwindow attract me for its frame line looks moving. And I hope that there will be such a window in my application.
anyone can help me ?
|
|
|
|
|
when we use mouse to select some text on windows?
for example, we select some text in notepad application
i want to get the current selected text,
I does not want to simulate ctrl+c hotkey to copy data to clipboard(read data from clipboard),
i think this is very foolish,
I want to known whether some COM interface for us to use??? thanks again..
|
|
|
|
|
Not sure. But see if GetWindowText() is going to be of any use.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
|
MAINFRM
<br />
<br />
#include "stdafx.h"<br />
#include "Scribble.h"<br />
<br />
#include "MainFrm.h"<br />
<br />
#ifdef _DEBUG<br />
#define new DEBUG_NEW<br />
#undef THIS_FILE<br />
static char THIS_FILE[] = __FILE__;<br />
#endif<br />
<br />
<br />
IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)<br />
<br />
BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)<br />
ON_WM_CREATE()<br />
END_MESSAGE_MAP()<br />
<br />
static UINT indicators[] =<br />
{<br />
ID_SEPARATOR,
ID_INDICATOR_CAPS,<br />
ID_INDICATOR_NUM,<br />
ID_INDICATOR_SCRL,<br />
};<br />
<br />
<br />
CMainFrame::CMainFrame()<br />
{<br />
<br />
}<br />
<br />
CMainFrame::~CMainFrame()<br />
{<br />
}<br />
<br />
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)<br />
{<br />
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)<br />
return -1;<br />
<br />
if (!m_wndToolBar.Create(this) ||<br />
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))<br />
{<br />
TRACE0("Failed to create toolbar\n");<br />
return -1;
}<br />
<br />
if (!m_wndStatusBar.Create(this) ||<br />
!m_wndStatusBar.SetIndicators(indicators,<br />
sizeof(indicators)/sizeof(UINT)))<br />
{<br />
TRACE0("Failed to create status bar\n");<br />
return -1;
}<br />
<br />
m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |<br />
CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);<br />
<br />
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);<br />
EnableDocking(CBRS_ALIGN_ANY);<br />
DockControlBar(&m_wndToolBar);<br />
<br />
<br />
return 0;<br />
}<br />
<br />
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)<br />
{<br />
<br />
return CMDIFrameWnd::PreCreateWindow(cs);<br />
}<br />
<br />
<br />
#ifdef _DEBUG<br />
void CMainFrame::AssertValid() const<br />
{<br />
CMDIFrameWnd::AssertValid();<br />
}<br />
<br />
void CMainFrame::Dump(CDumpContext& dc) const<br />
{<br />
CMDIFrameWnd::Dump(dc);<br />
}<br />
<br />
#endif //_DEBUG<br />
<br />
<br />
<br />
class CMainFrame : public CMDIFrameWnd<br />
{<br />
DECLARE_DYNAMIC(CMainFrame)<br />
public:<br />
CMainFrame();<br />
<br />
public:<br />
<br />
public:<br />
<br />
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);<br />
<br />
public:<br />
virtual ~CMainFrame();<br />
#ifdef _DEBUG<br />
virtual void AssertValid() const;<br />
virtual void Dump(CDumpContext& dc) const;<br />
#endif<br />
<br />
protected:
CStatusBar m_wndStatusBar;<br />
CToolBar m_wndToolBar;<br />
<br />
protected:<br />
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);<br />
DECLARE_MESSAGE_MAP()<br />
};<br />
<br />
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Hi!!
I am using slider control in my application.
I set JPG image as background for my dialog using CXImage.
How Can I set transparent to slider control background.
Can anyone please give me the solution for this...
Thanks&Regards,
klvin
|
|
|
|
|
Can you try this ?
HBRUSH CMyDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if (CTLCOLOR_SCROLLBAR == nCtlColor)
{
pDC->SetBkMode(TRANSPARENT);
}
return hbr;
}
|
|
|
|
|
Hi !!
Thanks for the reply.
I tried with OnCtlColor(...)
But,It is not working.
klvin.
|
|
|
|
|
Why the constructor, destructor and copy constructor in c++ are not able to inherit by the derived class. And what else cannot be inherited from the derived class
|
|
|
|
|
Seems you are new to OOPs... stydy something(books, web page...) to know basic of OOP.
Do your Duty and Don't expect the Result
|
|
|
|
|
it;s no necessary...
|
|
|
|
|
Hi all.
I am using a Microsoft web browser to show the preview of web pages available in my application. This web browser is a part of a Modal Dialog box. I am loading those html pages from the specific location.
As this web browser control is a part of dialog box I can't make its size too big to show complete web page. As a result when I load the html page in it, the scroll bars appears for browser control.
What I want is to resize my html pages according to the size of the browser control so that user will not be required to scroll to have a complete view of the web page.
So how can I resize the html pages before loading them in the browser control?
OR
Is there any other way to do this?
Thanks
Rakesh Thakur
|
|
|
|
|
Rakesh_Thakur wrote: I am loading those html pages from the specific location
Since you are loading a page, i think its not possible to avoid the scroll bars. Other wise you modal dialog has to be resized.
(OR)
If you have the web page details as image file, you can resize the image.
Do your Duty and Don't expect the Result
|
|
|
|
|
Hi.
Can anyone give me a simple example of how to create an iterator for one of your own classes?
I have a binary Search Tree ADT (BST.cpp) that can insert, delete and traverse the binary search tree in sorted order.
The inorder traversal should use the operators from the STL bidirectional iterator.
My BST should provide appropriate, efficient iterators that can be given to any of the STL generic algorithms. My BST should look and feel like an object not just a wrapper around existing C code.
Any hints or small examples that can help me out, will be greatly appreciated.
Thanks.
|
|
|
|