|
Hey all.
I'm working on a shell namespace extension that needs to provide access to files over the Internet.
My problem is that Explorer's UI freezes when the user attempts to drag files out of it. I've already implemented IAsyncOperation in my IDataObject, but that only seems to allow the drop *target* to run on a background thread.
I provide files through the CFSTR_FILEDESCRIPTOR/CFSTR_FILECONTENTS combo wrapped in IStream interfaces, and Explorer always calls IStream::Read() on the same thread as the rest of the UI, thus freezing everything. I'd love to either be able to return E_PENDING or something similar, or simply get called on a background thread.
For the record, I set SFGAO_ISSLOW for all items while in IShellFolder::GetAttributesOf(), but it doesn't help.
I'm slowly running out of ideas here. The interface is frozen solid while in IStream::Read(). It doesn't even redraw.
There's got to be a solution to this, that I'm just not seeing. I've been looking into async monikers, but all I managed to do was get my brain into a knot, since nowhere does the shell namespace documentation reference them, so I'm assuming there might be another way.
Any help/suggestion will be greatly appreciated.
|
|
|
|
|
Hi guys
I want to know is there any way to fade out text in CStatic. Any idea or concept??
thanks
|
|
|
|
|
If I was making a CStatic control to do this, I would handle the reflected
WM_CTLCOLORSTATIC message to use custom colours, and then create a timer
which updated the colour and invalidate the static control.
That should give you enough to get started with!
Iain
|
|
|
|
|
Hi Iain
thanks a lot for reply.
well is there a way to fade out the text with dissolve effect.
thanks
۞It is on our failures that we base a new and different and better success.
|
|
|
|
|
just crreating a new SDI project with VC++ wizard,
choose CFormView as the base view class,
then switch to the resource editor,
place a CListBox control on the formview,
and make sure to enlarge the formview design size so that a scrollbar can appear later,
then ,build it and run,
though the scrollbar is visible,
but i just can't let it scroll with my middle mouse wheel,
can anybody tell me what's the reason??
thanks a lot.
lostangels@163.com
|
|
|
|
|
To perform mousewhel scrolling in a CFormView you have to enter the logic yourself.
You have to respond to WM_MOUSEWHELL.
Here's a snippet that worked for me:
BOOL CSomeFormView::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
{
// test if it is visible first
if ( GetStyle() & WS_VSCROLL )
{
CPoint ptScroll = GetScrollPosition();
// determine the amount of scrolling
int nLines = -zDelta / WHEEL_DELTA;
// Scroll to new position
ScrollToPosition ( ptScroll + CPoint ( 0, nLines * 15 ) );
}
return CFormView::OnMouseWheel(nFlags, zDelta, pt);
}
|
|
|
|
|
just crreating a new SDI project with VC++ wizard,
choose CFormView as the base view class,
then switch to the resource editor,
place a CListBox control on the formview,
and make sure to enlarge the formview design size so that a scrollbar can appear later,
then ,build it and run,
though the scrollbar is visible,
but i just can't let it scroll with my middle mouse wheel,
can anybody tell me what's the reason??
thanks a lot.
|
|
|
|
|
Hi. I'm aware that this question probably has been posed for quite some time. But i'm looking for a solution where I need not compile the matlab code with matlab compiler, or build a dll as the targetted .m file is still under development. Anyone got a solution for this? Thanks!
|
|
|
|
|
Hello Anonymous,
As far as I understand you look to use matlab dll files in your C++ code without calling on matlab itself. Mathworks does not provide such functionality for multiple reasons, including proprietary algorithm implementations and abstraction of implementation in order to upgrade it later. If you are REALLY serious about doing it though and you have a lot of time, you can hack into their dlls, say using dumpbin utilities and disassembler to find the binary implementations of the functions that you want to use. Perhaps, it would be easier to find open source math libraries. As a final note: Don't take my words as 100% correct, all I know is that I have talked to people with similar problems and they ended up writing their own C++ implementation. As the very final note you may also need to know that matlab internal implementation is in C rather than C++, and it also uses some Fortran compiled binaries (obj) of Lapack and Blas libraries. All this language diversity may become "pain in the place" when you try integrating your code with matlab's.
Nick Kisialiou
|
|
|
|
|
Hi Nick,
after reading your reply I do agree with you. So I went a big round by creating a batch file with the commands to execute a matlab script file, and then use CreateProcess() to run the batch file. Troublesome, illogical, a big detour, but does seem to serve the purpose of executing matlab scripts without compiling or using DLL. Only problem now is to detect end of execution of matlab thread. =)
|
|
|
|
|
ok I have made a program that simulates a petrol station (comming of cars etc..)
it is a single MFC /SDI app in witch I made 2 functions first one delets the screen and the second one draws someting on the screen. I call this functions whit a timer (every 100ms)
but there is a problem sometimes my program crashes and this is all that I get as help why it crashed
Unhandled exception at 0x7c28af6a (mfc71d.dll) in seminarska.exe: 0xC0000005: Access violation reading location 0x00000004.
So I'm sure that the problem is in this 2 functions :
becouse if I run the program whit no drawing the program never crashes:
ok here is the code for deleteing the screen:
void CseminarskaView::brisi_ekran(void)
{
CDC*tabla=GetDC();
RECT Okno;
GetClientRect(&Okno);
CBrush copic(0xffffff);
tabla->FillRect(&Okno,&copic);
}
and the code for drawing :
void CseminarskaView::risi(Bencinska postaja[])
{
//tukaj moram risati sproti
CDC* tabla=GetDC();
RECT ena;
ena.top=20;
ena.left=20;
ena.right=60;
ena.bottom=60;
int x1=0;
int x2=0;
int x3=255;
int y=25;
CString nizi;
int i ;
for (i=0;i<5;i++)
{
CString out;
out.Format("%i",i+1);
tabla->TextOut(10,y,out);
CBrush pisalo(RGB(x1,x2,x3));
tabla->FillRect(&ena,&pisalo);
ena.top=ena.top+60;
ena.bottom=ena.bottom+60;
x1=x1+60;
x2=x2+60;
x3=x3-60;
y=y+60;
//delete pisalo;
}
CString uu;
y=25;int y1=500;
for( i=0;i<5;i++)
{
for(int j=0;j
{ nizi=nizi+" I ";
}
tabla->TextOut(80,y,nizi);
y=y+60;
nizi=" ";
uu.Format("postaja %i: %f",i,postaja[i].rezervar);
tabla->TextOut(10,y1,uu);
y1=y1+20;
}
}
can someone please help me ?
I think that the problem is CBrush but I'm not sure
becouse sometimes the program finishes Ok sometimes not
///---there is no hope for you---\\\
|
|
|
|
|
when access the NULL pointer ,the ERROR would appeal .
ALTF4 wrote: Unhandled exception at 0x7c28af6a (mfc71d.dll) in seminarska.exe: 0xC0000005: Access violation reading location 0x00000004.
the variable CBrush pisalo in the funtion risi() is abuse when for-loop run .
so you should define a ptr outside for-loop like this
...
CBrush* pBrush ;
...
for(..)
{
pBrush= new CBrush(...)
tabla->FillRect(..);
delete pBrush;
}
路漫漫其修远兮,吾将上下而求索。
|
|
|
|
|
ok I have make the code like you told me but it still does the same thing
///---there is no hope for you---\\\
|
|
|
|
|
ive created a global CSocket object. when i use it in a function ( without creating a thread) it operates and sends the data. but when i use it in a thread
it gives me an error. why is that?
|
|
|
|
|
try to bring the socket into the thread as an argument ?
///---there is no hope for you---\\\
|
|
|
|
|
ALTF4 wrote: ///---there is no hope for you---\\\
Is there any hope for you?
|
|
|
|
|
Try calling AfxSocketInit at the start of your thread.
|
|
|
|
|
CSocket uses the thread's message pump. A worker thread does not have a message pump.
Scott McPhillips [VC++ MVP]
|
|
|
|
|
hi
i wanted to know wheter i can use an Activex control without registering it??
for example use an Activex Control wich is in the same Folder??
i've built a program using an activexcontrol. but it needs to register the control first. but on a network i cant register it( i think modifing the registery is illegal)
thx
|
|
|
|
|
No, you have to register it. Run regsrv32.exe <your file>.dll on the remote machine.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Does anybody know how to get the number of files and folders on a windows machine.
Kelvin Chikomo
-- modified at 6:47 Sunday 12th February, 2006
|
|
|
|
|
Recursive FindFirstFile/FindNextFile? If you need it programatically, that is.
If you'd just like to know, you could go to the root of every partition using Explorer, select everything, and hit Properties.
Oor! If you have cygwin installed, you could count the lines of a "find" started from the root. :P
|
|
|
|
|
I need it programatically. I tried FindFirstFile/FindNextFile but recursion is a bit too slow and uses up too much resources. I thought there was a data structure for each partition that had all the partition information including number of files and folders.
Kelvin Chikomo
|
|
|
|
|
I have ClistCtrl (report view) with images. I want the images to be at the center of the column, not at left of the column.
How can I centralize the images?
|
|
|
|
|
You will need to use 'custom draw', a feature of the common controls including the list control. You can find information in the MSDN using "custom draw" as the search string. I would post a direct link for you, but the MSDN site seems to be acting up at the moment .
Custom draw lets you perform some or all of the drawing required for the control. It's easier than the 'owner draw' feature the traditional controls implemented, where you have to draw the whole thing. With 'custom draw' you can have the control do the standard drawing, and then add your piece where appropriate.
Software Zen: delete this;
|
|
|
|