|
|
Your question is a simple one that if you put any amount of time researching (or buying a book) you would find the answers. Stop asking us to write code for you and do your own homework.
__________________
Bob is my homeboy.
|
|
|
|
|
Hi
I have a dll file.But the interface is in dll also exist in oaidl.h file.Whenever i try to CreateInstance of the interface it recognise the .h file intreface.
How can i resolve ambiguity.
Can i use to namespace of dll file if yes please tell me how?
Thanx in advance.
|
|
|
|
|
I guess that you are talking of a COM-DLL and the #import directive.
In this case you can use the rename attribute. If the COM-DLL already provides a namespace the attribute rename-namespace may be useful, too.
Regards,
Tim
|
|
|
|
|
But sir
The main thing how can i know about the namespace the dll provide ?
|
|
|
|
|
If I remember correctly, the default namespace matches the name of the library.
Use the "OLE/COM Object Viewer" (you find it in the Tools menu of Visual Studio), browse to the according Type Library and open it. Somewhere you will find something like:
[
...
]
library SERVERLib
{
...
}
In this case SERVERLib will be the default namespace.
Regards,
Tim
|
|
|
|
|
hye,
i m making a project in which i have to display video in an edit box....
i have a DVR card but i want to make a separate aaplication using the functions of that card
can anybody tell me the procedure or steps of displaying the video in general.i mean not specific to any software......
pls give me some hints
looking 4 help
NT
|
|
|
|
|
You'd use DirectX to do this ( specifically DirectShow, which is now in the Platform SDK ). Plenty of articles on this on CP and elsewhere.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
actually i want to use functions of my DVR card
the link u suggested is an application
i dnt need code
i need articles which explains how to display video in VisualC++
i want to knw the steps nd functions which i shld include in my code for dispplaying video
looking 4 reply...........
NT
|
|
|
|
|
#include<iostream>
#include<string>
#include<cmath>
using namespace std;
class Complex{
public:
Complex();
Complex(double);
Complex(double,double);
void write() const ;
bool operator==(const Complex& ) const ;
bool operator!=(const Complex& ) const ;
Complex operator-();
friend ostream& operator<<(ostream& out,Complex& c);
private:
double real;
double imag;
};
Complex::Complex(){
real=imag=0.0;
}
Complex::Complex(double re){
real=re;
imag=0.0;
}
Complex::Complex(double re,double im){
real=re;
imag=im;
}
void Complex::write() const {
cout<<real<<"+"<<imag<<'i'<<endl;
}
bool Complex::operator==(const Complex& u ) const {
if(real==u.real&&imag==u.imag)
return true;
else return false;
}
bool Complex::operator!=(const Complex& u ) const {
if(real!=u.real||imag!=u.imag)
return true;
else return false;
}
Complex Complex::operator-(){
real=-real;
imag=-imag;
}
ostream& operator<<(ostream& out,const Complex& c)
{
return out<<c.real<<"+"<<c.imag<<'i'<<endl;
}
int main(){
Complex c1(2.3,5.6);
Complex c2(1.4,2.5);
if(c1==c2) {
c1.write();
c2.write();
cout<<c1<<endl;
cout<<c2<<endl;
}
return 0;
}
I have declared :friend ostream& operator<<(ostream& out,Complex& c);
but why the error says:
cannot access private member declared in class 'Complex'?
|
|
|
|
|
Hi,
Your function declaration has different prototype,
one has const reference other is not const.
Best Regards
Raj
|
|
|
|
|
But after I modified the declaration of the function to const,there are two errors which says that operator<< is ambiguous added ~
|
|
|
|
|
It should work. What's the concrete message of the error?
--
=====
Arman
|
|
|
|
|
No, It should work for the << operator
but shows error for
Complex Complex::operator-(){<br />
real=-real;<br />
imag=-imag;<br />
}<br />
because it doesnot return value.
|
|
|
|
|
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
|
|
|
|