|
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"
|
|
|
|
|
Thanks, this is a convenient function i didn't know about yet, however i still would like to know how to make my own components (if thats possible anyways...)
Kuniva
--------------------------------------------
|
|
|
|
|
Select File | New | MFC ActiveX ControlWizrd, create the ActiveX control. When the compiler compiles it, the last thing it does is register it as an ActiveX component, which also includes it as a component. Thats the easy part. The hard part is creating the ActiveX control! There's a tutorial in MSDN (Circie) that is a simple illuratration of how to do that. There are also whole books devoted to this topic.
|
|
|
|
|
Hi - I'm not really familiar with internet programming, so here it goes:
I'm looking for a way to 1. ping a machine to see if it responds, and 2. determine the speed of a internet connnect (via code, of course).
Can anyone point me somewhere or give me an idea?
Thanks!
Marcus Spitzmiller
|
|
|
|
|
Here's a snippet using the WININET function "InternetCheckConnection"
It accesses the function dynamically in case WININET.DLL is not installed
on their system:
typedef BOOL (WINAPI* PFNINTERNETCHECKCONNECTION)(LPCSTR,DWORD,DWORD);
HMODULE hWinInet=LoadLibrary("WININET.DLL");
if (!hWinInet) throw runtime_error("drats. no IE installed?");
PFNINTERNETCHECKCONNECTION pInternetCheckConnection=(PFNINTERNETCHECKCONNECTION)GetProcAddress(hWinInet,"InternetCheckConnectionA");
if (!pInternetCheckConnection) throw runtime_error("argh!? what?!");
const char* URL="http://thoseguys.whoiwannacheck.com";
bool bConnected=pInternetCheckConnection(URL,FLAG_ICC_FORCE_CONNECTION,0);
As for determining speed, It'd not be generally nice to take
the time to accurately determine that initially.
Better to simply ask for it or determine it as one goes along
performing transfers or what have you...
|
|
|
|
|
Thanks! Do you happen to know about determining the connection speed, too? I'm interested to learn this stuff, but I need to do a quick proof of concept.
Marcus Spitzmiller
|
|
|
|
|
kick a timer off and see how much data you get in that time interval ... data / time = speed -ish
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
I wouldn't trust timing transfers to determine speed
since you just can't tell what else may be using
the bandwidth or holding it up. There is some maximum
transfer rate, some average rate, and then there is
what you happen to get at some time. I suspect that
the "what you happen to get" value changes a lot and
won't tell you the maximum transfer rate without a
good sample period. And a good sample period translates
into a hassle if this is supposed to be an easy to get
setup value... That's probably why most apps just ask
for it...
|
|
|
|
|
I agree and got to thinking the same thing. I think it's not too bad to ask once and remember it, rather than try to guess and get it wrong everytime. Thanks for the help!
Marcus Spitzmiller
|
|
|
|
|
I uesed all three of strcmp(),CString::CompareNoCase() and CString::Compare() methods. They all give me same answer, that is "Vicki 46_p.txt" is larger than "Vicki 460_p.txt". Why is that?
but without using the program and view that tow files in window explore give you different result. if you right click sort by name will give you "Vicki 46_p.txt" on the top. I mean, let's say, I have both files in a: dirve. you go to mycomputer, right click , explore, a:, and then right click, choose arrange icon, by Name. then you will see Vicki 46_p.txt is above of the file name Vicki 46_p.txt.
<br />
int i = strcmp("Vicki 46_p.txt","Vicki 460_p.txt") ;<br />
if(i<0)<br />
MessageBox("Vicki 46_p.txt is smaller");<br />
else if(i>0)<br />
MessageBox("Vicki 46_p.txt is larger");<br />
|
|
|
|
|
I believe the way those string compare functions work is to go character by character through the string until one character in the first string is greater or less than the corresponding character in the comparison string. Each character corresponds to an ASCII integer value, which is what the comparison is based on. In your example, both strings are the same up to the 6. At that point, it compares the '_' against the '0'. '0' has a lower ASCII value than '_', so it returns "Vicki 46_p.txt" as greater than "Vicki 460_p.txt".
I'm not sure why Explorer sorts them differently. Microsoft probably wrote their own sorting method that parses the strings differently.
|
|
|
|
|
yeah.. right! that's what i had in my mind too. but I though '_' has lower ASCII than '0' though.
thank you
|
|
|
|
|
If you look at an ascii chart, or print their decimal values, "0" = 48 and "_" = 95.
|
|
|
|
|
You can read both files into two data structure and then compare the two variables.
Kuphryn
|
|
|
|
|
two datastructure? what do you mean?
|
|
|
|
|
In terms of data structures, I mean you can store file data into two data structures such as a character array, string, vector, link list and the like.
You used strcmp, but then direct the parameter to two files. I am not sure if strcmp can open two files on its owns.
Kuphryn
|
|
|
|