|
hiho@ll
i just need to remove the system menu icon of an dialog, but the dialog must be resizeable using the minimize and maximize button on the upper right of the frame
if i use the options in the resource tab of my dialog the maximize and minimize options get disabled
one solution is remove the system menu icon in the program and enable the option for the system menu in the resource tab or the other solution, add the maximize and minimize button in my code and disable the system menu option in the resource tab!?
but how to do both ways? didn't found anything helpful in the CWnd or CDialog docu
thx@ll
|
|
|
|
|
modify the CDialog::OnPaint() function to change the behavior of your icon painting...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I need to capture Image from devices like digital camera, Webcam, Scaner,etc.
I don't anything about this. Anyone please direct me.provide links, samples if you know.
|
|
|
|
|
Hello Friends,
Please observe the first c++ program
#include <iostream.h>
class ABC
{
public :
void show()
{
cout <<"inside the show function"<< endl;
}
void show2()
{
cout <<"inside the show2 function" << endl;
}
friend void showme(ABC obj );
};
void showme(ABC obj)
{
obj.show();
obj.show2();
}
int main(void)
{
ABC xyz;
showme(xyz);
return 0;
}
Here a single object xyz is as the argument and in the friend function the object call the two member functions which is defined in the class ABC.
Please observe the second c++ program
#include <iostream.h>
class ABC
{
public :
void show()
{
cout <<"inside the show function"<< endl;
}
void show2()
{
cout <<"inside the show2 function" << endl;
}
friend void showme(ABC obj , ABC obj1 );
};
void showme(ABC obj,ABC obj1)
{
obj.show();
obj1.show2();
}
int main(void)
{
ABC xyz,xyz1;
showme(xyz,xyz1);
return 0;
}
In this c++ program two objects are passed as the argument for the friend function.In the main function two objects ie xyz ,xyz1 are passed as the arguments.
Both the program shows the same output.
My question is out of two c++ program , the optimized code is which one. If not the case the two programs how can I write optimised code for the c++ program which is described above.
One more question ? object are allocated space in the memory.when define a class and it members and member functions.Does class have its own memory space as it is with object of class?
Hoping for a reply,
Yours,
Phijo
|
|
|
|
|
hi,
i'm not sure to understand your whole question, but here is what i can say :
first, i cannot see any relevant change btween your two programs, except the fact tha the former has another ABC object. in this case, xyz and xyz1 are two distinct objects, but constructed the same way (that's why the outputs are the same).
i've got a question about your code...
why putting showme() functions as friend
when you have no data members (moreover no protected members) ? this could have been done with external functions because show() and show2() are public .
phijophlip wrote:
My question is out of two c++ program , the optimized code is which one. If not the case the two programs how can I write optimised code for the c++ program which is described above.
i don't understand this question, please reformulate... (what optimization do you want ? mem, speed ?)
phijophlip wrote:
object are allocated space in the memory.when define a class and it members and member functions.Does class have its own memory space as it is with object of class?
that's not exactly like this. data members are allocated in the stack while dynamically allocated datas are in the heap. this way, each object has its own datas, even if they contain the same values as another object.
BUT ! every objects of the same type share the functions of the class. that means that the functions code is written once in the code segment. to determinate which object is calling a function, the functiopn receive an implicite parameter (this ) that points the object. the static member functions have no this pointer, so, they can manipulate only static data members (shared with every objects of a same type).
i know what i explain is a bit deep, but look for these infos if you like to code better...
cheers,
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I have created a pointer of a class in the header file of another class & also, i have initialised a constructor of that class using that pointer, but, in a member function of the class whose header contains the declaration of the pointer.
now i wanna access other functions of the class (whose pointer variable has been defined already in the header file), but the exception is thrown. the message declares it as "Access Violation".
I m working in Visual C++ 6.0.
If any one knows the solution, kindly reply me soon.
Usman Arif
|
|
|
|
|
If you don't post any code, we won't be able to help you...
And what do you mean by:
Usman Arif wrote:
i have initialised a constructor of that class using that pointer, but, in a member function of the class whose header contains the declaration of the pointer
and by:
Usman Arif wrote:
whose pointer variable has been defined already in the header file
If you have an exception that is thrown, it means that your pointer is probably invalid (pointing to 0xcccccc or 0x00000 or something like that...). Have you tried to use the debugger ?
|
|
|
|
|
Dear All!
I am running fullscreen. I show a picture on a other windown. Now i uses windown media show it. i want rotate it, but i can't.
Can you help me.
Thank!
|
|
|
|
|
CExBitmap[^]
Has a rotation function. If you compile it with WINNT31_ROTATE defined it will use the world transforms on Win2000 and above; otherwise it uses DIB data to rotate it.
There are other articles that also have rotation function code:
http://www.codeproject.com/bitmap/[^]
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Hello!
I have 2 programs, one that waits for messages that the other posts for him.
I need somehow to share my handle with the sending application so when I start the program, it will get the handle somehow and post a message to him and so on.
The registry is one way but I don't like,
a temp file is another but I don't like it either...
There's got to be something better and elegant, some function I'm missing
Any ideas?
Thanks.
|
|
|
|
|
I don't know if DDE is still used widely, but you can take a look in the MSDN.
As for the temporary file idea, you can use a CMemFile.
Quote from MSDN: A memory file is useful for fast temporary storage or for transferring raw bytes or serialized objects between independent processes.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
i have made a programe to know the current hardware profile of the system using GetCurrentHwProfile api,At first it does not does not recognize the function in the window.h.And
when i write #define _WIN32_WINNT 0x4000; it gives error in the winbase.h. Please help me out.....
#define _WIN32_WINNT 0x4000;
#include <windows.h>
#include <stdio.h>
#include <tchar.h>
const int HW_PROFILE_GUIDLEN=100;
const int MAX_PROFILE_LEN=100;
typedef struct HW_PROFILE_INFO {
DWORD dwDockInfo;
TCHAR szHwProfileGuid[HW_PROFILE_GUIDLEN];
TCHAR szHwProfileName[MAX_PROFILE_LEN];
} HW_PROFILE_INFO, *LPHW_PROFILE_INFO;
int WINAPI WinMain(HINSTANCE h,HINSTANCE p,LPSTR l,int n)
{
TCHAR szBuffer1[1000];
TCHAR szBuffer2[1000];
TCHAR szBuffer3[1000];
HW_PROFILE_INFO HwProfInfo;
GetCurrentHwProfile(&HwProfInfo) ;
sprintf(szBuffer1, "DockInfo: %s", HwProfInfo.dwDockInfo);
MessageBox(0, szBuffer1, "Dock Info", 0);
sprintf(szBuffer2, "Profile Guid: %s", HwProfInfo.szHwProfileGuid);
MessageBox(0, szBuffer2, "Profile Guid", 0);
sprintf(szBuffer3, "Friendly Name: %s", HwProfInfo.szHwProfileName);
MessageBox(0, szBuffer3, "Friendly Name", 0);
return 0;
}
|
|
|
|
|
I have created an ATL composite control, and am putting it on multiple instances of a modeless dialog box. For each instance of the control I am calling its draw function with different parameters but the multiple instances all display with the same parameters. What is happening and how do I get around this problem.
Esteemed members please help.
Deekonda Ramesh
|
|
|
|
|
Hello All,
I am planning to design my help system for my application. I want to use CHM file format. I am new to this format and I have a basic queries.
Can any body please help me out in this.
As per my understanding CHM is compressed form of HTML. My query is :
"When I will decompress the contents of CHM format will I get my output in HTML format".
Also how to show the final output i.e HTML file, after it has been traced by using CHM file?
Any suggestion about how a help system should be designed are most welcome.
Thanks,
Anukrati.
Pawan agarwal
|
|
|
|
|
could some of you tell me how to put the frames into memory buffer for comparison.....
|
|
|
|
|
Hello Friends,
Can any one tell me what is difference between a friend class and virtual class in cpp?
Hoping for a reply.
Best Regards,
Phijo
|
|
|
|
|
A breif and sketchy answer.
Friend Class:
Take the following simple class:
class A
{
private:
int a, b;
public:
A() : a (0), b (0) { }
};
This class has two private data members. Private means that only methods from that class can access them. Now, say you had anouther class called B that wanted to access those data members. How do you do that without making the members public? Define class B as a friend of class A. Such as this:
class A
{
private:
int a, b;
public:
A () : a(0), b (0) {}
friend class B;
};
class B
{
public:
A Other;
int i;
B()
{
i = Other.a + Other.b;
}
};
You can also have other friends, not just classes. Just remember that only you and your friends are allowed to see your private parts. (lame joke, sorry).
Virtual Classes:
This is slightly more complex. A virtual class is where you define a member function of a class as virtual, which means that if you define anouther class that inherits from that one, it can override that virtual function. If it overrides that function (declaration is identical) then that function is called. If it does not, then the parent classes function is called instead. An example:
class A
{
public:
void Func1 ();
virtual void Func2 ();
};
class B : public A
{
public:
void Func3 ();
virtual void Func2 ();
};
Now, instantiate and object of class B:
B MyVar;
MyVar.Func3 () will call the function "Func3" in class B.
MyVar.Func2 () will call the function "Func2" in class B;
But, if the "virtual void Func2 ()" was missing from class B:
MyVar.Func2 () will call the function "Func2" in class A;
So basically "virtual" means that the function can be overriden.
Anouther use of virtual is a pure-virtual function. That means that it has NO function body, and is just used to define a form for the class. To use the above example:
class A
{
public:
void Func1 ();
virtual void Func2 () = 0;
};
class B : public A
{
public:
void Func3 ();
virtual void Func2 ();
};
Now, if we try and instantiate an object of class A:
A MyVar1;
The compiler will die and say something along the lines of "You cannot instantiate a class with a pure virtual member".
But, we CAN instantiate class B:
B MyVar;
This is really only useful for enforcing functionality in a class.
These are really loose, not too detailed.
Yours,
Blake.
|
|
|
|
|
Hello Friends,
Can any one tell me what is difference between a friend class and virtual class in cpp?
Hoping for a reply.
Best Regards,
Phijo
|
|
|
|
|
|
Mist'Alok is right, you should learn a bit more about the language features itself.
however, i'll try to answer...
friend s functions are made to access to protected members of an object from the outside of it.
virtual functions are a bit more difficult to assimilate.
this keyword is use for inheritance. for example :
<font color=#0000FF>class </font>A {
<font color=#0000FF>protected</font>:
<font color=#0000FF>int</font> m_iData;
<font color=#0000FF>public</font>:
A() {
m_iData = 1;
}
<font color=#0000FF>int</font> Disp() {
<font color=#0000FF>return</font> m_iData;
}
};
<font color=#0000FF>class</font> B : <font color=#0000FF>public</font> A {
B() : A() {
m_iData = 2;
}
<font color=#0000FF>int</font> Disp() {
<font color=#0000FF>return </font>m_iData;
}
}; you could do that to execute :
A* a = B();
printf(<font color=#808080>"%d"</font>, a->Disp()); The output is
1
Now, if A::Disp() had been declared as virtual, the output would be
2
could you understand why ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Can anyone help me with this? I am a total newbie!
Use the MFC Application Wizard to create this program. Add variables and message handlers as appropriate. Your program should graph the sine and the cosine function.
The x axis will start at 0 and end at 2p radian measure. The y axis will run from 1 to –1. The Samples input describes the number of lines you’ll use to draw the function. A small number of samples (indicating a small number of lines) will results in a jagged-looking curve. A large number of samples will result in a smooth-looking curve.
For example, if the user enters 8 for the number of samples , and pushes the Sine command button , you’ll use 8 lines to draw the sine curve. The first line will start at x,y = (0,0) and end at x,y = (p/4, 0.707). See Table.1:
Samples Start End
1 0,0 p/4,0.707
2 p/4,0.707 p/2,1
3 p/2,1 3p/4,0.707
4 3p/4,0.707 p,0
5 p,0 5p/4,-0.707
6 5p/4,-0.707 3p/2,-1
7 3p/2,-1 7p/4,-0.707
8 7p/4,-0.707 2p,0
You can’t literally graph the x,y values in Table.1. You must scale them to match the display that you design. If your y axis is 400 pixels, 200 positive and 200 negative, you’ll need to multiply the y values by 200. The y value of .707, scaled to match the display is .707 * 200 = 141.421. You’ll need to convert this number to an integer (141) to use the Graphic Device Interface.
The user may enter any number between 1 and 100 in the Sample edit control. Your program must dynamically construct and scale the table shown above for the corresponding number of samples. Note that the starting point on the x axis is 0 and the ending point is 2p.
To use the built-in sine and cosine functions, add #include<math.h> to your program. Consult Visual C++ help for additional information and examples.
You may define p as follows:
double PI = 3.1415926535
|
|
|
|
|
Hi,
At work, Visual Studio .NET 2003 has been installed recently.
Today, I have open a project developped with Visual C++ 6.0.
I have to continue this project with Visual Studio C++ .NET 2003.
I am able to compile it in Realease mode.
But when I compile it in Debug mode, the include file "...\Vc7\include\xdebug" has a dozen errors.
I suspect it is a compiler switch that is not well choosen.
Does anybody has suggestions?
Thanks,
Claude
|
|
|
|
|
try to "Rebuild All the project"... that will delete all the *.o files that could be corrupted.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I have written a MFC app in VS .NET using the resource wizard. I added a drop down [ CComboBox ] with 4 strings (using AddString method). When I run the app and try to pull th e drop-down, the window only shows 1 of 4 strings and the scroll bar is tiny... any suggestions pn to solve this problem???
|
|
|
|
|
In the resource wiard, you can click on the srop arrow of the combo box. This should show the extent to which the combobox will drop when clicked in a real window. You should now be able to drag/change the size of the drop list as required in the resource editor as you would when sizing any normal controls.
If you vote me down, my score will only get lower
|
|
|
|
|