|
Did you insert path to Additional Include Directories on the Property of your project.
Right click on the project and select Property and on the C/C++ enter path to Additional Include Directories
|
|
|
|
|
Or, you could enter
#include "..\planning\MainFrm.h"
instead, which would tell the compiler that the include file is in e:\planning rather than e:\base
This would be more efficient if it was just this include file that is located in e:\planning. If you have lots of include files in e:\planning, it would be more efficient to use the method described by "WhiteSky".
hope this helps!
--PerspX
|
|
|
|
|
Hello,
Thanks for your replies
Prithaa
|
|
|
|
|
I have completely forgotton how to do this. I want to grab a single word from anywhere on the screen ie. not limited to my applications window. Many moons ago I found a project on sourceforge that had this ability but have since lost the link and forgotton the name. Hope somebody could put me back on track.
|
|
|
|
|
|
It's close to what I want, but that snippet retrieves the whole text, I need to retrieve the individual word.
|
|
|
|
|
Hi,
The following is the code block in one of my function>
Analysis* pOap = new Analysis(szTemp);
if(pOap)
{ // get the analysis header from the LCQ file.
if(!pOap->Open((const char*)szTemp,FileWriteMode))
}
On executing Open statement i am getting the following error.
tcscpy_s.inl
line:18
Expression _Dst)!= NULL && ((_SizeinBytes))>0
What could be the error?
Any help is appreciated.
Regards
|
|
|
|
|
What does the constructor of Analysis do with szTemp ?
Could it be that the constructor deletes (frees) this pointer ?
|
|
|
|
|
Here,I create a object(CWnd subclass) successfully,but it could not or should not be display on its parent object's client area,So I must destroy it but leave its parent works well(but can not use this object)?
BEST REGARDS
|
|
|
|
|
?????
If you need a new window without parent, add a new view and make a new frame. Then you can switch between them and use them independantly.
And about your question... what are you asking for?
To destroy the window. From VC++ Help:
CWnd::DestroyWindow
virtual BOOL DestroyWindow( );
Return Value: Nonzero if the window is destroyed; otherwise 0.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
What I want is to destroy a childwnd of a Dialog(for example),because the child has been created successfully,but because some reason it could not be draw and show,so,if it exist remainly,it would result a exception when its parent and other elements is about to be draw.
So,all the thing I want to do is destroy a child window before its parent would be drawn.
Thanks.
Best Regards
|
|
|
|
|
kcynic wrote: I want to do is destroy a child window before its parent would be drawn.
Why create the child window if you want to destroy it before the parent is drawn?
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I am sorry I did not explain it clearly.
The child window should be destroyed because it has some initialization did not be done successfully although it was create successfully.
So I must destroy it ,otherwise ,there would be an exception when its parent is about to be drawn.
GOOD LUCK
|
|
|
|
|
CWnd::DestroyWindow() takes care of destroying the HWND associated with the CWnd.
If you want to wait until initialization of the child window succeeds/fails before showing the
child window then create the child without the WS_VISIBLE style. If initialization succeeds call
ShowWindow(SW_SHOW). If it fails, maybe post a message to the parent and let the parent use
DestroyWindow() to destroy the child and also free the CWnd-derived object as well.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Yes,it works well,now.Thanks
|
|
|
|
|
Hi all
I am trying to learn few things like
- remote network management using VC++ . How to manage network elements like routers, masks LAN groups ? (Does WMI provide any classes for it ? I searched Win32 classes and found no reference to such things but I can see more monitoring classes. If not WMI what else gives us the facility ?)
- remote management using WMI . I would like to create/remove user accounts on remote PCs , create/delete folders etc.
Any ideas pls ?
redindian
|
|
|
|
|
|
Hi all.
I have problem wen I try to start process, wen I write:
<br />
try<br />
{<br />
STARTUPINFO lpStartupInfo;<br />
PROCESS_INFORMATION lpProcessInformation;<br />
<br />
memset(&lpStartupInfo,0,sizeof(STARTUPINFO));<br />
lpStartupInfo.cb = sizeof(lpStartupInfo);<br />
<br />
CreateProcess(<br />
L"C:\\vaxo\\My.exe",<br />
NULL,<br />
NULL,<br />
NULL,<br />
FALSE,<br />
CREATE_NEW_CONSOLE,<br />
NULL,<br />
NULL,<br />
LPSTARTUPINFO lpStartupInfo,<br />
LPPROCESS_INFORMATION lpProcessInformation<br />
);<br />
}<br />
<br />
catch()<br />
{<br />
}<br />
<br />
in this code my program starts new process, but if I try to set console string I get some debag error:
"Unhandled exception at 0x77e4ae84 in Process.exe: 0xC0000005: Access violation writing location 0x00418312."
Console string is "C:\\vaxo\\My.exe", I try "C:\vaxo\My.exe", but I stile get this error message
|
|
|
|
|
Did you initialize lpProcessInformation ?
See the example below
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
si.lpReserved = NULL;
si.lpReserved2 = NULL;
si.cbReserved2 = 0;
si.lpDesktop = NULL;
si.dwFlags = 0;
if(!CreateProcess(NULL,
"Yourpathhere",
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&si,
&pi))
{
...failed
}
redindian
|
|
|
|
|
Thanks for help.
but I still have this problem.
|
|
|
|
|
did it work ?
redindian
|
|
|
|
|
thanks for help.
but I still have this problem
|
|
|
|
|
Will this even compile? Look at the last two arguments to CreateProcess .
Lose the try /catch blocks; CreateProcess doesn't throw exceptions to indicate errors and any exceptions it does throw (such as access violations) will almost certainly be your fault and should be allowed to propergate to the debugger so the problem can be fixed. I’ll gloss over the issue that the fact that try /catch can even catch access violations (and other such exceptions) is non-standard and later MS compilers have been fixed in this regard (although the old buggy behaviour can be re-enabled via a compiler switch).
Here's an example:
#include "stdafx.h"
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
STARTUPINFO si = {0};
si.cb = sizeof(si);
si.lpTitle = "Use this as the title!";
PROCESS_INFORMATION pi;
BOOL bOK = CreateProcess(
"C:\\Commands\\AnyKey.exe",
NULL,
NULL,
NULL,
FALSE,
CREATE_NEW_CONSOLE,
NULL,
NULL,
&si,
&pi
);
if (bOK)
{
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
}
return 0;
}
Steve
|
|
|
|
|
thanks. it help, but now I get another problem.
I can start my process, but tis process is console and I must set parametrs in command line. and I dont know how to do this.
|
|
|
|
|
hye,
i m trying to record video on motion detection in VC++.
Can anybody tell the exact procedure i should apply
motion detection has started but i dnt know how to write code for recording the video on motion detection.....
Neha
|
|
|
|