|
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
|
|
|
|
|
Thank you!! I guest to a wizard-newbie, this was inobvious...
|
|
|
|
|
I have a dialog box that I'd like to dismiss if the user clicks anywhere outside of it. How can I determine if they do that?
|
|
|
|
|
try SetCapture() and release capture.....
hope that helpz.....
cheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
I thought about that. Actually, I tried it and then ran Spy++ on that dialog to see if it received any additional messages. It didn't appear to.
I guess I'll code it to see - I presume I'd do SetCapture and then add a PreTranslateMessage handler to watch for a WM_LBUTTONUP event?
(This really shouldn't be so difficult!)
Thanks (nice signature, BTW).
Tommy
|
|
|
|
|
u can put the SetCpture code in the OnInit() function .....remember to put the ReleaseCapture() when th exit of the dialog is called.....
NOTE.....
When CWnd no longer requires all mouse input, the application should call the ReleaseCapture function so that other windows can receive mouse input.
happy programmin.....
cheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
After looking at various articles returned by a search for inline assembly, I'm still no closer to a well defined answer.
I'm trying to convert several functions to inline assembly and haven't found any good info on how to handle parameter passing, into the function and returning to the caller.
Can anyone direct me to any good online articles that deal with MSVS and Inline Assembly specifically? I've got plenty of info on external Win32 programming, but nothing really detailed about MSVC and inlining asm. The "Art of Assembly Language" is a great resource for either external (then linked) code or writing Windows apps entirely in asm. I'm trying to incorporate the two.
thanks gang.
Glenn
Unix Systems Programmer
|
|
|
|
|
quantum69 wrote:
Can anyone direct me to any good online articles that deal with MSVS and Inline Assembly specifically?
Have you tried MSDN?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Look up "__asm blocks" in the MSDN; specificaly "__asm blocks, in functions".
Prefer
__asm
{
}
to
__asm code
__asm code
__asm code
because every time you see __asm, some register data is pushed onto the stack, similar to a function call.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
I've read all of that, both my local copy of MSDN and the latest online MSDN. I'm talking about how parameters are handled in the stack and returning values. There is a "Playing with the Stack" article here on CodeProject, but he goes off into some tangents after glossing over the initial stack setup. Looking at source code listings generated from VS gives a prologue and epilog that isn't described anywhere in MSDN (online or otherwise).
The default prologue (regardless of parameters that I've seen) is:
<br />
00000 55 push ebp<br />
00001 8b ec mov ebp, esp<br />
00003 83 ec 40 sub esp, 64 ; 00000040H<br />
00006 53 push ebx<br />
00007 56 push esi<br />
00008 57 push edi<br />
00009 8d 7d c0 lea edi, DWORD PTR [ebp-64]<br />
0000c b9 10 00 00 00 mov ecx, 16 ; 00000010H<br />
00011 b8 cc cc cc cc mov eax, -858993460 ; ccccccccH<br />
00016 f3 ab rep stosd<br />
The standard push'ing of necessary registers isn't at issue. The reasoning VC skips 64 bytes (the sub esp,64) isn't discussed. Then the hop of stack with the "rep stosd" loop to fill in 16 double-words... again, no docs even touch this. Because EBP = ESP after the first push, the "lea edi, DWORD PTR [ebp-64]" points back to the beginning of the skipped area, then the "rep stosd" fill loop of "CCCCCCCCh". No params were transfered and yet it set aside these 16 dw's for some purpose? No MSDN or online resource I've located so far gets anywhere near the specifics of this. That's what I'm looking for. ASM is easy, but finding out how to shoehorn VC to perform even rudamentary tasks is a real pain.
Anyone here ever done much inline assembler? I'd like to open a dialog with you to discuss the mechanics of this.
thanks.
Glenn
Unix Systems Programmer
|
|
|
|
|
ok definatly a noob here and i think google is about ready to bann me from anymore searchs.
i am looking for a program or src files that i can use to hook my mouse into altering its movement upon clicking the left button.
essentially what this would do is....i click the left mouse button and the cursor on the screen would move in the oposing direction.ive tried a few different proggies but they will not let me move in both the X and Y direction nor will it let me move in a negative direction.i wnt the program to believe the mouse is always at a zero location untill the left mouse button is pushed,then move the mouse to both -X and -Y settings,then upon release believe itself to be at a zero location again basically ressting itself.
any help with where to look,what to use or what does this already is greatly appreciated.i do alot of SP gaming and this,as you would guess it,will conteract my recoil from weapons.
thanks again,this site is very useful.
|
|
|
|
|
I'd start here if I where you: Hooks and DLLs
[^]
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
appreciate it.....my eyes burn in my sleep already from reading that.
didnt know if there was already something taht would control mouse movements and i could change to make it move a direction i want.im actually looking to move the mouse in a negative direction at a selected speed.
thanks again tho.
|
|
|
|
|