|
All Bstruct.aa[],bb[] ... kk[] have the same size 16.
Is there some cons for using seperate for loops? the compiler maybe optimized them in one loop in assembly?
|
|
|
|
|
econy wrote: All Bstruct.aa[],bb[] ... kk[] have the same size 16
Yes, today they do, tomorrow, who knows?
econy wrote: Is there some cons for using seperate for loops?
Using more CPU cycles because of the multiple initializations and testings (some MCUs clear thier cache when branches are executed) of i. Other than that I can't think of any.
econy wrote: the compiler maybe optimized them in one loop in assembly?
Don't know offhand, my gut tells me they wouldn't be optimized out.
|
|
|
|
|
|
This would depend to some extent on the target hardware and the program design. The only way to be certain would be to ask the original writer.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
No benefit, in my opinion.
Veni, vidi, vici.
|
|
|
|
|
The key is "embedded". Some CPUs, many in the embedded space, throw exceptions for misaligned data access EXCEPT for byte access. This is one way to copy data with unknown alignment (say from a socket or file) to an aligned data structure. (The original ARM chips would throw an exception, which some embedded OSs would catch and then do exactly the above internally.)
|
|
|
|
|
I need to display 8 roads video at the same time.
But I find that the DrawDibDraw is too slow, it need 16ms to draw one frame data.
it nearly cannot be accepted.
Then I try to use the directdraw to draw the YUV data to windows, but I cannot get a right answer after google half a day. Is there some one know how to draw the YUV or RGB data to a form using the directdraw? thanks.
|
|
|
|
|
As is known to all, unicode can represent all the character in the world. Now, my problem is how to create font by an unicode value. Because each unicode value represents a char.
Here is a related link: http://www.ssec.wisc.edu/~tomw/java/unicode.html[^]
Here is a C++ API:
HFONT CreateFont(
_In_ int nHeight,
_In_ int nWidth,
_In_ int nEscapement,
_In_ int nOrientation,
_In_ int fnWeight,
_In_ DWORD fdwItalic,
_In_ DWORD fdwUnderline,
_In_ DWORD fdwStrikeOut,
_In_ DWORD fdwCharSet,
_In_ DWORD fdwOutputPrecision,
_In_ DWORD fdwClipPrecision,
_In_ DWORD fdwQuality,
_In_ DWORD fdwPitchAndFamily,
_In_ LPCTSTR lpszFace
);
Is it possible to do that by the function?
Anyone can help me?
|
|
|
|
|
The CreateFont [^] function creates a logical font based on the request parameters and the actual font files that are loaded on your system. Most fonts include Unicode characters for various different languages and there are fonts that handle Asian type alphabets.
Creating a new font from scratch requires a number of other tools; Google will help you to find articles on the subject.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
dear all,I have a question,when I write files,like pdf,i want to popup a dialog with animation to show
that the writing operation is working.
I don't know how to do with that ,it may need a avi file ,use CAnimateCtrl,is it need multithread,please
help me.this is my code
void CMainFrame::OnExportPdf()
{
CExportPro* ExPro;
ExPro = new CExportPro();
CFileDialog dlg(FALSE,TEXT("txt"),NULL,OFN_HIDEREADONLY|OFN_FILEMUSTEXIST|OFN_PATHMUSTEXIST|OFN_OVERWRITEPROMPT,_T("TXT (*.txt) |*.txt|"));
CString fileName;
CString filePath;
if(dlg.DoModal()==IDOK )
{
ExPro->SetCaption(TEXT("pdf"));
ExPro->Create();
ExPro->ShowWindow(SW_SHOW);
filePath = dlg.GetPathName();
m_filepathname = dlg.GetPathName();
if ( !filePath.IsEmpty())
{
CFile file;
CString str(TEXT("hello this is the test for write process"));
file.Open(filePath.GetBuffer(),CFile::modeCreate|CFile::modeWrite);
while (i<1000000)
{
file.Write(str,str.GetLength());
i++;
}
file.Close();
}
}
}
BOOL CExportPro::OnInitDialog()
{
CDialogEx::OnInitDialog();
SetWindowText(m_StrCaption);
m_avi.Open(IDR_AVI1);
m_avi.Play(0,-1, -1);
return TRUE;
}
I know It is not my means,but how can do ,when writing it display avi.
|
|
|
|
|
Where exactly are you stuck?
Perform all your file writing operations in a background thread, and compute and post messages on the operation progress from the worker thread to your main window. Your main window procedure should handle this message and display the progress accordingly.
"Real men drive manual transmission" - Rajesh.
modified 4-Jan-13 6:20am.
|
|
|
|
|
Thanks,but I use CAnimateCtrl,this is a control,I initial it in dialog CExportPro::OnInitDialog(),I think
when modalless diaolog appear,the control should be appear ,but the fact is that when writing it appear modalless diaolog without CAnimateCtrl,and after writing,the CAnimateCtrl show,why,it maybe the thread
hang_up.how to do with it.
|
|
|
|
|
My current task is to develop C/C++ project for running on Linux (Ubuntu). My Windows PC has Visual Studio Express, Eclipse and Cygwin installed.
I have worked with C/C++ on MS Windows years but I am new to the situation above.
Could anyone help me to configure and show me step by step how to create and build a project (I need to work
all on MS Windows 7)?
I mean how to develop C/C++ project on Windows environment described as above and the built file can run on Linux.
Thanks in advance.
|
|
|
|
|
|
You cannot run Windows unmanaged programs on Linux. You can do the base development as long as your code is POSIX compliant, but you would be better getting access to a Linux system and using the Linux development tools.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
People, I met a rather strange situation. I deleted a small memory block and after it was not able to allocate another one. Operator "new" presented me with "out of memory" exception. But without previous call of "delete" "new" gave me what I asked it for (I'm talking about small blocks, something like 10KB). At that very time VirtualAlloc() successfully allocated required memory. How could it be?
|
|
|
|
|
Corrupted heap springs to mind.
|
|
|
|
|
Yeah, of course I thought about it, but was not able to detect where this sorrowful situation took place. Usually when I wrote something outside of allocated memory block, I got a message when "delete" operator was called, but not now. I tried to check surrounding memory, allocated larger then I needed block, wrote canary words before and after memory that I used and found that these canary words remained intact.
|
|
|
|
|
Without seeing the relevant code, I'm afraid we cannot help you.
Veni, vidi, vici.
|
|
|
|
|
Situation is worse, than I expected. Some malicious code is running at my comp. For the beginning, my Visual Studio 2005 refused to create the Project Property window and gave me something like "failed to create Net. Framework property grid". Trying to understand, why my prog refuses to open files, which it was able to open some days ago I found that in my process's address space was downloaded libraries like urlmon.dll, netapi.dll, crypt32.dll and modemInst.dll (!!!). People, I write prog which is intended to work with aerial images and I have no intention to counteract with the Net. The most interesting is the last library- it was taken not from system32 catalog, but from folder where HSPA USB Modem was placed.
|
|
|
|
|
Is there any tool to findout memory leaks in an ActiveX (build using C++/MFC). This ActiveX is loaded through a webpage in IE. I want to find out leaks at run time on certain operation in the ActiveX specially during unload. I tried bound checker but there is no such option to attach IE with it.
Manish Agarwal
manish.k.agarwal @ gmail DOT com
|
|
|
|
|
Hi Manish K,
There is a similar question found on the following website with details:
http://stackoverflow.com/questions/1502799/memory-leak-tool-for-c-under-windows
Please take a look at it, you may find it beneficial
With Kind Regards,
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 8:33am.
|
|
|
|
|
It is more helpful if you make your links clickable. Use the "link" or "[^]" button above the edit control.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hello Mr. Agarwal,
With regards to your post, a tool that aids in finding memory leaks in an ActiveX (build using C++/MFC)at run time on certain operation during upload is the following:
Please visit the following:
http://forums.ni.com/t5/LabVIEW/Memory-leaks-using-active-X/td-p/117007
There a solutions listed.
With Kind Regards,
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 8:30am.
|
|
|
|
|
I am not looking simply memory leak finding tools but I am trying to deal with a special case when there is a memory leak inside an ActiveX. I know this is simply as a Leak inside a DLL but ActiveX case is some different as it is loaded by IE using JavaScript object tag and it is also unloaded by IE. I want to track leaks at unloading time.
Manish Agarwal
manish.k.agarwal @ gmail DOT com
|
|
|
|