|
Hi,
My application is MDI application.But im making one window as SDI.In that window i want Menu,Customized toolbar(DialogBar).
What i did.
in app class
pAlarmViewTemplate = new CSingleDocTemplate(
IDR_ALARMMENU,
RUNTIME_CLASS(CFoxboroDoc),
RUNTIME_CLASS(CFrameWnd),
RUNTIME_CLASS(CAlarmView));
AddDocTemplate(pAlarmViewTemplate);
For loading DialogBar in Oncreate function
// Create the Alarm view dialog bar
if( !m_wndAlarmDlg.Create(this, IDD_ALARM_DIALOGBAR, CBRS_BOTTOM |CBRS_FLYBY|CBRS_SIZE_DYNAMIC, IDD_ALARM_DIALOGBAR))
{
TRACE0("Failed to create the Alarm\n");
return -1;
}
where m_wndAlarmDlg is a dialogbar class object.
But when executing ,it doesnot show dialog bar.when i check this variable in Create function,it shows
this = 0x0624ca70 {CAlarmView hWnd=0x00000000}
I dont know how to do that.
--------------------------------------
I choose this only one SDI window in MDI window for getting customized menu for AlarmView .But i dont know how to get customized menu in childwindow of MDI.If i get this one,then i dont want to go for SDI.
Anu
|
|
|
|
|
i am trying to delete Cookies and History directories programmatically but not Possible because of index.dat file... How do i come out from this problem..?
|
|
|
|
|
|
This solution only works for your personal desktop... I run CCleaner from the command line (scheduled task on shutdown) to delete histories, etc.
|
|
|
|
|
Not able to debug my project it is shown as 'The breakpoint will not currently be hit.No symbols have been loaded for this document.'The break point is shown as an error symbol.Along with it showing another project's function name.I am using VC2005.How to solve this?
|
|
|
|
|
1) Are you sure the location where you are placing a breakpoint is in the relevant project and not a dll that it depends on?
2) Have you compiled your add-in(s) recently and made sure the latest version in your path match the versions that you just compiled.
3) Do you have debug information enabled?
|
|
|
|
|
|
I understand that the breakpoints are set; this is a common problem most often due to #1 - 3 I mentioned before.
Does your program rely on any dlls? Is it an exe or dll supporting excel for instance?
|
|
|
|
|
|
My guess is that you need to recompile your dlls that you are using.
|
|
|
|
|
A bit hard to say without seeing the code.
If none of the previous suggestions helped:
Have you checked that the code you want to look at is in fact not dead - as in, the control flow can actually reach it? Maybe the code is inaccessible. Or you tried to set the breakpoint in a function that is no longer used, or has been replaced by another function.
Check your code for locations that call the function you're interested in and try setting your breakpoint there. If that works, step into the function call from there. If not then maybe repeat to get to the next higher level in the call hierarchy.
On a sidenote, what language is it? In C/C++, setting a breakpoint within makro definitions might not work at all, since to the compiler this is technically just plain text. Also breakpoints in templated functions can occasionally be tricky, although I haven't encountered any problems for a long time.
|
|
|
|
|
|
Jia100 wrote: rebuild the project & also deleted .obj files
I am assuming you first deleted the obj files and then rebuilt the project, not the other way round? Just trying to make sure, because if the object files no longer exist, the application will still run, but the debugger might not be able to recognize how the binary executable is linked to the source code! Which would explain what the debugger meant by 'No symbols have been loaded for this document.'...
Not sure what else to suggest, other than checking the messages being sent to output during startup: look if there are similar messages denoting symbol files that are not being loaded, and for which modules.
One more idea: is the function you want to debug being called externally? If so, have you checked whether it's properly declared as external?
|
|
|
|
|
|
You mentioned an error message, namely that 'the symbols for this document were not loaded' or something like that. This indicates one of the following:
1. No debugging/symbolic information was generated
--> check the compiler settings of your project, and/or specifically for this file to see if debugging information is being generated (Properties -> C/C++ -> General -> Debug information format). You need 'Program Database' or 'Program Database for Edit and Continue. Everything else will not allow the use of breakpoints
2. The debugging information could not be found
--> check the ouput folder to see if the *.pdb file (program database) is present for your project. It contains the symbolic information needed to interpret and use breakpoints. Specifically check the settings for your output files (Properties -> C/C++ -> Output files), whether the folder indicated there is still correct.
3. You're trying to set breakpoints within code that is not part of your project (e.g. code that is part of a DLL that your project uses), and that code has not been generated with debug/symbolic information. In that case rebuilding your project won't help.
4. You're trying to set breakpoints within code that is not part of your project (e.g. code that is part of a DLL that your project uses), and that code has been generated with debug/symbolic information, but the program database for this DLL is not accessible. This can happen if you copied the DLL to another folder so the EXE can access it, but forgot to copy the PDB file as well, which contains the symbolic information.
|
|
|
|
|
Can anybody direct me to something useful in the above mentioned
Thanks
Simon Smith
|
|
|
|
|
1. What does this have to do with C/C++/MFC?
2. Have you tried Google?
I must get a clever new signature for 2011.
|
|
|
|
|
I think you can create an ATL Project
|
|
|
|
|
And what has this to do with my suggestions to the OP?
I must get a clever new signature for 2011.
|
|
|
|
|
Hi,
I've 'ported' my client / server applicaton to Windows 7 32bit, but I can't get the client to connect to the server when they are both on the same machine (using address 127.0.0.1).
BUT, I can connect to the server on the XP machine using the client on the win7 machine across the LAN.
Or I can connect to the server on the win7 machine using the client on the XP machine.
Or I can connect to the server on the XP machine using the client on the same XP machine (using 127.0.0.1).
When I debug, there are no errors, and the servers blocks on accept() as normal.
I am totally at a loss to explain this or find a solution.
If anyone has any ideas, I'd love to hear them.
Thanks 
|
|
|
|
|
are the server and the client running in separate processes?
"If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams
|
|
|
|
|
Yes. Separate processes. Both using Winsock2.
|
|
|
|
|
then i can only guess that there is a misconfiguration.
the server must be configured to listen to a certain port say 205 on the localhost (127.0.0.1).
the client must send messages to that same port (205) on the localhost (127.0.0.1)
"If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams
|
|
|
|
|
Thanks for your suggestion. The configuration seems to be OK. In any case, the port and IP is set correctly. Bizarrely currports show that the server is listening and that the connection is established on the client, but accept never unblocks.
I have now rewritten the client code using getaddrinfo() to request the socket and now it works. Inexplicably, it now works even though I am still connecting with the same socket and address.
I am curious to know why it works OK on XP but not Win7 in case I have future problems. I will post the server and client code snippets to see if you can see where the problem is.
Server:
err = WSAStartup( wVersionRequested, &wsaData );
sin.sin_addr.s_addr = htonl(INADDR_ANY);
sin.sin_port = htons(port);
sock = socket(AF_INET, SOCK_STREAM, 0);
qtest = bind(sock, (SOCKADDR *)&sin, sizeof(sin));
result = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *) &flag, sizeof(int));
...
test = listen(m_sock->get_sock(), 0);
m_sock->set_com_sock(accept(m_sock->get_sock(), (SOCKADDR *)&m_sock->get_sin(), &sinsize));
Client:
sin.sin_family = AF_INET;
WSAStartup(MAKEWORD(2,0), &WSAData);
sock = socket(AF_INET,SOCK_STREAM,0);
err = bind(sock, (SOCKADDR *)&sin, sizeof(sin));
err = connect(sock, (SOCKADDR *)&sin, sizeof(sin));
|
|
|
|
|
Without seeing some of your code it is difficult to offer any answers. However, I do not think there is an underlying Windows 7 problem as I have tested a similar configuration recently on my own Windows 7 system, and it worked without problems.
I must get a clever new signature for 2011.
|
|
|
|