|
There is a CWnd member called RepositionBars. You can call it like this:
CRect a_oRealClientArea( 0, 0, 0, 0 );
pYourFrameWnd->RepositionBars( AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0, CWnd::reposQuery, &a_oRealClientArea, NULL, FALSE );
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|
|
That's just perfect Chris, thanks a lot
It is working very nicely now
|
|
|
|
|
No problem, I'm glad to hear it's working!
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|
|
hi..
Is there any function in vc++ for getting the harddisk serial number ?. Can anyone help me..pls it's urgent
|
|
|
|
|
Use the GetVolumeInformation API function!
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Im developing a Application which looks like the Windows Explorer..Left Side view is a Treeview and righ side view is a Form view.
I have a implemented a Find Functionality to search the nodes in the tree wrt to node text in the tree view.The problem is that when i find the particular node I call
<br />
treectrl->SelectItem(hItem)<br />
Becos of this OnSelchange event is called and so the coressponding rightside view is displayed..My problem is that to use Find Next again my treeview should be active but that is not the case.So to enable Find next i have to click in treeview to make it active and so that the menu is also enabled...
Is there any way to overcome this problem....(ie)After onSelchange event i want again my tree view to be active for further tree operations.
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|
|
My initial thought is that it might be better to avoid activating the right-side at all after searching, rather than having it activate and then deactivate. If you could store a flag value somewhere, that indicates whether a node selection was caused by your find function, you could check it in your OnSelchange event, and avoid activating the right-side there. I would also think you might always want to keep the treeview active while the user works in it, just as you mentioned, since most applications work that way. Sounds like you might need to focus on the OnSelchange event.
Cheers
|
|
|
|
|
Well Ur sugession was Good and it solved the problem of doing Tree operation..
Now i just have a small hiccup...
When During Find if i find the correct node then i have to activate the right view...But the problem is Onselchange event is not firing if i call
<br />
treectrl->SelectItem(hItem)<br />
after reseting the flag.....Even if i PostMessage(TVN_SELCHANGE) also..No use..
So... any idea
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|
|
When you say you need to "activate" the right view, do you mean you have to fill it with information, or that you have to set the focus on it, or both? I do not know what kind of control(s) you have in the right view, but it should be possible to fill the controls with information, and yet avoid moving the focus to a control in the right view.
|
|
|
|
|
I want to Display the Right side view For the corresponding Node..So it means I have to Fill the Right side view with the data's....
My class will handle the filling if i can just display the Right side view.
Im handling the Filling of data in the InitialUpdate of that View class..
So I just have to fire that OnSelchanged() event in the tree..
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|
|
Hmmm... I assume you verifed that manually selecting a node with the mouse fires OnSelchanged(), so this is puzzling. Did you check if hItem is valid? Is it possible that OnSelchanged() is being called, but that it is not doing what you need? I also assume you sent the TVN_SELCHANGED message within a WM_NOTIFY message (with the NMTREEVIEW and NMHDR structures filled-in validly), and that it was sent to the window that owns the treeview.
Forgive me, but I usually find it is the tiniest mistakes that cause such problems, which are often missed the first time the code is checked. It is hard to guess without seeing the actual code...
|
|
|
|
|
(I'm sorry to post it again but I'm in a hurry. I'd like to know how I do that?)
I want to modify or set global printer setting.
1) Enter to Control_Panel -> Printer
2) right click on printer list and change setting
but I want to set from visual c++
How can I do that ?
Thank in advanced for your kindness
|
|
|
|
|
I've been to CodeGuru, I feel dirty. Google was how I found this link:
http://www.codeguru.com/printing/SetPrinter.shtml[^]
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
I want to change properties in global printer setting. I don't want to change default printer.
Please help me
Thanks in advanced
|
|
|
|
|
What does 'global printer setting' mean ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Hi again
I want to print from a command line program like this
C:\print_job.exe "My Printer" job_file
so the command line program will print that use global printer setting (system printer setting)
the meaning of global printer setting is something like this
1) Enter to Control_Panel -> Printer
2) right click on printer list and change setting
Please help me
Thank you so much for your kindness
|
|
|
|
|
What you're saying makes no sense. ALL printers are visible globally, if you have more than one then one must be the default, and there fore the one you print with. You want to change things like which pages you print and the page alignment ? The CPrintDialog does that, I am sure.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Hi again and again
More detail:
I have some limitation this
1) I have C:\print_job.exe in binary file so I can't modify print dialog that you mention it above
2) so if I run command c:\print_job.exe "My Printer" job_file. It'll print to "My Printer" and use global "My Printer" setting
3) so I must write another application to motitor print_job.exe process and check paper_size on job_file and then modify global "My Printer" setting
4) I try to use OpenPrinter , DocumentProperties and SetPrinter but It doesn't work. I can't set paper size to printer setting
I try level 2 (Printer_info_2) , level 8 (Printer_info_8) and level 9 (Printer_info_9). It doesn't work all
Am I miss understanding (windows printer concept) ?
How could I do ?
Please help me
Thank you so much for your kindness
AhMan
|
|
|
|
|
AhMan wrote:
I have C:\print_job.exe in binary file so I can't modify print dialog that you mention it above
It's a class, you create it and set the options you want. You don't need to interact with a window.
AhMan wrote:
global "My Printer" setting
ARGH !!!!! There is NO global printer setting !!!! The ONLY thing you can mean here is the default printer.
AhMan wrote:
check paper_size on job_file and then modify global "My Printer" setting
You want to modify the page size for a print job, there is nothing global about it.
AhMan wrote:
Am I miss understanding (windows printer concept) ?
Yes.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Just starting to "fool around" with ActiveX controls...
Is it possible for a method to return a pointer to an object? The only ActiveX return type I see that looks reasonable to use is LPUNKNOWN, but I run across all kinds of problems when trying to use it. I'll keep researching, and reading about methods, but if someone can point me in the right direction, I'd appreciate it.
For the sake of discussion, assume my ctrl class has a member variable of...
CMyClass *testptr;
CMyClass has been dynamically allocated in the ctrl, and I want the container to have access to it. Is this possible, or is it a violation of ActiveX design standards?
Thanks.
|
|
|
|
|
Most of the third party ActiveX components I work with return VARIANT , whuch I then access it's particular data member and then cast it to the proper data type. I think this is mainly for compatibility with, well... *whispers* vb
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
work_to_live wrote:
Is this possible, or is it a violation of ActiveX design standards?
it's bad design. the proper way is to expose a bunch of get/set or property members that operate on CYourClass. 1. in general, you can't be sure that the container is a C++ app (maybe in a limited use sense you can, but in general it's a bad assumption) 2. you can't assume your object will even be in the same memory space as the container (same assumption as above).
-c
Please stand by
|
|
|
|
|
Point well taken... More specifically, what I want to do is make an array of chars available to the container. As I mentioned before, I'm just starting to look into ActiveX, so my questions obviously expose my inexperience. Continuing with your suggestion, how would you expose an array of chars to a container? BTW, I'm using Visual Studio 6.0, and after doing some research, found that there is a valid return type of byte * that was in error left out of the VS products. Oh well, I'll continue my... studies tomorrow.
|
|
|
|
|
work_to_live wrote:
how would you expose an array of chars to a container?
i think a SAFEARRAY is the standard way of doing this. if it's just an array of chars, you might also be able to sneak it in with a BSTR, but that's not polite.
-c
Please stand by
|
|
|
|
|
I tried the impolite method, since it seemed more straight forward, and I wanted to make some headway... But it may have bitten me.
As I mentioned before, I have a method that wants to return some binary data to a container. The method was created with a return type of BSTR. Here's the last few lines of code that I used to copy the char[] into the BSTR...
// fill a BSTR with the char array
(p_allchars is a pointer to a binary character array)
(totalchars = the number of chars to copy)
BSTR bStr = SysAllocStringByteLen(p_allchars,totalchars);
// delete the allchars variable, now that the data is in bStr
delete[] p_allchars;
return bStr;
When I look at the result in MFC's Control Test Container, it's garbage. I think I misused SysAllocStringByteLen, but I'm not sure. Any hints?
I'm getting an uneasy feeling that I need to read up on UNICODE and related operations...
|
|
|
|