|
Prem:
but there is a problem if two or more labels have the same name and if the there is many layers in the tree the search speed will very slow.
thanks anyway.
|
|
|
|
|
Hi,
I would like to get the value of Macros for Build Commands and Properties (e.g. VCInstallDir, VSInstallDir, etc.) for VC.NET from within a VC++ program.
Is that possible? If so, can you please say how.
Regards,
Saayan
|
|
|
|
|
I try to expose an interface using its own coclass in an MFC application with added ATL support.
Unfortunately, it doesn't seem to work in VB. The interface is visible, but it cannot be instantiate.
Do you know what is to be done?
rechi
|
|
|
|
|
There are several possibles here - whats the error being thrown up? (Provide details of your interface too, including details of retval etc.)
Dylan Kenneally
London, UK
|
|
|
|
|
In VB looks like this:
dim ob as TheLibrary.TheInterface
...
set ob = new TheLibrary.TheInterface 'fails here!
In VC++ is just an ordinary interface with coclass associate. Nothing special or suspect.
rechi
|
|
|
|
|
That is strange
Have you tried to access your object through VC++ code? The reason I ask is that this may prove to be more helpful in finding the problem: as you have to do everything yourself, you'll be able to see at exactly what stage the problem occurs.
Dylan Kenneally
London, UK
|
|
|
|
|
Why do VC++/Windows have this differation?
Using VC++, can I just add Windows Cotrols into SDI and MDI by dragging the control itself from the control panel? I have known it can be done to Dialog form.
My quesitons may be making you a bits confused. Forgive me, Please.
DJ
|
|
|
|
|
Dialog Based apps have the entire application out into a dialog, though there might be sub-dialogs.
SDI and MDI are document oriented apps usually. You can save/open stuff. In SDI only one document is open at a time as in Notepad. In MDI you can have multiple documents as in VS.NET.
Now we have a funny kind of SDI/MDI mix in Office 2K/XP where the documents open in separate windows like Multiple SDIs all part of a single huge MDI
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Nish - Native CPian wrote:
Now we have a funny kind of SDI/MDI mix in Office 2K/XP where the documents open in separate windows like Multiple SDIs all part of a single huge MDI
That is part of Microsofts new "Document-centric" model, where the whole philosophy is geared towards the users document rather than the application that they are running. So they want people to refer to the "Word document", or "Powerpoint presentation" rather than the Word application.
BTW, this model is called multi-threaded SDI.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Thanks for the info, Kilowatt!
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
DJ
|
|
|
|
|
Hi,
In a dialog-based application, I need show all
the cd-room drivers with a list control in a computer.
The names of all cd-drive should be inserted into the list-control. When a cd-driver is selected,
it should operate the contents of the cd-room.
How should i do this?
Thanks in advance!
chen
|
|
|
|
|
Hi!
You may use GetDriveType() function to determine drive type.
To get all drives, use GetLogicalDriveStrings() or GetLogicalDrives.
Later, just use FindFirstFile(), FindNextFile(), FindClose() to obtain all file system objects.
Mukkie
|
|
|
|
|
i asked a question refering to why my cin stopped working after the program had looped, my answer was cin.flush();
I applied that line to my code, and the program didnt reconize it,... if this is the way to reinitialize a cin for it works everytime the loop goes through, then why wont it work? is there a required header?
painless see?
thanks!
~SilverShalkin
|
|
|
|
|
I'm sorry, it's cout that requires the .flush();
The reason is that one needs to be cleared before you use the other.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Try with cin.clear() , which should reset cin in case you had a formatting error.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
ok... that makes more sense... cin.clear(); but is that all? the line works but the program comes acrros the same thing... after you insert the GPA of the student "GPA is a float" the program prints the name and the gpa, then it asks for the name again, but when you press enter after the name, the program atomatically inserts the previouse GPA.
thanks again.. "If i figuere it out, ill post "
~SilverShalkin
|
|
|
|
|
That's because of the new line (character "\n") that you entered in previous cin, to fix this problem simply add statement "cin.ignore(1, '\n');" before the second use of cin. Example:
<br />
int x;<br />
float y;<br />
cin >> x;
cin.ignore(1, '\n');
cin >> y;
|
|
|
|
|
Hi, everyone!
In one of my class(CClassA), I have declare a member variable of my B class( CClassB). How to access the CClassA from CClassB?
Best Regards,
Wayne King
20 May 2002
|
|
|
|
|
You'll need to add a pointer to CClassA as a member of CClassB
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Hi, nish!
This is exactly what I did. But I got a lot of compile error.
I found the reason is the header file of class A & B must include each other. During compiling time the compiler seems not able to determine who's who? ( Chick/Egg problem )
Any idea on this issue?
Best Regards,
Wayne King
20 My 2002
|
|
|
|
|
Instead of doing the cross include, do a forward declaration. IF class A needs to know what class B is, and vice versa, simply do the #include in the .cpp files, and in the header, do this
Class A.h
class B;
class A
{
...
and vice-versa.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Christian,
Try your method without success. But later I put class A and class B in the same file. The problem solved.
// Header file:
class A;
class B;
class B
{
A m_variable;
}
class A
{
B m_variable;
}
In the above header file, the sequence is very important. class B must be defined before the class A.
Is it possible to separate class A and class B into different file?
Best Regards,
Wayne King
|
|
|
|
|
It depends on how you're accessing class B. If it's by pointer or reference, then you only need to provide A with a forward declaration of B:
class B;
class A
{
private:
B* m_pB;
B& m_b;
};
This is because you're only declaring B as a pointer or reference, which are always 4 bytes (in Win32), so the compiler doesn't need anymore information to determine the size of A.
If you were going to declare an instance of B directly inside of A, then the compiler would need to know how big B is so that it could add it to A's size. For that, the compiler needs B's definition. So you need to put B's definition on top of A, which is typically done by including the header file where it's defined (B.h):
#include "B.h"
class A
{
private:
B m_b;
};
I hope to have shed some light on this stuff.
Regards,
Alvaro
Insanity: doing the same thing over and over again and expecting different results. - Albert Einstein
|
|
|
|
|
Alvaro,
Thanks very much. Your answer is very informative. It not only solve my annoying problem, it also give me an answer why this thing happen and how to avoid them. Thanks again.
Best Regards,
Wayne King
|
|
|
|