|
try SHFileOperation(..) shell API
|
|
|
|
|
Hi nitinmx,
I need to run program on both Windows desktop and Windows CE, I am wondering whether SHFileOperation could be supported on Windows CE?
regards,
George
|
|
|
|
|
As most people don't program for windows CE, you could always look at the help file to see if it supported yourself. Or try using it and fail?
Iain.
|
|
|
|
|
Hi,
I have many string values . I am displaying them on GDI using the
TEXTOUT() method . but my problem is that I want to SCroll them
on the GDI .also I am displaying bimap usig bitblt(). I also wants
to scroll many bitmpas on the GDI
Trioum
|
|
|
|
|
Then you have to save your relative position of your elements and then update them with the position of your CScrollview in every OnDraw. I made it like this:
void CMyView::OnInitialUpdate()
{ CScrollView::OnInitialUpdate();
CSize sizeTotal;
sizeTotal.cx = 950; sizeTotal.cy = 1400;
SetScrollSizes(MM_TEXT, sizeTotal);
CMyDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
extern CMyDoc* m_pDoc;
m_pDoc = GetDocument ();
pDoc->UpdateDescription ();
m_hCursor=AfxGetApp()->LoadStandardCursor(IDC_ARROW);
return;
}
void CMyView::OnDraw(CDC* pDC)
{ PlaceElement ();
return;
}
void CMyView::PlaceElement ()
{ CMyDoc* pDoc = GetDocument ();
ASSERT_VALID (pDoc);
CClientDC dc(this);
CDC dcNormMem;
dcNormMem.CreateCompatibleDC (&dc);
CDC dcSelMem;
dcSelMem.CreateCompatibleDC (&dc);
CString szTempText = "";
CPoint cpTempPos, cpTempTextPos, cpScrollPoint = GetScrollPosition ();
CBitmap bmNormIn, bmNormOut, bmNormReg, bmSel;
BITMAP bmNormTemp, bmSelTemp;
for (int nIn = 0; nIn < pDoc->m_cMyListSet.GetCount (); nIn++)
{ if (!pDoc->m_cMyListSet[nIn].m_bInSel)
{ if (bmNormIn.m_hObject != NULL)
bmNormIn.DeleteObject ();
bmNormIn.LoadBitmap (IDB_NORMIN);
bmNormIn.GetObject(sizeof(bmNormTemp), &bmNormTemp);
dcNormMem.SelectObject(&bmNormIn);
cpTempPos.x = pDoc->m_cMyListSet[nIn].m_cpInCoord.x - cpScrollPoint.x;
cpTempPos.y = pDoc->m_cMyListSet[nIn].m_cpInCoord.y - cpScrollPoint.y;
dc.BitBlt(cpTempPos.x, cpTempPos.y, bmNormTemp.bmWidth,
bmNormTemp.bmHeight, &dcNormMem, 0, 0, SRCCOPY);
szTempText = pDoc->m_cmlInputSet[nIn].m_szInName;
dc.SetTextColor(RGB(0,0,0));
dc.TextOut (cpTempPos.x, cpTempPos.y + SIGHEIGHT + 1, szTempText);
}
}
}
With these I put one Bitmap and a label with its name below for every element I have , and when I scroll the View surface its position scrolls as well.
Hope it helps
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
actually i donot want to scroll image and text by picking from list by by one .I want to scroll them like the news tickers in News Channel
can you help.
Trioum
|
|
|
|
|
????
Explain it a bit. I don't know what you mean
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Hello Gurus...
Using pDC->GetClipBox(&rect), i Will get clip region of pDC(my CDC*).
But
m_DC is my another DC, and i want to assign the clip region of pDC to m_DC.
How to assign?????????????
thanks in advance
|
|
|
|
|
Try this ..
// get current clipping boundary
RECT rect;
pDC->GetClipBox( &rect );
// Selects the current clipping region for other dc
CRgn rgn;
rgn.CreateRectRgnIndirect( &rect );
m_DC.SelectClipRgn( &rgn );
... hope it helps
|
|
|
|
|
Thanks "csc"
its exactly does what i expect...
|
|
|
|
|
hello
please help to solve this problem
when i coonect vc++ to mysql
and use this code to fetch data from mysql
mysql_query(myDB,"select password from login where user= \'" + user + "\'");
i = mysql_query(myDB,"select * from login");
res=mysql_store_result(myDB);
row = mysql_fetch_row(res);
MessageBox(row[0]);
but when i use debugger at this line row = mysql_fetch_row(res);
an unhandled exception myapp.exe(libmysql.dll) access violation appears in message box and when i click ok then in output window of vc++ following messages appears :
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
Loaded 'C:\DOGRA\company\libmySQL.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\user32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\gdi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\wsock32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ws2_32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ws2help.dll', no matching symbolic information found.
Loaded symbols for 'C:\WINDOWS\system32\MFC42D.DLL'
Loaded symbols for 'C:\WINDOWS\system32\MSVCRTD.DLL'
Loaded symbols for 'C:\WINDOWS\system32\MFCO42D.DLL'
Loaded 'C:\WINDOWS\system32\imm32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\lpk.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\usp10.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\comctl32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\uxtheme.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\version.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\MSCTFIME.IME', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ole32.dll', no matching symbolic information found.
Warning: no listbox item selected.
Loaded 'C:\WINDOWS\system32\mswsock.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\dnsapi.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\winrnr.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\wldap32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\rasadhlp.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\hnetcfg.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\wshtcpip.dll', no matching symbolic information found.
First-chance exception in company.exe (LIBMYSQL.DLL): 0xC0000005: Access Violation.
The program 'C:\DOGRA\company\Debug\company.exe' has exited with code 0 (0x0).
now please help me to solve this problem
hi
|
|
|
|
|
Please stop reposting. Be patient. If you keep on reposting it will not only annoy people out here but also prevent them from answering to you query. please refrainf from this habit.
In the meantime please debug the Application Step by Step. you might hit upon something.
There are only two kinds of people who are really fascinating-people who know absolutely everything, and people who know absolutely nothing.
Oscar Wilde (1854-1900)
Regards...
Shouvik
|
|
|
|
|
Hi all,
Recently, I have encountered a "Out of memory" issue, but I found that system still has enough memory.
Here are some information about this issue.
I tried to new an array like below codes
try<br />
{<br />
<br />
<br />
unsigned long* mImage = new unsigned long[67108864];
<br />
}<br />
catch( CMemoryException* pEX)<br />
{<br />
CString cstmp;<br />
CString csOut;<br />
MEMORYSTATUS stat; <br />
GlobalMemoryStatus (&stat);<br />
<br />
cstmp.Format("The MemoryStatus structure is %ld bytes long.\n",stat.dwLength);<br />
csOut+=cstmp;<br />
cstmp.Format("It should be %d.\n", sizeof (stat));<br />
csOut+=cstmp;<br />
cstmp.Format("%ld percent of memory is in use.\n",stat.dwMemoryLoad);<br />
csOut+=cstmp;<br />
cstmp.Format("There are %7d total Kbytes of physical memory.\n",stat.dwTotalPhys/1024);<br />
csOut+=cstmp;<br />
cstmp.Format("There are %7d free Kbytes of physical memory.\n",stat.dwAvailPhys/1024);<br />
csOut+=cstmp;<br />
cstmp.Format("There are %7d total Kbytes of paging file.\n",stat.dwTotalPageFile/1024);<br />
csOut+=cstmp;<br />
cstmp.Format("There are %7d free Kbytes of paging file.\n",stat.dwAvailPageFile/1024);<br />
csOut+=cstmp;<br />
cstmp.Format("There are %7x total Kbytes of virtual memory.\n",stat.dwTotalVirtual/1024);<br />
csOut+=cstmp;<br />
cstmp.Format("There are %7x free Kbytes of virtual memory.\n",stat.dwAvailVirtual/1024);<br />
csOut+=cstmp;<br />
pEx->Delete();<br />
AfxMessageBox(csOut);<br />
}
System will throw an exception( CMemoryException ) and I tried to print out the status of memory.
The following list is the output result.
The MemoryStatus structure is 32 bytes long.
It should be 32.
36 percent of memory is in use.
There are 2096100 total Kbytes of physical memory.
There are 1321288 free Kbytes of physical memory.
There are 4041780 total Kbytes of paging file.
There are 3615048 free Kbytes of paging file.
There are 1fff80 total Kbytes of virtual memory.
There are 70e94 free Kbytes of virtual memory.
I think that system still has about 1.3GB memory but I just want to allocate 256MB. Why does system throw a memory exception and tell me an error message "out of memory"?
Does any one can tell how I can solve this problem?? Any suggestions are welcome. Thanks a lot.
Regards,
Pogo Lin
|
|
|
|
|
Where does it get the Out of Memory error at?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
When I tried to allocate memory it will throw CMemoryException.
The code I posted is a function. It will be called many times. But sometimes it will throw CMemoryException.
So I tried to print out the using status of memory and hope to find out the question.
Any body have any ideas how to get more information for using memory?
Regards,
Pogo Lin
|
|
|
|
|
The system may have "enough" memory left but not enough to allocate 256MB of contiguous memory.
Steve
|
|
|
|
|
Recently, I was confused with the problem of displaying text. Supposed I created a single document application named "Text", and the CTextView inherited from CView. The map mode is MM_LOMETRIC.
There is the following code segment:
INT_PTR nRet = -1;
CFontDialog fontDialog;
nRet = fontDialog.DoModal();
CString str("There is a will, there is a way!");
if(nRet == IDOK)
{
LOGFONT lf;
fontDialog.GetCurrentFont(&lf);
CFont font;
font.CreateFontIndirect(&lf);
CDC *pDC = GetDC();
OnPrepareDC(pDC);
CFont *pOldFont;
pOldFont = pDC->SelectObject(&font);
pDC->TextOut(500, -500, str);
}
Why the text is so small, even I select the largest size?
Help!
|
|
|
|
|
And when do you select the font size?
Try something like this:
CFont font1;
font1.CreatePointFont (80, "MS Sans Serif", pDC);
CFont font2;
font2.CreatePointFont (140, "MS Sans Serif", pDC);
Then you will be able to specify the size of your font. If you have MM_LOMETRIC map mode, then you should give a 10*Desired_size to your CFont
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Hi,
I came across your website while searching for software that will allow me to compare successive images to detect motion. I read an article and thought that maybe someone could help me. Please let me know if I should repost my question on a different forum.
I'm with a very small nonprofit that needs to collect data in remote wilderness areas. The plan for the first iteration is to place an camera in the field and have it store images at intervals, say every 15 seconds. We will retrieve the memory card, download the images to a computer, and THEN we want to compare successive images to see if there was any motion.
Note that the "camera in the field" option is being used because it is simple and eliminates the need for a computer in the field to do the motion detection. A computer in the field adds issues of power consumption and damage due to snow and rain.
So we end up with thousands of images. While there are many software packages that can detect motion from a video feed, I have not been able to find software that automates the comparison of successively numbered images stored in a folder on a harddrive.
Does anyone know of software that might help us with our environmental project. None of us are programers.
Thanks for any help you can give.
Cheers.
Marcus
|
|
|
|
|
Dear friend,I've encounter the same question as yours,I think you'd better to have some knowledge about Module Identify which I'm not sure to translate into english correctly,in such method,you can find a way to solve your question.
By the way,I have my opinion:you may transfer your compressed image to bimap which is uncompressed and compare them in bits.
Later buggers harm more.
|
|
|
|
|
Hello,
I want to create my own Windows XP Desktop Shell, preferably using C# or C but will use C++ if given no choice, substituting it for 'Explorer.exe'. Are there any good online resources to help me with this? I googled around and only commericial products came up. I did find some opensource shell replacements on WIKI though; Emerge Desktop, Geoshell, LDE(X), LiteShell, LiteStep, SharpE, bbLean, xoblite, ROS Explorer and I will download those and check'em out too. But a nice informative reference would be nice too to go with those programs.
What started this little task is that I thought it would be nice if the right click menu items that I often used appeared as a task in the "File and Folder Tasks" in the "Windows Common Tasks pane in folders". After rearching how to do this, I found that one could write their own shell pretty neat ! , however, unfortunitately, I didn't find any information on how to do this. Needless to say, I want write my own "Desktop Shell" and add that feature to it in my spare time.
Please don't flame me like was done on another programmer site, that shall remain nameless. If i break my personal computer I will reinstall the OS . If I find it too difficult to do then perhaps I will go to a movie instead . But I think that I will not be frightened by the task.
PS: if there is a better forum in which to ask this question feel free to direct me their!
Thanks guys!
C, C# and JavaME(J2ME) Programmer
|
|
|
|
|
Preferring C to C++????? - I'm lost for words.
Steve
|
|
|
|
|
The language doesn't make the programmer anymore than clothes makes a man. A language is just a tool doesn't make you any smarter or dumber.
[period]
C, C# and JavaME(J2ME) Programmer
|
|
|
|
|
Ok then, program in machine code for 6 months and then quote me the same myth while keeping a straight face. I've heard this line so many times before and it always brings a smile to my face.
Steve
|
|
|
|
|
[PLEASE REMAIN GERMANE TO THE TOPIC -- THESE COMMENTS ARE FRUITLESS; PROGRAM IN WHATEVER YOU WANT I DON'T CARE. HECK USE MATCH STICKS -- JUST WANT TO UNDERSTAND THE SUBJECT I CREATED]
IN FACT, I FOUND A NICE E-BOOK, WROX - ISBN 1861001843 - Visual C++ Windows Shell Programming.pdf, SO IF YOU GUYS WANT TO USE THIS THREAD TO CONTINUE THIS IRRATIONAL DISCUSSION BE MY GUESS. I'LL BE BUSY LEARNING SOMETHING NEW. I'M UNSUBSCRIBING TO THIS THREAD SO I DON'T GET DISTURBED BY IT.
THANKS AND HAVE A NICE DAY!
C, C# and JavaME(J2ME) Programmer
|
|
|
|
|