|
|
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.
|
|
|
|
|
Invalidate your window area, but exclude the area where the bitmap will be drawn (calculate ahead of time) and then you will not get the flicker where the bitmap will go. Your background would only be 'erased' where the bitmap will be missing. Otherwise, if you bitmap always fills the window area, then override the OnEraseBAckground and don't erase the background at all, or manually only erase where the bitmap is missing.
|
|
|
|
|
Respected All
Regards!
The article from Hermann about Print is
"Easy to use class for ScreenCapture to printer"
I used it and working well and i bcome able to take print while using this class brillient work by him but the always the print did not come on the center of the page and that's start print from the Top Left corner of the page, now i want to take Print at the center of the page.
the link of the page is
http://www.codeproject.com/printing/prntscreen.asp
please guide for possible change in this class so that i may able to take print at the middle of the page while printing.
Regards
David
david
|
|
|
|
|
Hi,
I am creating a shell namespace extension to show FTP files. I implemented cut / copy and paste using CFSTR_FILECONTENTS and CFSTR_FILEDESCRIPTOR. I implemented IDataObject and IStream for this. After copying, when I choose to paste the files, I am getting all the files, But the problem is that, the directory structure is not retained.
If I am copying a folder say "Test", which contains 2 files
1. a.txt
2. b.txt
When I choose paste, I am getting 2 files ( a.txt and b.txt ) and a folder ( Test ) in the same place. In fact it should have been folder "Test" and the two files inside "Test". But that is not happening.
I believe I am missing something here...
Could somebody please help me in resolving this.
Thanks and Kind Regards
Jugs
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Hi,
My project uses a telephony hardware which comes with its own initializing software. Each time i run my app, i've to run the said s/w for initializing the h/w. So, i think it'll be better if my app itself runs it on startup. I've lookd up the MSDN and ended up on Createprocess( ). I burnd my head a lot, but its not workin, probably, the parameters i passd r incorrect.. plz help me out.
thanks,
-- ano
-- modified at 0:38 Friday 25th November, 2005
|
|
|
|
|
Hi,
Use ShellExecuteEx
Bye
Cool Ju
Dream Ur Destiny
|
|
|
|