|
Easy question i think. I want to implement a custom control that contains an image, two radio buttons, and a combo box. I have two ways in my mind (or maybe 3 if i consider the ActiveX case...):
1) Use the resource editor and create a borderless dialog with these controls and then attach multiple instances in a dialog box using create method
or
2) Create a new class extending, say CWnd that dynamically adds these controls.
What is correct way (in the sence: what the "professionals" do)?
I have implement the first way successfully but i don't know if is the right technique...
Thanks.
|
|
|
|
|
/* Ok Here is the jist of what this program is supposed to do:
This program checks "database.txt" for the text "New String"
which is in the string name "string". If found it will say so.
If it goes through the entire file without finding the text,
it is then supposed to say it has found a new string and then
append the text "New String" to the end of the file. This code
is error free. Only problem is that it doesnt write the text to
the file, anywhere. If someone can tell me why I'd love to know,
because I cannot figure out why. Thanks */
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
int checkdatabase(int x, std::string current, std::string string)
{
fstream stream("database.txt", ios::in | ios::out | ios::app);
if (!stream)
{
cout << "Cannot Open database" << endl;
return 2;
}
while (std::getline(stream, string))
{
x++;
if (current == string)
{
std::cout << "string #" << x << " Found: " << string << std::endl;
stream.close();
return 0;
}
}
x++; std::cout << "***New String Found*** " << "#" << x << ": " << current << std::endl;
stream << "String" << endl;
stream.close();
return 0;
}
int main()
{
std::string current = "New String";
std::string string;
int x = 0;
checkdatabase(x,current,string);
return 0;
}
|
|
|
|
|
Hi,
I took tried ur code. Seems that fstream is havin some prob. I tried with a different stream for writing after closing the current stream and it worked !. ie added the following code after stream.close();
fstream stream2("database.txt", ios::in | ios::out|ios::app );
stream2 << current << endl;
stream2.close();
This means that the first stream is having some problem
Sujan
|
|
|
|
|
Thank you sujan, that did work.
That makes me wonder why the first stream didnt work? If it did get corrupted like you said.
Funny thing, before I posted this I did try where I closed the original stream and then reopened it again and it still didnt work.
Go figure!
|
|
|
|
|
Based on Sujan's comment, could it be that getline() is positioning the file pointer past the end of the file such that the append operation fails?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I have an application developed using CRichEditCtrl, how can line numbers be added into such an application.
The cursor should not actually come to the part where the line numbers are displayed.
|
|
|
|
|
I want to know how to use API:TransmitFile to transfer a file from sever to client.please give me a example or some codes,thanks a lot
|
|
|
|
|
Have you seen the Pinball and Pop3 examples on MSDN?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
thanks for your answer,I haven't seen those exmaples,could you give me a URL?
|
|
|
|
|
http://msdn.microsoft.com/library/en-us/vcsample98/html/vcsmppinballinternetserverextensionthatprovidesgraphicsredirection.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcsample98/html/vcsmppop3sample.asp
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I must download all the VC6 samples? can I only download the sample of pop3 or pinball?thank you very much
|
|
|
|
|
Hello,
I am developing a new product and I often find myself asking if I should use this control or the other... Is the use of many DialogBox better of one single multipage one? Should I place a lot of comments inside Dialogs to help users to understand the meaning?
I know that it's all very subjective but does exist a definitive Windows UI Style Guide to give my product the best/modern look & feel?
Thanks,
Alberto Bencivenni
devDept Development Team Leader
Topology Optimization | Finite Element Method | Cad/Cam | OpenGL | Programming
|
|
|
|
|
|
I gave a look, but did't find any modern approach to UI design...
Did I miss something?
Alberto Bencivenni
devDept Development Team Leader
Topology Optimization | Finite Element Method | Cad/Cam | OpenGL | Programming
|
|
|
|
|
Alberto Bencivenni wrote:
...does exist a definitive Windows UI Style Guide to give my product the best/modern look & feel?
Have you seen this one?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Thanks David...
...but this guide does not contain suggestions, only explanations...
Nothing that suggest the best way connect with Windows users?
Maybe something more close to "usability tests"?
Cheers,
Alberto Bencivenni
devDept Development Team Leader
Topology Optimization | Finite Element Method | Cad/Cam | OpenGL | Programming
|
|
|
|
|
There is no best way -- UI design is really an art.
My best recommendation to you, is just do your best. Then budget some time into your project for Usability/UI review.
Find a few people in your target market, ask em to use your product without any coaching or documentation -- see if they can figure it out. Video tape them doing that....
The adjust it and try again.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
Peter,
In general do you prefer SDI or MDI applications? I remember to read in the past that microsoft suggest SDI model because for the users is more easy to understand.
If only I could find that URL... It was something from microsoft...
Thanks,
Alberto Bencivenni
devDept Development Team Leader
Topology Optimization | Finite Element Method | Cad/Cam | OpenGL | Programming
|
|
|
|
|
I prefer SDI.
Use MDI only if you have no other choice. There aren't that many MDI applications out there anymore. Excel and Visual Studio are good MDI applications, but in that sense MDI makes good sense.
Word is no longer MDI. Why? Because it doesn't make sense to edit unrelated documents in the same window....
For Excel, MDI makes a little more sense -- as does in Visual Studio.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
Alberto Bencivenni wrote:
...but this guide does not contain suggestions, only explanations...
Hmmm, it suggests that:
Buttons be 14x50 DLUs
4 DLUs be used to separate buttons and controls
Small toolbar buttons be 16x16 pixels
A group box be used to group related controls
Vertical fields should be aligned by their left edges
Command buttons should be aligned at the top right
Every file your program creates should have a registered file type
Copying files into the Windows folder or its System subfolder should be avoided
When you design for network access, support standard conventions such as UNC
Abbreviations be avoided unless the abbreviated form is as familiar to your users as the full word or phrase
One of two styles of capitalization be used: book title, or sentence-style
Numbers be aligned at the decimal point
Icons should be supplied in 16-color and 256-color versions
A pointer's hot spot location should be intuitive
...
A book you might consider is here.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi
I have a CButton on a dialog. On click of the button, I want to create another dialog and poisition it just below the CButton. I tried using GetWindowPlacement on click of button on the first dialog and SetWindowPlacement in OnInitDialog function of the second dialog, but I am not able to position the second dialog correctly. Can anyone please help me to do this.
Thanks
Madhavi.
|
|
|
|
|
SetWindowPos() may be better.
moreover, use a CRect to get the position of you button like this (thanks to Chris Maunder for his Unclickable button[^]) :
CWnd* pParent = GetParent();
<font color=#0000FF>if</font> (!pParent) pParent = GetDesktopWindow();
<font color=#008000>
CRect ButtonRect; <font color=#008000>
GetWindowRect(ButtonRect);
pParent->ScreenToClient(ButtonRect);
CPoint Center = ButtonRect.CenterPoint(); <font color=#008000>
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hi Cpians,
In one of my project, I need signed Key Algo. As crypto always go miles over my head. So if any provide me nice pointer or source code.
Let me explain looking for this type of thing. Using user name (any name) I generate the Key, that key I verify in the component with Public key. If it is ok, I will allow user to use my Component.
Here only I looking for some algorithm where I can put private Key & Username and in return it give me User Key, Public key.
Any Help is Greatly Appreciated
-----------------------------
"I Think this Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Currently I have a call back function that will send info from the library to the application throughout a certain period of time. The problem I've encountered is that there is no reaction on the button that is base on the application.
On Visual C++ 6.0, how to I identify a user who is having what kind of privileges? (i.e admin privilege, etc)
|
|
|
|
|
max_gundam15 wrote:
On Visual C++ 6.0, how to I identify a user who is having what kind of privileges? (i.e admin privilege, etc)
this api will help you NetUserEnum
-----------------------------
"I Think this Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|