|
NO~~~after I delete the funtion Complex::operator-() from the class,the error is the same as before~~~
|
|
|
|
|
Hi,
I simply copied your code and put in an empty project I compiles well would you post the exact error message
|
|
|
|
|
there are four:
error C2248: 'real' : cannot access private member declared in
class 'Complex'
error C2248: 'imag' : cannot access private member declared in
class 'Complex'
error C2593: 'operator <<' is ambiguous
error C2593: 'operator <<' is ambiguous
|
|
|
|
|
By the way,the two previous errors point to the location
"return out<
|
|
|
|
|
Because-because-because you have two different operator << overloads;
friend ostream& operator<<(ostream& out, Complex& c);
ostream& operator<<(ostream& out, const Complex& c)
{
...
}
Their prototypes are different due to the difference inside their parameter list;
in first case; Complex &
in second case; const Complex &
So make them the same; put const in the friend declaration.
--
=====
Arman
|
|
|
|
|
NO~no~no~~I have modified this problem~~but it do noting to the error~
|
|
|
|
|
Chen-XuNuo wrote: I have modified this problem...
To what? By making both the declaration and the definition the same, the compiler error (C2248) will go away.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
What is the size of windows message queue ? i.e how many messages can queue up before the next one being discarded?
And how long can a message stay in the message queue waiting to be processed?
I've been looking all over but haven't found an answer for this ?
|
|
|
|
|
On Windows 2000 message queues defaulted to about 5000 entries which will be there until they get processed, however long it takes. I would guess that the sizes have gone up in XP and Vista and the implementation may have changed. If these limits are causing you problems then may I venture to suggest that you may have deeper problems in your design
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
thanks a lot,
i was wondering about this just for the sake of curiousity. it's really dangerous using a queue without knowing how much it can handle. it's wierd I couldn't found any information about this (which I thing is very important). now i'm so relieved , nobody says a word about it because it's almost limitless
|
|
|
|
|
GameProfessor wrote: it's really dangerous using a queue without knowing how much it can handle
It's also dangerous to make assumptions about the size of the windows message queue.
It's probably best to process the messages ASAP - for your sake and the user's sake
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I am attempt to make my software multilingual.In my application I have used CColorDialog. Now I didn't know how to translate these Common Dialog (CColorDialog / CFindReplaceDialog / CFontDialog / CPrintDialog / CPrintDialogEx) into all kinds of language version.
-- modified at 3:44 Monday 4th June, 2007
|
|
|
|
|
my exe will modify a file, but just only the account which is created by IT dept. of my co. can do that, how can i run the exe with that account while the login account is another?
Thanks!!!
|
|
|
|
|
use runas command .. u can shellexecute runas from your program.
if u want more help type just runas in command prompt window.
If u can Dream... U can do it
|
|
|
|
|
if use "runas", i must input password when system prompt.
But all is transparent to operator , because operator just use my programme to modify files in one computer of domain and he dose`t konw where the file is!
So i must embed the username and password of the domain account created in server in my code!!!
-- modified at 4:39 Monday 4th June, 2007
|
|
|
|
|
if you know the user name and password, you can use the CreateProcessWithLogonW() function.
|
|
|
|
|
You might also want to look into LogonUser() and ImpersonateUser() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
MSDN: "You cannot use LogonUser to log on to a remote computer."
The file i want to modify is in a Server!!!
|
|
|
|
|
zhongwenjia wrote: MSDN: "You cannot use LogonUser to log on to a remote computer."
The file i want to modify is in a Server!!!
It would have helped to state that requirement in your initial post.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i want the reference for the charecter input system function code which is simmilar to windows operating system.
Please give me the reference.
Help Ever Hurt Never
|
|
|
|
|
Care to rephrase?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
hi guys i want some info,
i have CListCtrl. i want to know whicj column has been clicked by user, if user clicked on a particular column header how to know which column it is,
|
|
|
|
|
swarup wrote: if user clicked on a particular column header how to know which column it is
When a user clickes on the header, it will get the LVN_COLUMNCLICK notication. the lparam is a NMLISTVIEW pointer. The iSubItem member of that struct will have the column number
void MyDlg::OnColumnclickList1(NMHDR* pNMHDR, LRESULT* pResult) <br />
{<br />
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;<br />
int nColumn = pNMListView->iSubItem;
}
|
|
|
|
|
Hi,
for the header... I'm not sure, but for normal places... you can check which item (row) is, and compare the subitems (columns).
In any case I recommend you to take a look in the CListCtrl articles that are in the site. They would explain you a lot and maybe give you some idea or direct solution.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Hi all. I'm working on a project to a subject in university and i'm going through a hard time trying in everyway i know and looking out in the net for solutions but i cant figure it out.
So the objective is to mix Visual Basic with a DLL made from C++. with simple functions it works, but now im calling from VB a function in the DLL sending one number and the function should go to the .txt and find the number of the line that number is. as it wasnt working i tryied in a simple c++ project with a main to do a "manual debugging" with returns and printfs. lol so here is the code. (don't mind the includes here, they're just there because they came with the copy-past from the DLL.) btw the most part of this code was copied from the internet and "moulded" to my problem.
#include<windows.h>
#include<stdio.h>
#include<stdlib.h>
#include<stdio.h>
#include<time.h>
#include<fstream>
#include <string>
int escolha_cod(double saldo,int escolha)
{
FILE *codigo;
int i=0,linha=0,j=0,aux=0;
char vec[2];
using namespace std;
string line;
ifstream myfile ("codigo.txt");
if (myfile.is_open())
{
for(i=0;i<10;i++)
{
getline(myfile,line);
const char *c_line;
strncpy(vec,line.c_str(),3);
aux=atoi(&vec[0]);
if(aux==escolha)
{linha=i;
i=10;}
}
myfile.close();
}return 47;
}
int main()
{int var;
var=escolha_cod(10,12);
printf("%d",var);
getchar();
return 0;}
If i put the "return 47;" right after "if (myfile.is_open()){" the printf says: 4403792
any idea? i would really appreciate a quick answer =) thks in advance guys!
|
|
|
|