|
Thank you very much. Your approach works, and I also ran into http://www.codeguru.com/mfc/faq/comments/485.shtml, so the issue is resolved. Much appreciation for your testing!
Thanks,
ns
|
|
|
|
|
I have a CTreeCtrl. There are many many children of the root, and many children of those children and many children of those children and so on. I was wondering if there is a way to find out which position that a selected item is at. I currently get the parent of the parent of the parent and so on until I get a NULL. Is there an easier way?
-Raffi
|
|
|
|
|
What do you mean by "Selected Position".
Normski. - Professional Windows Programmer
|
|
|
|
|
Hi
I try to find informations which can help me to create a simple app (with VC++ 6.0) which invite another user (connected on a network) to reboot his PC...
Can somebody help me?
In advance thank you...
Hello World!!!
from Raphaël
|
|
|
|
|
Something like this:
bool CCyberPC::ShutDown(LPCTSTR szMsg, bool bReboot)
{
if( m_strComputerName.IsEmpty() )
return false;
CString msg;
if (szMsg)
msg = szMsg;
else
msg.LoadString(IDS_SHUTDOWN);
BOOL bResult = InitiateSystemShutdown(
(LPTSTR)(LPCTSTR)GetPCAddress(),
(LPTSTR)(LPCTSTR)msg,
10,
TRUE /*bForceAppsClosed*/,
(int)bReboot
);
return bResult ? true:false;
}
Hope this helps.
Andres Manggini.
Buenos Aires - Argentina.
|
|
|
|
|
Thanks...
That's work for my own PC (locally thus) but when I use it to another IP adress (from my network) that doesn't work : bResult is false...
I think that comes from Privilege, but I'm not sûr.
See : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/Security/authorization_functions.asp
Hello World!!!
from Raphaël
|
|
|
|
|
Yes, you'll need Administrator permissions to reboot another machine.
Andres Manggini.
Buenos Aires - Argentina.
|
|
|
|
|
For the last week or so, my Visual Studio 6.0 decides to shut itself down in the middle of a debugging session. Both the VS and the program I'm debugging gets killed instantly and I'm looking at my wallpaper all of a sudden. Had this ever happened to anyone ?
Funny thing is the exact same thing happened to a co-worker today.
|
|
|
|
|
Suicidal not suidical
|
|
|
|
|
What OS? Do you have the latest service pack (5) installed?
- Shog9 - Aaah... It's time to relax. You know what that means: a glass of beer, your favorite ergo chair... And of course, The Code Project loaded on your Personal Computer System. So go on, and indulge yourself, put your feet up. Lean back and just enjoy the articles. After all, CP sooths even the savage
|
|
|
|
|
Win XP and SP5
Very weird problem
|
|
|
|
|
I have an aboutBox. It's a simple CDialog we all
know and love.
I can color the background of the aboutBox using
OnCtrColor(). In the resource editor, I notice
faint, light blue lines that surround the aboutBox with about a half-inch indentation. I
saw in a program the other day white background
coloring up to those blue lines, then the
standard grey that surrounds it and a border. How
can you make it fill the background of a CDialog
up to the light blue lines?
Please, any response anyone can give me will be
greatly appreciated. I tried changing various
settings in the dialog resource, but nothing
worked.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
I read the article N-Tier application using Managed C++ and ASP.NET - A Tutorial
By Ranjan Banerji
that can be found at the address: http://www.codeproject.com/dotnet/N_Tier_Web_Service.asp
Everything worked smoothly, and it introduced me very well on the web-services with SQL world.
What I want to know is how I can build a client using C++.
How I manage the data in the DataSet?
The function in the WebService returns a DataSet, how I get the data out of it and fill, let's say, an edit control with those data?
Thx!
"Nelle cose del mondo non e' il sapere ma il volere che puo'."
|
|
|
|
|
This is frustrating. I want my controls to be in certain places so I eyeball them and place them on the form. Now when I run the MDI project, these controls dont show up exactly as I placed them and theres all sorts of spaces that I dont want. For example, I want an oK button at the very right hand edge of the form. I draw it there. But its shifted inward (by a lot!) when it runs. So my designtime layout doesnt look like the runtime layout. I need to get a grip on this urgently.
Thanks in advance
ns
|
|
|
|
|
I used Brian harts code (modified) to make the CForm dialog fit the frame and resize with it . Its here in code project. I suspect that I have to some coding to keep my controls at their design time locations. I thought i'd create them dynamically with the constructor and create and all that so i can position them , but I'm not sure what to fill the rect structure with so they move along with the frame.
any ideas?
|
|
|
|
|
Hi,
I need to make my app be 800 by 600 pixels when it starts up. Its an MDI with CFomViews that are tailored to fit exactly into the mainframe and resize with it. I dont know if thats relevant info.
Thanks ,
ns
|
|
|
|
|
Use ResizeParentToFit(FALSE) in the OnInitialUpdate handler of your views.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I am missing the point. I want the mainframe to be 800 600 pixels on the screen when the app starts up. I am happy with the fact that my CFormView fits exactly.
|
|
|
|
|
I think I have to do d=something like:
// Size the window to 1/3 screen size and center it
cs.cy = ::GetSystemMetrics(SM_CYSCREEN) / 2;
cs.cx = ::GetSystemMetrics(SM_CXSCREEN) / 2;
cs.y = ((cs.cy * 2) - cs.cy) / 2;
cs.x = ((cs.cx * 2) - cs.cx) / 2;
Thanks.
ns
|
|
|
|
|
I create frame with possibility four views.
but for four views used two scrollbars. Using two scrollbars very difficult scrolling in each view. May be use two scrollbars for each view. But i dont no how. Please help.
Code for create splitter
return m_wndSplitter.Create(this,
2, 2,
CSize(10, 10),
pContext);
PS each view inheritance from CScrollView.
|
|
|
|
|
Hi All. I'm building an app that graphs data and am looking for clean, professional, 3d-looking icons. I tried making my own in Photoshop, but they turn out kind of cheesy. Icon art seems to be somewhat of a mystical talent. I've searched the Internet far and wide to no avail. Most of the stuff I found was cheesier than what I made myself. (and that doesn't speak for much) The tools will include Zoom, Autoscale, Statistics, Overplot, Calculator, and all kinds of data smoothing FFT and signal manipulation. I am always searching for that elusive little detail that embellishes the sweet smell of professionalism, and any suggestions will be greatly appreciated.
~tia!
Nitron
_________________________________________--
message sent on 100% recycled electrons.
|
|
|
|
|
Some rules i observe:
1. icon consists of no more then 3 objects
2. there is one main object
3. use standard icons for standard actions (cut, copy, paste, etc)
and common consideration:
use standard colors (red - emergancy, error, caution; green - success)
but i, personally, do not draw icon. i prefer that designer do it
|
|
|
|
|
That's pretty much the size of it, i'm afraid. You have four choices:
- Use (potentially crappy) free icons
- Steal nice-looking icons from commercial software (bad idea if you plan to distribute your program)
- Learn to draw your own icons
- Pay someone who is good at it to draw icons for you
I have to admit, i do a fair amount of icon work, and the icons i draw are at best mediocre quality. One of my brothers, after a rather short period of time becoming used to the software, is able to draw quite nice looking ones. So i've a feeling there's only so far you can go without a hefty heaping helping of pure Natural Talent. But, you can always try, it's rather fun IMHO.
- Shog9 - Aaah... It's time to relax. You know what that means: a glass of beer, your favorite ergo chair... And of course, The Code Project loaded on your Personal Computer System. So go on, and indulge yourself, put your feet up. Lean back and just enjoy the articles. After all, CP sooths even the savage
|
|
|
|
|
When you go to Project>Add to project>Components and controls you can choose from a variety of C++ components (no Active-x) which are apparently just blocks of code which are added to your project. Now my question is: how do i make these components myself so they appear in the folder when you add a component. (when i go to the folder in explorer there's nothing there so i'm guessing it is filled at runtime)
Anyone know how to?
thanks in advance
Kuniva
--------------------------------------------
|
|
|
|
|
If you just want to add a class from one of your projects into the gallery, in the Class View tab, right-click the name of the class, and select "Add To Gallery"
|
|
|
|