|
this is the easiest way to place an icon on a button:
// Button = m_SafeButton
// Icon = IDI_FLOPPY
m_SafeButton.SetIcon(AfxGetApp()->LoadIcon(IDI_FLOPPY));
m_SafeButton.EnableWindow( true);
that´s all.
Hans
|
|
|
|
|
i am using NtQuerySystemInformation() from NTDLL.
my worry is whether this function will be supported in future versions of Windows.
isn't XP the next version of Win2k and ME that of Win9x??
i am unfamiliar with Windows Architecture...could someone help me out??
|
|
|
|
|
I want to control word through the interface the word provided. But I found some problems. I found not all the controls such as buttons, comboboxs are window control. They don't have the window handles. But I want to process some messages it sended. you can found this through spyxx.What can I do?
thanks to all the programmers who have helped me.
|
|
|
|
|
How on earth do you presume to have found that a button or combobox in Word does not have a HWND associated with it ? I believe Word does not use MFC, ( so no CWnd ), but I can't see how it could possibly show you a button without it being a window, with a handle.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
How on earth do you presume to have found that a button or combobox in Word does not have a HWND associated with it
He's probably thinking about Word toolbars - the comboboxes and buttons you can see there aren't real tax-paying, HWND-having windows.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I want to use my own dialog to control word. for example, I want to control the "insert -> index and content" dialog in my code. So I can send a message to set the checkboxes status. But i can't get the checkboxs' window handle now.
thanks to all the programmers who have helped me.
|
|
|
|
|
What are you trying to make Word do? Which controls/windows are you trying to control?
You seem to be approaching this from a strange angle. What do you want to achieve?
Michael
|
|
|
|
|
to be simple, I want to create a word document with my own format. And I will provide some dialogs to let people coustomize the format. so have to use some word's automation interface. But when a dialog of word do modaled, I can't get the status untile the dialog ended. for example, in the dialog "insert -> index and content" there are some check boxes, and i want to set the check boxes' status in my code. what can I do?
thanks to all the programmers who have helped me.
|
|
|
|
|
Hello, the codegurus around the world.;)
It seems that you want to use some functionality of Word.
We can use Word Automation to access all Word functionality in our application.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
right! But when the dialogs of the word show modal, I can't use the interfaces, I have to waiting for the user to select an item. How can I do it automaticly?
thanks to all the programmers who have helped me.
|
|
|
|
|
I need in my application to resize at each step of a for loop 2 arrays. I have read that for reallocate memory, it's better to use <vector>, rather than use the definition of the usual pointer. But, as i'm a beginner in this kind of knowledges, i would like to know if someone could explain me how i could declare 2 arrays, with 2 differents size, so that at each step, as i use an iterative method, one of this array "becomes" the other.
thanks in advance
gerald
|
|
|
|
|
I presume you said it's better to use <vector> ? You can get vector to preallocate the memory so that push_back doesn't reallocate every time. If the two vectors are going to be different sizes, how will one 'become' the other ? You're going to copy some values across but not all ? The vector being copied to grows ? I'm confused....
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
As i said, i use an iterative method. In a for loop, for example consider: for(i=1;i<=n;i++)
At the beginning i would declare 2 pointers:
double *Qi1=new double [ni1]
double *Qi=new double[ni]
So, if you consider that i correspond to a date, Qi is a pointer on an array which contains ni+1 values at date i and Qi1 a pointer on an array which contains ni1+1 values at date i-1.
In fact, to calculate the value on the array pointed by Qi, we need to know the values at date i-1. After, we have calculated the values, we need to go to the next step, and calculate value at date i+1, so that Qi "becomes" the preceding array, so i have to consider that values in Qi have to be put in Qi1.
|
|
|
|
|
Your explanation and code fragment are a little confusing, perhaps posting a more detailed code fragment would make it clearer.
Michael
|
|
|
|
|
double *BermudanSwaption::Tab_Alpha(COleDateTime StartDate,COleDateTime SwaptionEndDate,COleDateTime SwapEndDate,int TypeOfStep,int NumberOfStep,int BaseAnnuelle,int JMax,int dt,double dr,double M,_variant_t RateTable,_variant_t VolatilitySurface)
{
//comme pour le calcul du nombre de périodes, on suppose les
//dates deja ajustées. De même le nombre de pas est deja calculé
//et passé en paramètres
//double *Qi1,*Qi;
double Alpha;
int i,j;
int ni,ni1;
COleDateTimeSpan span_dt;
//on veut retourner uniquement la branche basse de l'arbre, c'est
//à dire que pour chaque i, l'état j vaut 0.
span_dt=dt;
Alpha=-log(ZeroCoupon(StartDate,StartDate.operator +(span_dt),SwaptionEndDate,SwapEndDate,BaseAnnuelle,RateTable,VolatilitySurface))/dt;
*pTab_Alpha=Alpha;
for(i=1;i<=NumberOfStep;i++)
{
if(i
|
|
|
|
|
double *Qi=new double[2*ni+1];
double *Qi1=new double[2*ni1+1];
*Qi1=1;
for(j=0;j<=2*ni;j++)
{
*(Qi+j)=Arrow_Debreu(i,j,JMax,dr,dt,M,Alpha,Qi1);
}
Alpha=Alpha_i(StartDate,SwaptionEndDate,SwapEndDate,BaseAnnuelle,RateTable,VolatilitySurface,i,JMax,dr,dt,Qi);
*(pTab_Alpha+i)=Alpha;
for(j=0;j<=2*ni;j++)
{
*(Qi1+j)=*(Qi+j);
}
delete[] Qi;
delete[] Qi1;
Using vector you can do this easily. I still don't understand why you are doing this exactly, but using vector you could do the same thing by using the copy algorithm, with a back_inserter if need be, or just as a copy of the second vector is less than or equal to the first. Either way, allocating the vector size first would stop messy memory allocation stuff going on as you continually push_back.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
We are trying to create a flash support player using DirectX/DirectDraw/DirectShow (Win32API/COM/VC++). Is it possible to create any DirectShow filters which support flash or any flash rendering into DirectDraw surface.
1)Whether DirectX/DirectDraw/DirectShow supports Macromedia media flash files?.
2)If so, what are the codecs available for flash.
3)How to implement Flash support using DirectShow/DirectDraw/Direct3D
4)What are the minimum requirements like OS/software/Tools/Hardware needed?.
5)Is there any other solutions/workarounds to achieve the Macromedia flash support in DirectX.
Kamlesh
|
|
|
|
|
Flash has it's own SDK, and I believe is also an ActiveX control ( not sure about that, but on my PC I can add Macromedia Flash Factory object as a registered control ). Have you looked at the Macromedia site ? There is also a web site for flash developers, I don't know the URL but search in Australia for David Mitchie and you will find it.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I want an source code for real time graph plotting for discrete event simulation project. I u have any then please send me as early as possible. OR if u know about any resource for concerned project then let me know.
Imran Farooqui
|
|
|
|
|
Check article Plot Graphic Library in OpenGL section.
Jonathan de Halleux, Belgium.
|
|
|
|
|
Hello,
I want to made my application to behave in such a way that when i change the color of one view in MDI application i want to redraw all the MDI windows. Is there is any way to do this.....
Thanks in advance....
J. Peter.....
|
|
|
|
|
Look at CDocument::UpdateAllViews. You could record the color change in the document and the call UpdateAllViews using a private hint value. In all the views let the OnUpdate handler do an Invalidate() when lHint == YourPrivateValue.
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Thanks for the reply...
Actually i have created many child windows using the architecture (i have MDI application) i have each separate view with the its own document and this view/ document i have loaed in to a new frame...
i want to update these frames ......
|
|
|
|
|
Put a function in the app class that iterates through all of the doc templates, and iterates through all the documents for each template and call UpdateAllViews(NULL) for each document.
void CMyApp::UpdateAllViews()
{
POSITION posTemplate = GetFirstDocTemplatePosition();
while (posTemplate)
{
CDocTemplate* pTemplate = (CDocTemplate*)GetNextDocTemplate(posTemplate);
POSITION posDoc = pTemplate->GetFirstDocPosition();
while (posDoc)
{
CDocument* pDocument = pTemplate->GetNextDoc(posDoc);
if ((pDocument=) != NULL)
{
pDocList->UpdateAllViews(NULL);
}
}
}
}
|
|
|
|
|
Thanks for the Reply....
I was alos following this approach but it is not working as i again used this way to solve my problem......
|
|
|
|