|
It is casting the return value of AfxGetApp() from a CWinApp* to a CLASendMailApp* so that the LoadSettings() method can be accessed.
In the past, I've always added this to my app's .h file right below the class declaration so that I did not have so many of those casts staring at me:
#define GetSendMailApp() (((CLASendMailApp*)AfxGetApp())) Then to use it:
CLASendMailApp* sendmail = GetSendMailApp();
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
David if I were to look this up in the MSDN would it be pointer casting or just casting?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Tom Wright wrote:
if I were to look this up in the MSDN...
Like this?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
no more like the stuff you mentioned earlier. Casting pointers. I just wanted to read more about it.
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
In an MFC MDI app, I need to determine the ordering of open documents, based on the z-order of the associated views. I tried using GetFirstDocPosition() and it's associates, but it turns out that only gives me the order in which the documents were opened (which is the same as the order typically displayed in the "Window" menu). What I need though is the order in which the documents are in the z-order (like if you cycle through them with CTRL-TAB).
I know this is possible, the VC.NET 2003 IDE shows the "Window" menu in this order, I just can't figure out how it's done.
Any ideas or directions I can look?
-----
In the land of the blind, the one eyed man is king.
|
|
|
|
|
You'll need to enumerate the MDI child windows. Have a look at GetWindow( GW_HWNDFIRST / GW_HWNDNEXT ) and GetNextWindow() and also EnumChildWindows ().
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
That looks like exactly what I was looking for.
Thanks a bunch!
-----
In the land of the blind, the one eyed man is king.
|
|
|
|
|
int a,b,c,d;
a= (m_num1+7)%10;
b= (m_num2+7)%10;
c= (m_num3+7)%10;
d= (m_num4+7)%10;
m_enum1=a;
m_enum2=b;
m_enum3=c;
m_enum4=d;
here is the code i used to get the modulus the problem is the when the value of m_num1 is 1,2,3,4 it produces the answer 8,9,0,1 respectively.
|
|
|
|
|
mytz wrote:
it produces the answer 8,9,0,1 respectively.
what do you think it should be?
8 % 10 = 8
9 % 10 = 9
10 % 10 = 0
11 % 10 = 1
that's correct
Image Toolkits | Image Processing | Cleek
|
|
|
|
|
And what is wrong with those answers!
8 % 10 = 8
9 % 10 = 9
10 % 10 = 0
11 % 10 = 1
All correct!
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
the results are correct; the modulo is the remainder of the division.
(1 + 7) / 10 = 0 + 8
(2 + 7) / 10 = 0 + 9
(3 + 7) / 10 = 1 + 0
(4 + 7) / 10 = 1 + 1;
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
why is it that 11%10 the answer is 8.it display the answer not the remainder?
thanks...!
|
|
|
|
|
|
Hi,
I am facing one problem in compiling a VC++6.0 project.
I have to build a EXE project, and it uses only C files. ( Not C++ ).I
require to build the EXE project in VC++ 6.0 version, and I am getting
the following error.
"C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE\afx.h(15) :
fatal error C1189: #error : MFC requires C++ compilation (use a .cpp
suffix)"
Error executing cl.exe.
Please help me out, if anybody knows its solution.
Appreciate your comments/reply regarding this problem.
Thanks
vikram
|
|
|
|
|
vikram yadav wrote:
I have to build a EXE project, and it uses only C files.
Which means you cannot use MFC.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
You've created the project as an MFC project instead of a generic application.
So the compiler is looking for your "stdafx" files. You probably want to create a non-MFC project...a simple Win32 application.
Try running AppWizard again, selecting the "Projects" tab. Under there, pick "Win32 Application". Set your directories and project names, etc. and finish running through the wizard. Once the project is built, copy all of your original source code into the new diretory, and "Add Files to Project..." to include your original files.
Hope it helps!
Bob Ciora
|
|
|
|
|
what is the command use to get the modulus of a number?
|
|
|
|
|
The modulo operator is the % symbol.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
4 % 3 = 1
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I have a second thread in my application, created like this:
Thread* secondThread;<br />
ThreadStart* second = new ThreadStart(this,my_method);<br />
secondThread = new Thread(second);<br />
secondThread->Start();
This thread does not close when I close down the application.
I tried with "Abort".
I guess I need some try-catch, but sot sure how to use it...
tried with this in the generated dispose method...
try{<br />
secondThread->Abort();<br />
}<br />
catch(char* szException){}<br />
components->Dispose;
...this didn´t work.
Any suggestions as to how to close the thread. (doesn´t need to be "proffesional" as I´m just building a test app with really dirty coding...)
Also...is the creation of the thread the "best" way to create a thread (I have seen a couple of different solution, though this was the one that I found easier imediately.
regards,
doneirik
|
|
|
|
|
Try ExitThread or TerminateThread but read the doc before you use it!
|
|
|
|
|
See here.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi, I'm not sure if this is the right place to ask such a question, but I couldn't find a DirectX forum.
Is it possible (and how?) to add several audio files to one filter graph which already contains a video file and control their volumes independently?
As far as I understand is the "IBasicAudio Interface" only able to control the entire volume of the graph? I couldn't figure out how to access the DirectSound Interface from the filter graph.
Or do I need to construct a second graph and synchronize the playback of the two graphs?
Any help would be great!!!
Thanks,
Knut
|
|
|
|
|
I need to display two "nested" controls side by side. The main control e.g. CCustWnd constains another CMembWnd control as a member variable. It is not problem to display the main CCustWnd control however I don't know how to display the member control CMembWnd which is created dynamicaly when the main control is created . Probably the member control is clipped by the main control. I played for while with styles without any results. Probably it is not problem to display the member control inside the area of the main control however I need to display the member beside the main control (out of its drawing area) .
Is it possible at all? If so how?
Thanks,
|
|
|
|
|
What parent window are you using when creating the CMembWnd? How are you creating CMembWnd in code?
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|