|
Is there a way to use the following code with createprocess to startup another application and place it into the current applications child window?
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
IDR_MDIWITTYPE,
RUNTIME_CLASS(CMDIWithExeDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CMDIWithExeView));
AddDocTemplate(pDocTemplate);
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
m_pMainWnd = pMainFrame;
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
if (!ProcessShellCommand(cmdInfo))
return FALSE;
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
Chris
|
|
|
|
|
Hi guys,
what is the best methods to hunt for the memory leaks?
thanks
|
|
|
|
|
Kleser wrote: best methods to hunt for the memory leaks
See here
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Use the debugger, it will show you where the memory was allocated and give you a dump of the values. If it was a string, this is REALLY helpful. A bitmap, less so
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
Hello everyone,
I forget how to use the two tricks in Visual Studio debug mode,
1. What is the short-cut for run to cursor (or run to current line) command?
2. How to modify the value of some variables during debugging?
Any recommended reading materials are welcome.
thanks in advance,
George
|
|
|
|
|
George_George wrote: 1. What is the short-cut for run to cursor (or run to current line) command?
Ctrl+F10
George_George wrote: 2. How to modify the value of some variables during debugging?
Alt+F10 to apply code changes.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thank you _AnShUmAn_!
regards,
George
|
|
|
|
|
2 - set a breakpoint and in the watch window, type something like i=5
remember to delete the line, or every break point will reset i to 5
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thank you man!
regards,
George
|
|
|
|
|
Does anyone knows a Win32API function that can be used as a substitute for POSIX fnMatch()?
What it should do is bassically tell if a file name, letssay c:\windows\test.exe match a certain pattern (C:\windows\*.?xe).
Thanks.
|
|
|
|
|
I'd use regular expressions to do this. Look here[^].
Steve
|
|
|
|
|
Yes, that would be the obvious choice. But I only need this specific check on my program, and I don't want to add another library, dependencies, etc to my project unless there's no other way.
|
|
|
|
|
Would PathMatchSpec() be of any help here?
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Indeed, that's exactly what I need.
Thanks.
|
|
|
|
|
by adding these code to the case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
MoveToEx (hdc, 100, 100, NULL) ;
LineTo (hdc, 100, 200) ;
EndPaint(hWnd, &ps);
why can I adding them to the case WM_CREATE to realise it?
|
|
|
|
|
What problem with this code? and i said you about WM_CREATE & WM_PAINT
|
|
|
|
|
there is nothing wrong with the code,
I just want to know, why can't I move this code into WM_CREATE to get the same result- just draw a line in the window when the window is created.
|
|
|
|
|
Because when it receives the WM_PAINT message, the window will be redrawn and thus if you don't redraw your line too, it will be erased.
|
|
|
|
|
And From the MSDN:
WM_CREATE:
This message is sent when an application requests that a window be created
|
|
|
|
|
bloodwinner wrote: case WM_CREATE to realise it
WM_CREATE:
The WM_CREATE message is sent when an application requests that a window be created by calling the CreateWindowEx or CreateWindow function. (The message is sent before the function returns.) The window procedure of the new window receives this message after the window is created, but before the window becomes visible.
WM_PAINT:
The WM_PAINT message is sent when the system or another application makes a request to paint a portion of an application's window ie when we want to draw something on the window.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Run notepad, and calculator. Drag the notepad over the calculator. Move it away. Why does the calculator redraw itself ? The answer is, it generates a WM_PAINT message, windows uses this to tell a window to repaint itself. If you draw outside WM_PAINT, then your window will lose what you draw when it redraws itself.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Because when Windows wants to repaint a window, because an obscured part was exposed or for another reason, it sends a WM_PAINT message to the window to get it to repaint itself. If you put the rendering code elsewhere you'll see the rendering but when a part of the window is obscured and then exposed (or for some other reason needs to be re-rendered) the WM_PAINT handler will regenerate the image but it will not include the line. Aside from this I suspect the WM_CREATE handler is too early anyway. This situation is set to change with Vista's DWM but still the WM_PAINT handler will remain the correct place to perform most rendering operations.
Steve
|
|
|
|
|
Hi Gurus,
I m working on an application which depends on Removable Storage Manager in order to manage multiple media.As a result i have to design a RSM application. But my problem is i m not able to find any samples regarding this topic. In MSDN, there is a lot of description on Removable Storage Manager but no sample or example at all. May any one of u plz tell me that from where i can get starting samples of Removable Storage Manager.
Thanks
Touseef Afzal
"I only fail when i give up "
|
|
|
|
|
Hi all, i'm trying to implement a tool that navigate automatically on a site, using iwebbrowser. The problem is that this site has httaccess, so when i do Navigate to that url, it opens a login popup with "Authentication Required". This popup is not html, so i don't know how to fill it with username and password.
I thought that this code was a good idea:
HINTERNET m_hInternetSession;
HINTERNET m_hHttpConnection;
if (!AfxParseURL(m_sURLToDownload, m_dwServiceType, m_sServer, m_sObject, m_nPort))
{
TRACE(_T("Failed to parse the URL: %s\n"), m_sURLToDownload);
return false;
}
m_hInternetSession = ::InternetOpen(AfxGetAppName(), INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
if (m_hInternetSession == NULL)
{
TRACE(_T("Failed in call to InternetOpen, Error:%d\n"), ::GetLastError());
return false;
}
m_hHttpConnection = ::InternetConnect(m_hInternetSession, m_sServer, m_nPort, m_sUserName,
m_sPassword, m_dwServiceType, 0, (DWORD) this);
But this has no correlation with iwebbrowser2..so even using this code before navigating to that page the http 401 "authentication required" message is still there.
Please Help
|
|
|
|