|
What i mean is, The app i use has a splash screen and a few other startup features. what i want is a way of creating a new windows from the File>New menu item and when another document is opened while the app is still running.
.NET or not .NET? MFC is the question......
|
|
|
|
|
I see... Well, I have no idea myself, but I found this Usenet article that might be of help to you. Good luck!
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hello,
I've got a very simple decision to your problem
Here it is:
void CYourView::OnFileNew()
{
WinExec(AfxGetAppName(),SW_SHOWNORMAL);
}
Add a handler of ID_FILENEW menu from the classwizard in your CView derived class with the above code. Enjoy!
Best regards,
X3m
|
|
|
|
|
now the app keeps re-opening itself and required the PC to be turned off. Is there a way of just re-initialising the main window each time and not the app?
.NET or not .NET? MFC is the question......
|
|
|
|
|
Are you sure you handle OnFileNew in your CView and not in your CMainFrame or CWinApp class?
I have a working code of this if ou wan't I can email it to you?
Best regards,
X3m
|
|
|
|
|
yes if you would do so that would be great. jonathann4@hotmail.com
.NET or not .NET? MFC is the question......
|
|
|
|
|
I sent it to your email.
Best regards,
X3m
|
|
|
|
|
Hi !
I need to check in a C++ app, as precisely as possible, the time spent by the processor in a function.
I have no idea where to start !
Any help will be greatly appreciated !
Jerome
|
|
|
|
|
If you have access to the source code of the program, and the version of your Visual Studio installation is Professional or Enterprise, then you can do a profiling of your code, which gives you more or less accurate summaries of the time spent by the program in each function.
You can start learning about profiling in Visual Studio with Cornell University tutorial Profiling with MS Visual Studio Tools.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi Jerome.
Here's a simple class, it's not my idea, unfortunately I don't know whose copyright it is, I think it's from somwhere at CP:
#pragma once
class CDuration
{
protected:
LARGE_INTEGER m_liStart;
LARGE_INTEGER m_liStop;
LONGLONG m_llFrequency;
LONGLONG m_llCorrection;
public: CDuration(void);
void Start(void);
void Stop(void);
long GetDuration(void) const;
};
inline CDuration::CDuration(void)
{ LARGE_INTEGER liFrequency;
QueryPerformanceFrequency(&liFrequency);
m_llFrequency = liFrequency.QuadPart;
// Calibration
Start();
Stop();
m_llCorrection = m_liStop.QuadPart-m_liStart.QuadPart;
}
inline void CDuration::Start(void)
{ // Ensure we will not be interrupted by any other thread for a while
Sleep(0); QueryPerformanceCounter(&m_liStart);}
inline void CDuration::Stop(void)
{QueryPerformanceCounter(&m_liStop);}
inline long CDuration::GetDuration(void) const
{
return (long)(m_liStop.QuadPart-m_liStart.QuadPart-m_llCorrection)*1000000.0 / m_llFrequency;}
usage e.g.:
CDuration durat;
durat.Start();
FunctionCallToMeasure();
durat.Stop();
long ms_needed = durat.GetDuration();
I think the GetDuration return gives the time in milliseconds. I try to find the docu, then I can tell you more!
Good Luck, Flo
|
|
|
|
|
Thank you a lot for your help !
Jerome
|
|
|
|
|
Hi Jerome
there you find the article, source and demo:
http://www.codeproject.com/cpp/duration.asp
what is your app made for?
mfg HintiFlo
|
|
|
|
|
Thank you for the information !
I'm working on a real-time App, which controls a machine, but we're having problems reaching the required speed of the machine. Thus, I wanted to check where, in the software, we are loosing time ! It's not easy !!!
Tanks again and best regards, (or mfg, should I say !!! )
Jerome
|
|
|
|
|
hi all
i want to read a text file from the sdk dll, the text file is saved at the same path as dll .Basically i want an alternative of App.Path of vb into c++.I have tried getModulefileName and GetCurrentDirectory but in vain.
thanks for stopping by.
cheers
jayant
Jayant Bichhal
|
|
|
|
|
I'm not sure what your problem is. GetModuleFileName returns the complete path of the specified module, so to obtain the path without the name of the module you should do something like:
char strPath[_MAX_PATH];
GetModuleFileName(NULL,path,sizeof(path)/sizeof(path[0]));
char *pSlash=strrchr(path,'\\');
if(pSlash)pSlash[1]='\0'; This gives you the path for the .EXE that loaded your DLL. If what you want is the path of the DLL itself, then replace GetModuleFileName(NULL,...) with GetModuleFileName(hInstance,...) , where hInstance is the hInstance passed to your DllMain entry point.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I am trying to create a child window inside a class. I have the hwnd and hinstance to the main window available to the class. The problem that I am having is that the class needs to handle the WNDPROC for the window. I figure that MFC does something like this, but seeing that we cant view the complete MFC source code, I can't see how it is done there. Anyone have any input?
|
|
|
|
|
From Paul Dilascia's Windows ++
//////
// Now "hook" the window's window proc--i.e., subclass it, saving
// the original window procedure.
//
oldProc = (WNDPROC)GetWindowLong(hwnd, GWL_WNDPROC);
SetWindowLong(hwnd, GWL_WNDPROC, (LONG)theApp->getWndProc());
The book is well worth reading if you are attempting to create your own Windows class framework.
The source-code to the book is available at http://www.dilascia.com/wpp.htm
Michael
|
|
|
|
|
I am working on the MAC address of net boards.
Does the first byte always 00 ?
Is there a signification of each byte or pair of bytes ?
elisabeth.sever@europlacer.fr
|
|
|
|
|
i have seen an application which does not offer the handler of OnChar() in the Scrollview, but it's on effect, when you press down a key. why?
thanks
one is the other who absorbs the thoughts of others
|
|
|
|
|
Hi guys,
i am searching indian reliable programmers, who want to work daily for some hours...
Please reply directly to my email account vikasde@rediffmail.com
Thanx in Advance
Best Regards
Sonu
|
|
|
|
|
Hi,
CodeProject has free section for your purpose, then you can post job offers and it´s free ( and detail it more, which skills and that stuff, take a look at:
http://www.codeproject.com/script/jobs/jobs.asp
Good luck
Braulio
Ps.: By the way I work in a consultancy firm, so if you need some programmers ( well they are not indians, but Norweggian and Spanish, not sooo bad ), ...
|
|
|
|
|
I want to send mail in ATL!Where should I begin?
Thanks
|
|
|
|
|
Can't you use normal Winsock calls?
Connect to some smtp server, and send mail using direct smtp chat.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
|
Hi !
I don´t know if that would work, but IIS includes some COM thing called DONTS, and are some COM objects that let you for exmaple send one e-mail using VBScript and ASP, so if it is going to be in the server side maybe you can use that...
HTH
Braulio
|
|
|
|