|
Thanks a lot!
That helped me and it solved my problem...partially.
I explain: when I click the dialog button, now, everything is ok. I get the good window pointer etc...Fine.;)
I call this sollution "from dialog to CView".
Now I have the other problem "From CView to dialog". A modeless dialog is open and displays automatically some info of the current active topmost CImageView. What I need is to automatically maintain the current CImageView pointer and notify the dialog when this pointer changes. For example, when the user closes a CImageView window (and assuming there are several open CImageView and other CView windows) I'd like my dialog to be automatically notified by the new CView window and if it is a CImageView window the dialog should update its info.
It is longer to explain than to see, but I'm sure you get it.
Thank a lot in advance
Guy LECOMTE
|
|
|
|
|
Hello,
who can explain me the following problem :
I have a dialogbox where I display a movie and receive sometimes Windows messages from others applications, everything's perfect. But when I stop my movie and start again another one I don't receive any longer my windows messages ...
It's like if theses messages don't come to my window !
Thanks a lot for help and have a nice evening,
alain
There is no way to happiness, happiness is the way !
|
|
|
|
|
Ok....forgive my ignorance...I'm a relative newbie in VC++....I've done a little, but that's about it.
I have a dialog/propertysheet that has 3 tabs (propertypages). When it comes up it is on the first tab. If I click on the third tab, I get an error during one operation because its trying to access a control within the 2nd tab's window and apprently it doesn't instantiate until clicked on.
If I click on the 2nd tab first, then run that operation, it works like a champ. But if not, the pointer to that propertypage is still null.
How can I instantiate that propetypage when the program starts up, regardless of whether it was clicked or not. If there's a way, I may as well instantiate all proppages at once.
Any suggestions are appreciated.
|
|
|
|
|
If you are setting the property sheet up correctly then they should all load with no problems at all. If you are just clicking on the tab itself and you're running into problems, then something is wrong with the way you added pages to the property sheet. Maybe if you posted a code snippet of when you instatiate the property sheet, it would help.
As far as the problem with the third tab error, you can't access a control on the other tab. It's exactly the same as having a dialog that's not open yet. The control isn't there, so you can't access it.
Hope that helps. Can't really tell you much more since I don't know exactly what you're doing.
|
|
|
|
|
Mike Danberg wrote:
As far as the problem with the third tab error, you can't access a control on the other tab. It's exactly the same as having a dialog that's not open yet. The control isn't there, so you can't access it.
Hope that helps. Can't really tell you much more since I don't know exactly what you're doing.
Well....I was trying to find a way to make sure the dialog "was there" so I could access the control.
Here's more on the problem (fixed now btw) just for information...I couldn't post a code snippet as it is a work project (IP and all that crapola ya know).
It is a power pnael interface for a test station and one tab is a "health monitor" and the two other are two seperate "power" panels for powering up power supplies. The health monitor needs to inactivate monitor controls for power supplies that are not powered. the logic was there for them to safely not run, but I wanted to make the controls visibly disabled to show that they weren't evens selectable while power supplies were not powered up (checkboxes).
However, OnSetActivate() was just the trick I needed (and didn't know). I overrode that function and now when that tab is pressed (instead of during the other tab's processing), I can deactivate the controls.
Thanks.
There are only 10 types of people in this world....those that understand binary, and those that do not.
|
|
|
|
|
Hi,
I am trying to use thread sync functions such as CCriticalSection or CMutex and the compiler just don't recognize them ?
Should I #incluede anything speciel ?
This is a standrd wizard generated dialog app.
BTW, I do get a warning like this one, is that the reason :
LINK : warning LNK4089: all references to "SHELL32.dll" discarded by /OPT:REF
This warning didn't break or hurt anything els
Thanks,
Shay
|
|
|
|
|
Is this an MFC application? If not then they will not work...
If so then you must use the following include:
#include <afxmt.h>
John
|
|
|
|
|
Bingo !
Thanks a lot.
I was sure this will be included in MFC by default.
Shay
|
|
|
|
|
Hi,
I used CDialog in a com ( atlCom dll) . When exiting dlg.DoModal() i have assertion failure.
The assertion is in CWnd::DestroyWnd (Assert(m_hWnd == hWndOrig)in Wincore.cpp line 986.
Thanks ahead.
|
|
|
|
|
Hi!
I have a dialog based application..using MFC in Visual C++ .Net.
I don't really know how to use the
#using namespace System::security::cryptography;
when I add the above #using statement in my code.. I got error..
what should I add/do inorder to use the member functions of cryptography class ?
Thank You
|
|
|
|
|
I do not believe that this works with MFC. It may be possible to use it if you are compiled with CLR and use MC but I am not sure. I do know if you write a C# application and then you can use
using System.Security.Cryptography;
John
|
|
|
|
|
Not a suprise, I would expect it to do that. If you want a different size, try setting it as rect instead of using it as a bitmap container and then draw the bitmap youself in the OnPaint. That should work.
If it does not work then just use the rect as a location marker (mark it as invisable), then get its location and draw your own rect and bitmap in the OnPaint.
INTP
|
|
|
|
|
Have you tried resizing the control after you have created it. Use SetWindowPos or MoveWindow
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)
|
|
|
|
|
instead of using SS_BITMAP use SS_BLACKFRAME
THEN PLACE UR BITMAP ON TO THE FRAME....
IT OUGHT TO WORK.....
cheerz.....
|
|
|
|
|
Hey,
I ve created a static control to show the bitmap, But the size of the static control changed according to the size of the bitmap.
I tried the following
m_staticPreview.Create( NULL, SS_BITMAP |
SS_REALSIZEIMAGE , CRect( 0, 0, 600, 800 ), this );
But the result remains the same
Any another way to make its size fixed?
Thanks in advance
shijuck
|
|
|
|
|
I imported Windows media player 10 in my application
i used the "Put_URL" to play mp3
but when i use the "EndofStream" Event of the OCX
it doesn work
does any one have idea how to solve this
|
|
|
|
|
Code does math calculations twice, gives exponential when amount is 1,000,000 and does not exit when n is entered for continuance. I would also like to know how to create this so the person using it could print the output.
// RWA's and Charges
#include <iostream>
using std::cout;
using std::cin;
using namespace std;
//using::endl;
int main()
{
int choice, c;
float amount,total,fee;
char choice3 ='y';
while(choice3=='y'|| choice3=='Y')
{
cout << "\nChoose from options below.\n";
cout << "\nEnter 1 to calculate total RWA cost.\n";
cout << "\nEnter 2 to calculate RWA base estimate.\n";
cout << "\n\t\tEnter your choice, then press the enter key:";
cin >> choice;
if (choice == 1){
cout << "\nEnter RWA Base Estimate, then press the enter key:$";
cin >> amount;
fee = amount * 0.04;
cout << "4% Management Fee:$" << fee <<"\n";
total = amount + fee;
cout << "Total:$" << total <<"\n";
if (total >= 1 && total <= 2499 ||total >= 1 && total <= 2,499)
{
cout << "Overhead:$" << total*0.1 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.1) <<"\n";
}
if (total >= 2500 && total <= 9999 ||total >= 2,500 && total <= 9,999 )
{
cout << "Overhead:$" << total*0.09 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.09) <<"\n";
}
if (total >= 10000 && total <= 24999 ||total >= 10,000 && total <= 24,999)
{
cout << "Overhead:$" << total*0.08 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.08) <<"\n";
}
if (total >= 25000 && total <= 49999 ||total >= 25,000 && total <= 49,999)
{
cout << "Overhead:$" << total*0.07 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.07) <<"\n";
}
if (total >= 50000 && total <= 99999 ||total >= 50,000 && total <= 99,999 )
{
cout << "Overhead:$" << total*0.05 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.05) <<"\n";
}
if (total >= 100000 && total <= 299999 ||total >= 100,000 && total <= 299,999)
{
cout << "Overhead:$" << total*0.03 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.03) <<"\n";
}
if (total >= 300000 && total <= 999999 ||total >= 300,000 && total <= 999,999)
{
cout << "Overhead:$" << total*0.015 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.015) <<"\n";
}
if (total >= 1000000 && total <= 2425000 ||total >= 1,000,000 && total <= 2,425,000)
{
cout << "Overhead:$" << total*0.005 <<"\n";
cout << "Total Obligation:$" << total + (total * 0.005) <<"\n";
}
}
if (choice == 2) {
cout << "\nEnter Total RWA Cost, then press the enter key:$";
cin >> amount;
fee = amount * 0.04;
cout << "4% Management Fee:$" << fee <<"\n";
total = amount - fee;
cout << "Total:$" << total <<"\n";
if (total >= 1 && total <= 2499 ||total >= 1 && total <= 2,499)
{
cout << "Overhead:$" << total*0.1 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.1) <<"\n";
}
if (total >= 2500 && total <= 9999 ||total >= 2,500 && total <= 9,999 )
{
cout << "Overhead:$" << total*0.09 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.09) <<"\n";
}
if (total >= 10000 && total <= 24999 ||total >= 10,000 && total <= 24,999 )
{
cout << "Overhead:$" << total*0.08 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.08) <<"\n";
}
if (total >= 25000 && total <= 49999 ||total >= 25,000 && total <= 49,999)
{
cout << "Overhead:$" << total*0.07 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.07) <<"\n";
}
if (total >= 50000 && total <= 99999 ||total >= 50,000 && total <= 99,999 )
{
cout << "Overhead:$" << total*0.05 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.05) <<"\n";
}
if (total >= 100000 && total <= 299999 ||total >= 100,000 && total <= 299,999)
{
cout << "Overhead:$" << total*0.03 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.03) <<"\n";
}
if (total >= 300000 && total <= 999999 ||total >= 300,000 && total <= 999,999 )
{
cout << "Overhead:$" << total*0.015 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.015) <<"\n";
}
if (total >= 1000000 && total <= 2425000 ||total >= 1,000,000 && total <= 2,425,000)
{
cout << "Overhead:$" << total*0.005 <<"\n";
cout << "Spendable Amount:$" << total - (total * 0.005) <<"\n";
}
}
cout <<"********************************************************************""\n";
cout <<"***** Rate Range Subtotal Max. Range *****""\n";
cout <<"***** .01 .1 $2,499 $250.00 $250.00 *****""\n";
cout <<"***** 0.09 $2,500 $9,999 $675.00 $675.00 *****""\n";
cout <<"***** 0.08 $10,000 $24,999 $800.00 $1,200.00 *****""\n";
cout <<"***** 0.07 $25,000 $49,999 $1,750.00 *****""\n";
cout <<"***** 0.05 $50,000 $99,999 $2,500.00 *****""\n";
cout <<"***** 0.03 $100,000 299,999 $6,000.00 *****""\n";
cout <<"***** 0.015 $300,000 $999,999 $10,500.00 *****""\n";
cout <<"***** 0.005 $1,000,000 $2,425,000 $7,125.00 *****""\n";
cout <<"********************************************************************""\n";
cout<<"Would You Like to Perform Another Calculation (Y/N)?";
cin>>choice3;
}
//return 0;
cin >> c;
}
|
|
|
|
|
Assuming you mean printing the output on a printer, I would suggest looking in the articles under the Printing section. I've never done any printing outside of an MFC app, so I can't help you much.
There may be some easy way of printing from a console, but I couldn't tell you what it is. The articles provide some good starting points, but judging from the simplicity of your application its probably more work than its worth.
|
|
|
|
|
Have you tried to use cin.ignore() after getting the input from keyboard (especially number/decimal)?
eg.
cin >> choice;
cin.ignore();
Cheers...
Samin Thomas
|
|
|
|
|
Hi all
i have
void MyDialog::OnButton56()
{
CTrailView *pView = (CTrailView *)((CMainFrame*)GetParent())->GetActiveView();
pView->SendMessage(WM_KEYDOWN, 56, 1);
pView->SendMessage(WM_CHAR,56,1);
pView->SendMessage(WM_KEYUP, 56, 1);
}
void MyDialog::OnButton57()
{
CTrailView *pView = (CTrailView *)((CMainFrame*)GetParent())->GetActiveView();
pView->SendMessage(WM_KEYDOWN, 57, 1);
pView->SendMessage(WM_CHAR,57,1);
pView->SendMessage(WM_KEYUP, 57, 1);
}
void MyDialog::OnButton48()
{
CTrailView *pView = (CTrailView *)((CMainFrame*)GetParent())->GetActiveView();
pView->SendMessage(WM_KEYDOWN, 48, 1);
pView->SendMessage(WM_CHAR,48,1);
pView->SendMessage(WM_KEYUP, 48, 1);
}
where my dialog box is created in the frame and i am getting the pointer of view from
CTrailView *pView = (CTrailView *)((CMainFrame*)GetParent())->GetActiveView();
but i a creating it in each and every fuction which i don't want to do so i was trying to create in the Dialogs constructor so that too it to the CWnd pointer which is parent for all what do i needto write in the constructor ofthe dialog
MyDialog::MyDialog(CWnd* pParent,CWnd* pView)
: CDialog(MyDialog::IDD, pParent)
{
//pView =(CTrailView *)((CMainFrame*)GetParent())->GetActiveView();
}
Request to all to continue this
|
|
|
|
|
Tripura.K wrote:
CTrailView *pView = (CTrailView *)((CMainFrame*)GetParent())->GetActiveView();
What is this? It is a guess based on the knowlege that only a certain view type will be a parent to this dialog.
It also suggest.........(never mind)
MyDialog::MyDialog(CWnd* pParent,CWnd* pView)
: CDialog(MyDialog::IDD, pParent)
{
}
MyDialog::MyDialog(CWnd* pParent,CWnd* pView)
: CDialog(MyDialog::IDD, pParent)
{
m_pView = pView;
}
Simplify... all the function do the same thing.
void MyDialog::MyButton(TCHAR ch)
{
}
void MyDialog::OnButton56()
{
MyButton(56);
}
void MyDialog::OnButton57()
{
MyButton(57);
}
INTP
|
|
|
|
|
Hi, I have a dll that runs as a process via dllHost.
So i do not have a main app, just a dll.
My problem is i need to know when a Windows Shutdown event is being fired. I've never had this problem before because all my apps have a main window and receive this notification. However the dll just keeps working and terminates in an undetermined state.
I can't have the dll called from an app. I have no alternative but to use what i've got.
how can i register to receive a WM_SHUTDOWN event from my dll?
Please don't suggest i change the design of the solution. I'm confined to what i have.
thanks in advance
Carl
|
|
|
|
|
Yeah Create a dummy window in your dll ,i think rest is understoond to you.
you have to do little bit multi threading here.
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Creating a dummy window is not possible in this app.
|
|
|
|
|
Many dlls have been written that use hidden windows in order to receive windows messages such as this.
Why is it not possible for you to do this within your DLL?
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)
|
|
|
|
|