|
The mouse message is going to the window that the cursor is over, since that's the window being acted on. So when you click the button, the button gets the message, not the button's parent. You'll need to subclass the button and handle WM_LBUTTONDOWN in your subclass.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
There is a saying in statistics that a million monkeys pounding on typewriters would eventually create a work of Shakespeare. Thanks to the Internet, we now know that this is not true.
|
|
|
|
|
Hi all,
I need to submit a HTML form via a SOCKET that is connected to an http server, more clearly, I want the http commands (GET/POST) that can imitiate sending HTML forms.
for example i have the folowing html form:
How can I send this form via a SOCKET that is connected to the HTTP server port 80?
any really good HTTP command reference? any good code about POSTING? anyone can solve the problem specifically for the above example??
Thanx in advance
Mohammad Gdeisat
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
have u tried theCInternetConnection class
&
CHttpConnection
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
use CHttpConnection to communicate with HTTP server.this will make a socket connection with ur http server
|
|
|
|
|
Mohammad, see this[^] article. If you also want to extract information from the downloaded HTML, see this[^] article.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
|
Hi,I wanna to develop a software with two network cards(Ethernet NIC).I hope I can select one of them to send and receive data with Udp protocol.Can i?Waiting for you answer.Thank you very much in advance.
|
|
|
|
|
I'm studying about Programming Add-in for MS Outlook, but have no documents about it. Can you send me a tutorial about it?
My email is cuong197@yahoo.com
Thank you very much!!
|
|
|
|
|
Hi,
I wrote a program in Visual Studio 2005b2 (Winforms), but include many of my image processing algoritms written in unmanaged c++. These functions use SSE2, and array manipulations. However, compiling my new program (.Net) resulted in very poor performance, where the execution is so slow, compared to the same code when compiled in MFC. Why is that? I'm aware that .Net compiler generates MSIL, and it is compiled to native code on the fly during execution. Most articles online says that .Net code is slightly slower than pure code, but eventually the performance difference is too small to be noticed. In my case, the performance difference is big, and the program executes horribly! Am i doing something wrong? I thought my unmanaged code will be compiled as native code, while the others will be compiled as MSIL resulting in a mixed assembly, thereby maintaining my performance, but this is not the case. Any ideas?
Also, i used #pragma unmanaged.
Thanks,
|
|
|
|
|
uus99 wrote: Most articles online says that .Net code is slightly slower than pure code, but eventually the performance difference is too small to be noticed.
I am afraid you are just another victim of the propaganda, my friend. .NET is slow - period.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
What's the fastest thread-safe logging library for C++?
1)log4cpp - Is it thread safe?
2)log4cxx - Still trying to understand its basic codes.
3)log4cplus - Still trying to understand its basic codes.
4)libboost-log- require boost logging
5)Rob Manderson Service log at
http://www.codeproject.com/cpp/loggerservice.asp -
Tried. But big performance impact, if large amount of data is being log by independent threads.
Comparison of log4cpp, log4cxx and libboost-log is already done in http://log4cpp.hora-obscura.de/index.php/LoggingLibraryForCpp
but i'm thinking of using log4cxx or log4cplus...
|
|
|
|
|
Depends on your requirements.
I use the system event logger API.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/event_logging_functions.asp[^]
It's thread safe, and i find it fast enough.
You can create your own log file (altough this feature isn't well documented) and use the system Event Viewer to view and filter log entries.
Rob originally created his because he want something that could handle a LOT of log entries being written at a high rate, and he didn't realize (originally) that the event logger would allow you to create your own log file.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Hello,
I am trying to create a program which will do the following tasks:
1. Get some data (in multiple columns) from the progam in to clip board.
2. Open Excel file, paste the data in the default sheet and create a graph (in desired form) from the pasted data.
3. Copy the graph in to clip board and subsequently past the image in one of the controls.
While 1 and 3 are relatively easy to perform, I am not able to perform the 2nd step.
Will anybody help!
Pani
|
|
|
|
|
pani68 wrote: Open Excel file, paste the data in the default sheet and create a graph (in desired form) from the pasted data.
Not sure how to do the graph, but what you’re looking for is Office Automation through com.
MSDN Links to get you started.
How To Automate Excel From C++ .NET and MFC To Fill or Obtain Data[^]
How To Embed and Automate an Excel Worksheet [^]
Excel using automation[^]
When I need to do any office automation I use the built in macro recorder to record what I need to do. I then dissect what the macro recorder has done into what I need to do in my app.
Good luck, hope this helps!
ZeePain! wrote: This seems like one of those programs that started small, grew incrementally, building internal pressure, and finally barfed all over its source code sneakers. Or something.
thedailywtf.com[^]
|
|
|
|
|
if i wrote
if (pMsg->message==WM_CHAR) {
return TRUE;
}
in its parent wnd's PreTranslateMessage func,
I can't do any input in the edit.
I think it's strange, I don't know how the CEdit handle WM_CHAR.
|
|
|
|
|
followait wrote: I can't do any input in the edit
Of course, you are intercepting the WM_CHAR message, your poor CEdit control does not get it...
What do you want to achieve exactely ?
~RaGE();
|
|
|
|
|
The parent window of the edit handles WM_CHAR in its PreTranslateMessage before I add this edit control.
The problem is how to make the edit work.
|
|
|
|
|
The item is what do you want to do? If you want to track every WM_CHAR it's ok to do it in PreTranslateMessage but if you want to let them process like the default behavior just let them flow.
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
The parent wnd of the edit handle WM_CHAR in its PreTranslateMessage func from other controls in it.
|
|
|
|
|
Check the HWND of the message, if the message is for the edit control let it through, else handle it as before.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks for your help.
But when doing so, I got another problem.
Why I can't compare two type_info class?
BOOL CTest_WM_CHARDlg::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message==WM_CHAR) {
CWnd *pWnd=CWnd::FromHandle(pMsg->hwnd);
const type_info &ti0=typeid(*pWnd);
const type_info &ti1=typeid(CEdit);
if (ti0==ti1) {
return FALSE;
}
}
return CDialog::PreTranslateMessage(pMsg);
}
|
|
|
|
|
Why not use GetClassName() instead. It will return the class name of the window, regardless of whether it is a MFC class or not.
BOOL CTest_WM_CHARDlg::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_CHAR)
{
TCHAR ClassName[5] = {0};
GetClassName(pMsg->hwnd, ClassName, 5);
if (_tcsnicmp(ClassName, _T("EDIT"), 4) != 0)
{
return TRUE;
}
}
return CDialog::PreTranslateMessage(pMsg);
}
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
|
Hi,
I am writing a small utility to automate the backing up and restoring of databases from within my software using 'RESTORE DATABASE' and 'BACKUP DATABASE' through CDatabase::ExectueSQL. Adding 'WITH STATS = 10' causes SQL to return 10% completed, 20% completed etc etc.
I was wondering, if it was at all possible to get the completed amounts out and using them for a progress bar? I know ExecuteSQL does not return anything, but maybe calling oSQL with an output file set?
Many thanks in advance.
|
|
|
|
|
Hi,
I derived a class from a CScrollview and implemented OnPaint event by filling the area with the black color but it causing flickering ..can anyone help me how to make it flicker free...here is the code attached..
class MyScrollView : public CScrollView
{
public:
MyScrollView();
virtual ~MyScrollView();
private:
CDC m_dc;
protected:
virtual void OnDraw(CDC* pDC);
virtual void OnInitialUpdate();
void DrawBitmap(void);
public:
afx_msg void OnPaint();
DECLARE_MESSAGE_MAP()
};
void MyScrollView::OnInitialUpdate()
{
CScrollView::OnInitialUpdate();
CSize sizeTotal;
// TODO: calculate the total size of this view
sizeTotal.cx = sizeTotal.cy = 100;
SetScrollSizes(MM_TEXT, sizeTotal);
}
void MyScrollView ::DrawBitmap()
{
CSize sizeTotal;
sizeTotal.cx = 10000;//198450000;
sizeTotal.cy = 200;
SetScrollSizes(MM_TEXT, sizeTotal);
CRect rect;
GetClientRect(&rect);
CClientDC dc(this);
CBitmap bmpTemp;
CBitmap *lpOldBmp;
m_dc.CreateCompatibleDC(&dc);
bmpTemp.CreateCompatibleBitmap(&m_dc,rect.Width(),rect.Height());
lpOldBmp = m_dc.SelectObject(&bmpTemp);
m_dc.FillSolidRect(&rect,RGB(0,0,0));
}
void MyScrollView::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
// TODO: add draw code here
}
void MyScrollView::OnPaint()
{
CPaintDC dc(this); // device context for painting
CRect rect;
GetClientRect(&rect);
dc.BitBlt(0,0,rect.Width(),rect.Height(),&m_dc,0,0,SRCCOPY);
}
i added this class in a dialog box like below
m_MyScrollView = new MyScrollView;
CRect scrollRect(10,10,rect.Width()-50,rect.Height()-50);
m_MyScrollView->Create(NULL,NULL,WS_CHILD|WS_VISIBLE,scrollRect,this,NULL);
m_MyScrollView->DrawBitmap();
Thanks in advacne
suresh v.
|
|
|
|