|
Hi,
i created application which is splitting horizontally the window into 3 views,
Am replcaing the views through the following code.
<br />
BOOL CSplitter::ReplaceView(int row, int col,CRuntimeClass * pViewClass,SIZE size)<br />
{<br />
CCreateContext context;<br />
BOOL bSetActive;<br />
<br />
<br />
if ((GetPane(row,col)->IsKindOf(pViewClass))==TRUE)<br />
return FALSE;<br />
<br />
<br />
CDocument * pDoc= ((CView *)GetPane(row,col))->GetDocument();<br />
CView * pActiveView=GetParentFrame()->GetActiveView();<br />
if (pActiveView==NULL || pActiveView==GetPane(row,col))<br />
bSetActive=TRUE;<br />
else<br />
bSetActive=FALSE;<br />
<br />
pDoc->m_bAutoDelete=TRUE; <br />
((CView *) GetPane(row,col))->DestroyWindow();<br />
pDoc->m_bAutoDelete=TRUE;<br />
<br />
<br />
context.m_pNewViewClass=pViewClass;<br />
context.m_pCurrentDoc=pDoc;<br />
context.m_pNewDocTemplate=NULL;<br />
context.m_pLastView=NULL;<br />
context.m_pCurrentFrame=NULL;<br />
<br />
CreateView(row,col,pViewClass,size, &context);<br />
<br />
CView * pNewView= (CView *)GetPane(row,col);<br />
<br />
if (bSetActive==TRUE)<br />
GetParentFrame()->SetActiveView(pNewView);<br />
<br />
<br />
GetPane(row,col)->SendMessage(WM_PAINT);<br />
RecalcLayout(); <br />
<br />
return TRUE;<br />
}
But i got some problem when i am going to do operations on controls which is lying in the present view..... got assertion failure . the assertion is ASSERT(m_hWnd).
Can u explain is there any other code to replace view
|
|
|
|
|
hi,
go to msdn and search for
"Split32"
this application may help your problem.
Uday kiran
|
|
|
|
|
kiranin wrote: got assertion failure . the assertion is ASSERT(m_hWnd).
Which is meaningless out of context. What line of what file asserted?
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi,everyone.
I'm a chinese boy.My english is not very well,so... I hope you can know what I mean.I search a lot of data in chinese web and books,i can't find the answer.I need your help.
May be there are some articles in this site about this topice,but I can't find them.Because in fact I don't know how to say "a multithread breakpoint resume ftp programe", please corrct me.thanks.And help me how to get the answer.Thanks very much.
|
|
|
|
|
P.Dragon wrote: multithread breakpoint resume ftp programe
can you elaborate on this please?
-Prakash
|
|
|
|
|
I suspect it's a two part thing;
1. FTP (doesn't say client or server) using multiple threads.
2. Ability to resume downloads after disconnection without fetching existing data again.
I have a teenage daughter; if you can understand one of those, you can understand anything...
Steve S
Developer for hire
|
|
|
|
|
P.Dragon wrote: May be there are some articles in this site about this topice,but I can't find them.Because in fact I don't know how to say "a multithread breakpoint resume ftp programe", please corrct me.thanks.And help me how to get the answer.Thanks very much.
don't know much about resuming.. but you can create multiple connection from diffrent ui thread to upload or download the data!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
multiple connection is not really usefull, i guess he is thinking in lines of download clients that use multiple threads to download the file.
-Prakash
|
|
|
|
|
I have a computer connected to three other computer via LAN. These three computers have shared some of the folders. Some of these folders contain a .log file, which has to be read.
I enumerated the resources on the network through the WNetEnumResource API which correctly gives me the details of the computers on the network.
But when I try to search for the ,b..log,/b. files on these computers using the CFileFind class, it fails to find any .log files.
How do I resolve this issue?
Cutebug
|
|
|
|
|
What does this return...
CFileFind finder;
finder.FindFile("*.*");
Does this search return all files...
|
|
|
|
|
I expected it to return the list of all the shared folders on that particular computer.
But it doesn't recognize the shared folders.
Cutebug
|
|
|
|
|
cutebug wrote: I expected it to return the list of all the shared folders on that particular computer.
But it doesn't recognize the shared folders.
Is the machine offline.
|
|
|
|
|
cutebug wrote: ...the list of all the shared folders on that particular computer.
For that you'll need NetShareEnum() .
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
See here[^] maybe it is some helpful to you
|
|
|
|
|
How do we get the Edit properties like Font, Size etc from a Window Application?
One way i came across is enumerating the Child windows of the main parent window
and based on the Client message post a message to get the required data.
For Notepad it is fine, i could get the details by using the "Edit" child window.
But could not figure out the way for the remaing Applications.
Is there any generic way, where i could get the Edit properties of any Window?
Please reply.
Thanks in Advance.
|
|
|
|
|
Vissu89 wrote: and based on the Client message post a message to get the required data.
i dont understand why u worry about the child window type. u can get the font of any window using the function GetFont() or the message WM_GETFONT.
nave
|
|
|
|
|
let me make my problem more clear.
I want to know the Edit properties of the Client Area of the Window(the edit classproperties)
If i use WM_GETFONT for the Window (let say notepad), then it will give
the system default font which is of no use if i want to know the font properties
of the Client area where the user is typing.
I could get the Edit properties of the Notepad by using the above same procedure,
but in other applications i could not corelate the class name hat has this Edit
properties.
Please reply.
Thanks
|
|
|
|
|
sorry still i dont get u.
By enumerating all the childs, u can get the pointer of each child window. then sending the WM_GETFONT to this child window, u can get the font. Isn't? if u want to get the font properties of edit windows only, Take the class name of the window using the GetClassName() function and compare if it is "Edit" (WC_EDIT).
nave
|
|
|
|
|
You are right, i agree.
That's what i am doing. but the issue is i am getting the match for "Edit" class
only for Notepad application but not windows wordpad or Ms Word kind of editors.
Is there any generic way to do this.
Thanks,
Vissu.
|
|
|
|
|
|
Wordpad uses a RICHEDIT50W window class.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I remember that an article is in codeproject that with it you can find detaily in programs like classes,controls and....
|
|
|
|
|
hi all,
iam trying to receive data from usb in my mainframe.cpp file where the usb read is done as a separate thread. i want to reformat the received buffer and pass this buffer to a WM_PLOT function which is in projview.cpp file and inside plot function i use this buffer to plot the function.
the trouble iam facing is this buffer has to be very large ie., the buffer that is used to receive the data from usb has to be 3000000 bytes long. hence, the reformat buffer has also to be that big.
how do i create the buffer? can anyone show me some code snippet to do the above method. to create such big buffers, i tried using unsigned long* buf = new unsigned long [3000000];
but if i create the reformat buffer as such, i need to delete it as well but i need to pass this buffer on to projview.cpp file, then how will i do it? where will i delete it?
is there a better way of doing it? i desperately need help.
Thanks in advance.
|
|
|
|
|
thathvamsi wrote: but if i create the reformat buffer as such, i need to delete it as well but i need to pass this buffer on to projview.cpp file, then how will i do it? where will i delete it?
Firstly, if your buffer needs to be 3000000 bytes long, then you need
unsigned char* buf = new unsigned char[3000000]
otherwise you're overallocating by a factor of 4.
Secondly, passing the buffer around should be no problem, since you just need the address (and possibly a size, to help detect/prevent underrun/overrun).
From your post, you need two buffers; the first is used by the thread reading the data. Does this thread also perform the reformat? Can the reformat be done 'in place' or do you need a separate buffer?
Only you know when to delete the buffer - when you're done with it. However, don't keep deleting and reallocating it, since they are potentially expensive (and fragmenting) operations.
Steve S
Developer for hire
|
|
|
|
|
[edit]
I've found that the underlying problem is problem is in the call to DDX_DHtml_Radio in DoDataExchange. The underlying MFC code queries IHtmlElementCollection, which consistently returns NULL. Because of this, the code assumes that the radio button is not in a group and subsequently exits without updating values.
I've seen one comment on the net compaining that IHtmlElementCollection stopped working on XP SP2 (my environment), but I can't find any confirmation that it's a known issue. In any event, the failure to obtain this interface pretty much takes the wheels off the wagon. Any ideas, anyone?
[/edit]
With CDhtmlDialog in VS2003, Class Wizard doesn't appear to support adding member variables wired up to the dialog controls like the CDialog stuff I'm used to. Trying to find sufficient documentation to do it manually has been an all day and fruitless search. The online documentation appears to stop at "here's the class members." No overview on how to stitch it all together.
I naturally searched the CP articles first, but they're all doing various kinds of rocket science and none of the simple stuff. All I need to do is the basic old fashioned dialog stuff, but with an html layout. Add some edit controls & radio buttons, initialize their values in OnInitDialog() and grab their values after DoModal() completes. I mean, how hard could this be?
Does anyone know of any documentation / tutorials anywhere that describes how to do the basic stuff with the html dialog class? I've hit everything from Google to MSDN to CP to VS online help and can't seem to find any straightforward documentation on the basics. I'd be most grateful for any educational resources you might point me to.
The hard stuff is easy, and the easy stuff chews up an entire day...
-- modified at 11:30 Wednesday 30th August, 2006
|
|
|
|