|
how to include "scandisk" in a vc++ mfc wizard prgm
ie when i click a buton scandisk should work and when i exit scandisk ,the control should return to main program and other dialogues should work....how to dooooooooooooooo
|
|
|
|
|
easy. redirect the std handles to your program (own console) and run scandisk from there.
Don't try it, just do it!
|
|
|
|
|
Thanks in advance for any help! I have a compile error which is driving me insane. I need to access the SDI MFC view from a non-MFC class/file. I found a simple example of how to implement a GetView function, unfortunately once I include CXXXView.h in the non-MFC file, I get compile errors in XXXView.h. Compiler no longer seems to recognize the GetDocument function. Any ideas?
It's easy to re-create this problem. Just create an empty project using MFC AppWizard. Add a blank h & cpp file. #include "XXXView.h" into the blank cpp file and it won't compile.
|
|
|
|
|
A class MUST be an MFC-oriented class to access a CView object. It has to know about CDocuments also. I don't believe that there are any alternatives available.
__________________________________________
a two cent stamp short of going postal.
|
|
|
|
|
Put #include "stdafx.h" in the cpp file, just before #include "XXXView.h" . The stdafx.h file includes all headers, that you need to manage MFC classes.
Robert-Antonio
"Friends come and leave, but teddybears stay in forever."
|
|
|
|
|
I just installed vc++.net 2003. It works fine until I begin debugging a module. It then goes off attempting to do something on my LAN or the internet, don't know which, but the ethernet light on my NIC blinks while vc++ is "hung". But since this computer is not connected to anythging, it gets no response. About a minute later it times-out and returns to the task at hand, ie debugging my app.
1. What is it trying to do? and
2. I don't care about the answer to #1, how do I make it stop this annoying behavior?
tbanks for any help.
Chuck
|
|
|
|
|
|
Did you register the software?
It might be trying to connect to Micro$oft. They have all this anti-piracy $@!$@.
|
|
|
|
|
No, not yet. I just installed it and tried it out...
Good thought though. Course, I'd just as soon not register it. Although I did buy it official and legal like.
chuck
|
|
|
|
|
|
Hi Experts,
I have simple problem but unable to figure it out.
I m developing a Chat Application between a Desktop(Server) and a multiple Clients(Palm Device).
The application works as - When a client request a connection with server, a client connected and server displays a new chat window for that client.
I have coded the application as - A thread is created for a server that continues polls for incoming client request and when a request arrives a new client thread has been created. In case of Client Thread, a modeless Chat Dialog Box is displayed..........Now, at this point i have a problem....the client Dialog Box get hang and i m unable 2 proceed further.
The code snippet as follows :
UINT ThreadForServer(LPVOID WinObjPtr)
{
.........
while(1)
{
client = accept(server,(struct sockaddr*)&from,&fromlen );
if ( (client == INVALID_SOCKET) )
continue;
cthreadHandle = CreateThread(0,0,(LPTHREAD_START_ROUTINE) ThreadForClient,0,0,&cid);
}
void CUserLogin::CreateChatWindow()
{
CChat *objChat;
objChat = new CChat();
objChat->Create(MAKEINTRESOURCE(IDD_CHAT),this);
objChat->ShowWindow(SW_SHOW);
}
UINT ThreadForClient(LPVOID WinObjPtr)
{
CUserLogin objLogin;
objLogin.CreateChatWindow();
.... client Processing......
}
I hope u can understand my problem....
Waiting 4 earliest reply.
|
|
|
|
|
I've been getting these messages in my VC6 debug window (at least 12 of them in a row):
First-chance exception in sxtools.exe (KERNEL32.DLL): 0xC0000005: Access Violation.
Normally, an access violation causes the program to break in debug mode but for some reason it just keeps on going. Is it because the access violation is actually happening in a separate process that my application starts? Is there a way for me to tell the debugger to stop on these?
Thanks.
|
|
|
|
|
I suspect this means that sxtools.exe (assuming that isn't your program!) is actually handling this exception using the __try /__except syntax.
Some programs do actually expect access violations. Some operate on sparse arrays by reserving a large block of virtual address space, but not committing any memory pages (both tasks using VirtualAlloc ). When the program tries to use an address that hasn't yet been committed, Windows raises an Access Violation exception; the program handles it by calling VirtualAlloc to commit that page, then returns EXCEPTION_CONTINUE_EXECUTION from the exception handler. The program then resumes with the instruction that caused the fault.
It's possible that a library is doing this on your behalf, if this is your executable.
Exception processing happens in two stages. First, Windows calls all the exception filters (__except blocks) in reverse order from the point that the exception occurred. If the filter returns EXCEPTION_CONTINUE_SEARCH , Windows executes the next filter up the call stack, and so on. If the handler returns EXCEPTION_CONTINUE_EXECUTION , the exception is dismissed and execution continues with the instruction that faulted (or after the call to RaiseException , if the exception was software-initiated). If it returns EXCEPTION_EXECUTE_HANDLER , Windows moves on to the second stage. If all the handlers return EXCEPTION_CONTINUE_SEARCH , Windows drops out into unhandled exception handling (see SetUnhandledExceptionFilter ).
The second stage involves calling all the filters a second time, but between calling each filter Windows unwinds the stack, removing each called function. Finally it runs the code in the handler.
When a debugger is attached to the process, it gets notified of exceptions twice. The first chance is just before Windows calls the first filter, straight after the exception is raised. The second chance is after all the filters have been called and no filter has claimed the exception. You can configure the Visual C++ debugger to stop on the first chance for a given exception code, or only on the second chance. The default is to stop only on an unhandled exception for most exceptions. However, the default for the exceptions raised when you press Ctrl+C or Ctrl+Break in a console application is to stop on the first chance (VC 6.0 also stops on an Invalid Handle exception).
In Visual Studio you configure exception handling in the Debug > Exceptions dialog box. In VC 6.0 you can only access this box when debugging. For VC 6.0, select the exception you want to change and choose either Stop Always to stop on the first chance, or Stop If Not Handled for the second chance, then click Change. If the exception doesn't appear in the list, add its code in the Number box and a description in Name, and click Add. These settings are stored in the project options, IIRC. You can't configure different C++ exceptions separately in VC 6.0 - it's all or nothing.
In VS.NET, the box is unified across native exceptions, C++ exceptions, .NET exceptions and run-time checks. You can configure the behaviour separately for the first and second chances to handle the exception. The "When the exception is thrown" group corresponds to the first chance and "If the exception is not handled" to the second.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
when the application is beeing debugged(*) , go in the menu :
Debug->Exceptions
Then, you can make the debugger stop at every exception.
see if it helps.
(*) you really need to be debugging to see the debug menu and the exception menu item.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Normally a debugger gets TWO notifications for each exception that occurs in your program.
One when as soon as the exception occurs and before it reaches ur program (this is "First-Chance exception" and can be ignored safely).
second is when that exception is not caught by ur program. this time ur program may bomb...
It's not a bug, it's an undocumented feature. suhredayan@omniquad.com
messenger :suhredayan@hotmail.com
|
|
|
|
|
I have a C++ app that makes various API calls to a custom API, but I dont have the sources for either the app or the API.
Is there a way I can trace the calls that are made from the app to the api? And what parameters are sent?
Apologies if this is a bit vague, but I am no C++ expert
post.mode = postmodes.signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
I have a CPropertySheet derived class that's a child of a CDialog derived class (main app window.) When a control on the property sheet has focus and I take an action that changes the active window, things get very strange. It looks like an endless loop of WM_GETDLGCODE messages are being generated and processed, so everything locks up. Anybody have any ideas what causes this or how to fix it?
Thanks.
|
|
|
|
|
Check it using a debugger!
Don't try it, just do it!
|
|
|
|
|
Assuming the question was, what does MAKEINTRESOURCE do?
It casts the integer value supplied - which must be below 65536, i.e. fit in a 16-bit quantity - to an LPTSTR , reinterpreting the bit pattern. APIs which expect a resource identifier can take either an integer or a pointer to a string. If the value of the pointer is under 65536, they interpret the value as an integer identifier; otherwise, it is interpreted as a string identifier. You can use the IS_INTRESOURCE macro to check if a resource identifier is a string or an integer.
Windows deliberately reserves the address space between 0 and 0x00010000 for this reason, and to ensure that programs get an access violation if they try to read or write through a NULL pointer (which on Windows is simply a pointer with the value 0).
MAKEINTRESOURCE is implemented in winuser.h . Reading the headers can lead to greater understanding.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
What data type support the operator << of CArchive??.
Thank you.
|
|
|
|
|
|
primitive data types or serializable objects (that derives, either directly or indirectly, from CObject).
It's not a bug, it's an undocumented feature. suhredayan@omniquad.com
messenger :suhredayan@hotmail.com
|
|
|
|
|
i used a CAsyncsocket class in my service prog,and create socket succeed.when socket was connected ,the connect()function return zero. getlasterror() show the error is 997:(Overlapped I/O operation is in progress).but it is strange that:at first, my prog was fault,the socket can also receive and send data in the state of error(connect() return zero).why?
class CMysocket : public CAsyncSocket
{ .........}
class CServiceWnd : public CWinThread
{
CMysocket * m_pSocket;
..........
}
BOOL CServiceWnd::Createsocket()
{
if (m_pSocket != NULL)
{
delete m_pSocket;
m_pSocket = NULL;
}
m_pSocket = new CMysocket();
if (!m_pSocket->Create())
{
LogEvent("Socket failure", 0, FALSE);
return FALSE;
}
int s;
s=m_pSocket->Connect(IP_Address,IP_Port);
CString ss;
ss.Format("Connect(IP_Address, IP_Port) return :%d",s);
LogEvent(ss,0, FALSE);
if(Is)
//at first,i set "ifisj"Cbut can also send/receiveIIH
{
if (m_pSocket->GetLastError() != WSAEWOULDBLOCK)
{
CString strError;
strError.Format("can't connect,last error is %d",m_pSocket->GetLastError());
LogEvent (strError, 0, FALSE);
m_fConnected = FALSE;
delete m_pSocket;
m_pSocket = NULL;
return FALSE;
}
}
m_fConnected = TRUE;
LogEvent (_T("connected"), 0, FALSE);
return TRUE;
}
|
|
|
|
|
Hi all,
I'm using MFC (VC6) and have a list control in a dialog that I would like to catch double-clicks.
I've searched through the class wizard messages available to the list control but do not find any that can be used...
What am I missing here?
Any help welcome.
|
|
|
|
|
Try NM_DBLCLK. It is a Common Controls notification in common with others, rather than a List Control
specifically.
Unless you mean a ListBox, in which case you want LBN_DBLCLK.
Iain.
|
|
|
|