|
DavidCrow wrote:
Are you wanting to know how long an application has been running, or how long the OS has been running?
I want to know that how long my application is running ?
|
|
|
|
|
See if GetProcessTimes() helps.
|
|
|
|
|
Use CTime and CTimeSpan
John
|
|
|
|
|
i do the following to change the font size of my CEdit control.But
it doesn't work well,Who can tell me what's the wrong
BOOL CDlgBase::OnInitDialog()
{
CDialog::OnInitDialog();
CFont *m_Font;
CFont m_newFont;
LOGFONT m_lf;
memset(&m_lf,0,sizeof(LOGFONT));
m_Font = GetFont();
m_Font->GetLogFont(&m_lf);
CClientDC dc(this);
m_lf.lfHeight = -MulDiv( 8,dc.GetDeviceCaps( LOGPIXELSY ), 72 );
m_newFont.CreateFontIndirect(&m_lf);
m_edit.SetFont(&m_newFont);
return true;
}
gucy
|
|
|
|
|
You're must CFont m_newFont move to the header file as global object
Best regards,
Eugene Pustovoyt
|
|
|
|
|
hi :
After i move the CFont declaration out of the function,it works well.
But what i wonder is that i have used these code int the function CMainFrame::OnCreate to change the edit control'size on the toolbar.
i also declare the CFont as local vaiable and it works perfect.
Why i must delare it as global variable here.
gucy
|
|
|
|
|
your code is perfectly working for me.
|
|
|
|
|
As Eugene Pustovoyt said, the font variable needs to be a global variable. It really doesn't matter if it works for you (no offense) or for anyone else. It won't work all the time. MSDN says that the font variable MUST be a global variable and I learned that the hard way.
// Afterall, I realized that even my comment lines have bugs
|
|
|
|
|
I need to strcpy the following phrase (I go "to" school) to a string. I tried the following:
char test[50];
strcpy(test,"I go "to" school");
of course this is wrong!!
Please help!
Thanks in advance
|
|
|
|
|
strcpy(test,"I go \"to\" school");
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Use Escape charater
char test[50];
strcpy(test,"I go \"to\" school");
Best Wishes,
Uma Mahes
|
|
|
|
|
If I have a dll, how can I know if it's a C++ dll or C# dll ? Can I have a C++ access function that allow me to know ?
Thank you for your answer.
|
|
|
|
|
I think you can use Dependency Walker tool. It will show all the
dependency dll. If its a C# dll then MSCOREE.dll should be one of
the dependent. I dont know any C++ function to differentiate the DLL.
Thanks,
Uma Mahes
|
|
|
|
|
Thank you very much Uma, I try with Dependency Walker.
Bye
Andrea
|
|
|
|
|
I have tried with Dependency Walker but I have a problem. I have a C++ dll that include and use a C# dll, so the dll MSCOREE.dll is one of the dependent of C++ dll .... Do you know any other method to resolve my problem ?
Thank you very much
Andrea
|
|
|
|
|
Simple and bestway
Have your own DllGetLanguage function in both the dll.
|
|
|
|
|
I'm sorry but I don't understand the answer. What is DllGetLanguage ?
|
|
|
|
|
I guess both the dll is created by you. so
have your own function in the dll say DllGetLanguage
to identify which language it has been built.
I dont know for what purpose you want this detail.
|
|
|
|
|
SD3 wrote:
If I have a dll, how can I know if it's a C++ dll or C# dll ?
Are both of these written in a .NET language (ie Managed C++ or C#)?
You could try using ILDASM to open both files. If the one is just plain C++, then you won't be able to open it in ILDASM.exe . If it opens, then it is most likely in C# (correct me if I am wrong, but how many people actually use MC++?).
Also, I don't know of a function to do this programmatically.
Hope this helps,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
Thank you for the answer but the test with ildasm is failed. I have a project with dll developed in C++ and dll developed in C# (so for the compatibility I must use Managed C++). I must make a program (C++) that allow me to copy N dll from source directory to destination directory but if I have a C# dll I must put it in the Windows\Assembly (GAC) with the GAC Utility. So I search a safe method to distinguish dll C++ and dll C#.
Have you got some idea ?
Thank you for all
Andrea
|
|
|
|
|
To tell you the truth I have never tried this before but here is an idea. Write a few functions in C# and then write the exact same functions in C++. Compile the code and then dissassemble it. Try to see if you can spot any common patterns that will make you distinguish between C# and C++. On the other hand dissassemble the dll itself and check the functions that it calls. I have never dissassembled anything writen C# so I don't know what the code would look like, but you have to do your own spelunking.
// Afterall, I realized that even my comment lines have bugs
|
|
|
|
|
Dear Friends
With Style WS_THICKFRAME a Button Can be Resized,but I Want Only resizing behavior and not the thick frame.Pl Help Me.............
|
|
|
|
|
I have an SDI project which has a dialog. I want to write the code for one of the buttons (MyButton) in the dialog in CMyProjectDoc class. I can create the function by going to classwizard then selecting the CMyProjectDoc class and then MyButton BN_Click. And clearly I have a function for the button in CMyProjectDoc class (see below).
void CMyProjectDoc::OnMyButton() <br />
{<br />
COtherDlg dlg;<br />
dlg.DoModal();<br />
}
However, there is no communication apparent between the button and the function. That is, I click the button and nothing happens. Does anyone know why?
Thanks,
Ruben
|
|
|
|
|
Hi Ruben,
I have a few question
1. Why you need to Create DialogBox in Document Class?
Its always advice to separate Document and view (or
dialog) classes. You Can Move that code to CMainFrm class
or CMyProjectView Class.
2. How did you create OnMyButton function in CMyProjectDoc Class
using class wizard?. I think you can't assign Dialog box button event
to document Class.
Thanks,
Uma Mahes
|
|
|
|
|
one possible reason is that you have a handler for the same button in your view class.
|
|
|
|