|
Hi,
I have an application that runs using DirectX full screen exclusive mode. Can I launch another program ( which is not using DirectX, say Notepad or Windows Calculator ) into my application's fullscreen mode?
Thank you.
- NS -
|
|
|
|
|
I want to change My Menu Font,But I can Not It.
Please,guide me
|
|
|
|
|
Try using CMenu and CFont classes
Cheers
"Peace of mind through Technology"
|
|
|
|
|
|
Plz See the following Example first.
Class A
{
Void Func(){AfxMessageBox("Function Class A");}
}
int Main()
{
A *pClassA;
pClassA=NULL;
pClassA->Func();
}
The output is a MessageBox displayed:
AfxMessageBox("Function Class A");
Why this output is displayed because pointer has no memory plz explain this behaviour in the context of VC++ 6.0/MFC.Is this compliler Bug or My VC++6.0 is corrupt or any other.....?
Yours Sincerely
Ajmal Siddiqi
ajmalsiddiqui
-- modified at 6:45 Monday 8th May, 2006
|
|
|
|
|
This works because:
- The member function doesn't access any non-static members and thus doesn't use the (NULL) this pointer; and
- Isn't virtual so doesn't use this this to get a vtable pointer during function call.
Steve
|
|
|
|
|
It is because classes don't have their own functions (they is only one function for each instances of the classes, and there is an implicit 'this' parameter that is passed to the function to identify the instance). Thus, the function exists even if the object doesn't exist.
Now, if this function will access one of the member variable from the class, you will get an exception (because member variables are not 'shared') because you are trying to access invalid memory.
|
|
|
|
|
If you look at the assembly code, you'll notice that the call to Func() is the same no matter if pClassA is NULL or not.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
Hi,
Can I initialize a member array of a class from the constructor
class test<br />
{<br />
<br />
int Myarray[10];<br />
test()<br />
{<br />
<br />
}<br />
};
here I want to set the value of all elements in Myarray as 0. Is there any way to do it with out using memset()...?
nave
|
|
|
|
|
dear why do You not use loop to initialize array with ur desired value.
ajmalsiddiqui
-- modified at 6:50 Monday 8th May, 2006
|
|
|
|
|
in normal case
int MyArray[10] = {0};
will initialize all the elements in that array..I just want to know is this possible in the class memebers( using initialization list )
nave
|
|
|
|
|
Naveen R wrote: using initialization list
Initialization list can only be specified when an array is being declared.
Nibu thomas
Software Developer
Faqs by Michael dunn
|
|
|
|
|
I didn't understand? can u plz explain?
nave
|
|
|
|
|
Initializer lists are used in a constructor to initialize members of that class.
Not local variables defined inside a class.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
|
No, I don't think you can ust initializer lists with plain old C-Arrays.
You are bound to use a loop or memset.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
hi all,
I have a dll file named wpdes32.dll for DES encryption/decryption. I need to call this in Vc++ , i couldn't create .def file for this and only know the declaration of functions. How can i call this in vc++??
thanks and regards
jijo
jijo jose
|
|
|
|
|
You can use LoadLibrary[^] to load the dll and then use GetProcAddress[^] to get a specific function (you need to know its name and prototype)
|
|
|
|
|
If that DLL is ATL COM then
with the help of #import directive you can get its methods by creating the instance of the DLL.
Knock out 'T' from CAN'T ,
You 'CAN' if you think you 'CAN'
|
|
|
|
|
hi
I would like to get the list of all available domains on a computer in VC++(either MFC or Win32).
which API do i need to use??
thanx in advance
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
-- modified at 6:50 Monday 8th May, 2006
|
|
|
|
|
For finding the domains you have to use :
NETRESOURCE structure and API's such as:
WNetOpenEnum()
WNetEnumResource()
Cheers
"Peace of mind through Technology"
|
|
|
|
|
<br />
class MyClass{<br />
int N;<br />
int M;<br />
MyClass(){<br />
N=0;
M=0;<br />
}<br />
MyClass(int n){<br />
N=n;
}<br />
...<br />
}<br />
<br />
....<br />
<br />
<br />
MyClass X, Y(3);<br />
In debug mode I saw that in both cases (X and Y(3)) the object is created throw the default constructur (N=0), and after that (only in the Y case) there is a call of the other constructor(N=3).
Is this a standard behaviour of C?
So can I put the default initializations ONLY in the first constructor and be SURE that using other constructor I have always an INITIALIZED object(see the variable M)?
Thanks for your time.
|
|
|
|
|
_Russell_ wrote: In debug mode I saw that in both cases (X and Y(3)) the object is created throw the default constructur (N=0), and after that (only in the Y case) there is a call of the other constructor(N=3).
How did you check that ? For the case of Y(3) the default constructor is not called (only the ctor with a parameter is called). I think you did something wrong while debugging.
|
|
|
|
|
mmm....,
yes: there is something strange!
something doesn't work somewhere in the 'real' code class!
sorry to disturb you!
I have to solve by myself this problem
|
|
|
|
|
Hi boy,
Try my code below, and you will see.
--------------------
#include <iostream>
class MyClass
{
int iA;
int iB;
public:
MyClass() : iB(0) {
std::cout << "MyClass() \n";
}
MyClass(int n) : iB(0) {
std::cout << "MyClass(" << n << ") \n";
iA = n;
}
};
int main()
{
std::cout << "MyClass aa; \n";
MyClass aa;
std::cout << "MyClass bb; \n";
MyClass bb(3);
return 0;
}
Maxwell Chen
|
|
|
|