|
Probably one or more of the files Visual Studio uses to keep track of things has gotten messed up. Exit Visual Studio. In the folder containing your project, try deleting project.NCB, project.APS, and project.SUO (if any of them exist). These files contain IntelliSense, resource editor, and solution option information, respectively. They can be deleted safely, and Studio will recreate them as needed.
Software Zen: delete this;
|
|
|
|
|
Hello, thanks for the suggestion. I deleted the .NCB and .APS files from the project directory, unfortunately I still have the problem. Adding a new class causes VS 2003 to hang/freeze. Any other suggestions?
Thanks!
|
|
|
|
|
Well,
After nearly 2 weeks of trying to figure this out, reinstalling Visual Studio .NET, restarting the project and trying slightly different approaches, I have found the problem to be in the Visual Studio .NET settings. Under Options/Projects/VC++ Directories, I had some additional entires which seem to have been the problem. Removing those now has Visual Studio .NET not crashing when adding a second ATL control class to a project.
Aristotel
|
|
|
|
|
Genties and Ladlemen,
I am having a slight problem. I need to devise or find some web resources that permit me to construct a tree in which each node has a variable (and initially quite large) number of children.
I have looked at n-ary trees and various structures in the STL but unfortunately I am finding that the STL is too unstable for my purposes as it is not thread-safe and it is also very difficult to debug without loosing ones sanity in the process.
Basicallly, I am trying to implement a natural language processor / pattern matcher, such that the traversal from the root to a leaf node represents a sentence including, if necessary, wildcards. Each word in the sentence represents a new node and all the children of that node are the legal remaining words of that sentence. And so on.
E.g.
The word IT has [IS, HAS and *] as children.
Could match IT IS, IT HAS and IT * (default). Obviously the number of words present at the root could be huge and the number of children variable.
A leaf node would then represent under reverse traversal back to the root, a complete sentence. The tree / graph needs to be structured in this way as it is necessary to backtrack from a leaf node to a parent node if a particular match to the user input fails (it would backtrack and research until a match or default with a wildcard was found).
Does anyone know of any "standard" structures that can handle
this?
Mike Babington
|
|
|
|
|
Problem when retrieving Clipboard data in the Enhanced Metadata format.
// 1. This one Draws Some Sample Line in the Edit box.
Code:
CDC * h_meta_dc = m_ctrl_edit_metadata.GetDC() ;
h_meta_dc->MoveTo(1,1);
h_meta_dc->LineTo(1,10);
h_meta_dc->LineTo(100,10);
// 2. Trying to copy the data in metadata format. Also this code saves the drawing content into the clipboard in metadata format(Enhanced).
// Copies the content that is visible in the text box.
Code:
OpenClipboard();
EmptyClipboard();
CMetaFileDC * pMDC = new CMetaFileDC();
RECT client_rct;
::GetClientRect(m_ctrl_edit_metadata.m_hWnd, & client_rct );
pMDC->CreateEnhanced( m_ctrl_edit_metadata.GetDC() , NULL , &client_rct , "Meta_Data");
pMDC->MoveTo(1,1);
pMDC->LineTo(1,10);
pMDC->LineTo(100,10);
HENHMETAFILE handle = pMDC->CloseEnhanced();
SetClipboardData(CF_ENHMETAFILE,handle);
CloseClipboard();
delete pMDC;
// 3. Erases the content drawn.
Code:
RECT client_rct;
HBRUSH h_brsh = ::CreateSolidBrush(RGB(255,255,255));
::GetClientRect(m_ctrl_edit_metadata.m_hWnd, & client_rct );
::FillRect(::GetDC(m_ctrl_edit_metadata.m_hWnd), &client_rct, h_brsh );
// 4. Drawing content retrieved from the Clipboard and Displayed
Code:
if ( OpenClipboard() )
{
HENHMETAFILE handle = (HENHMETAFILE)GetClipboardData(CF_ENHMETAFILE);
RECT client_rct;
::GetClientRect(m_ctrl_edit_metadata.m_hWnd, & client_rct );
CDC * dc = m_ctrl_edit_metadata.GetDC() ;
::PlayEnhMetaFile(::GetDC(m_ctrl_edit_metadata.m_hWnd), handle, &client_rct);
CloseClipboard();
}
m_ctrl_edit_metadata - This is a CEdit control Variable involved in this case.
I have assigned each piece of this code in different Button event handler. When I try to retrieve the content, I am getting the magnified effect of the drawing content . Can anybody test and tell me the Reason.
The order in which I had executed the event are => Code Snippet 1, Code Snippet 2, Code Snippet 3, Code Snippet 4
Thanks in Advance
|
|
|
|
|
Hi,
I am writting a program in vc++/MFC
I have problem in right alignment of number in the list box.
I would like to show Hardisk information like HardDiskLetter, Capacity, Used space and free space in the list box.
I wrote code like this: -
#include "stdafx.h"
#include "HardDriveInfo.h"
#include "HardDriveInfoDlg.h"
.............................
.............................
#define MAX_OF_HARD_DISKS 24
static char HardDiskLetters[MAX_OF_HARD_DISKS][4]={
"c:\\", "d:\\", "e:\\", "f:\\", "g:\\", "h:\\",
"i:\\", "j:\\", "k:\\", "l:\\", "m:\\", "n:\\",
"o:\\", "p:\\", "q:\\", "r:\\", "s:\\", "t:\\",
"u:\\", "v:\\", "w:\\", "x:\\", "y:\\", "z:\\"
};
.......................................
............................................
BOOL CHardDriveInfoDlg::OnInitDialog()
{
CDialog::OnInitDialog();
..................................
.................................
int count=0,count2=0;
ULARGE_INTEGER AvailableToCaller, Disk, Free;
for (int iCounter=0;iCounter
|
|
|
|
|
You can right justify the numbers by specifying a width in your format code. Instead of %I64d , use %20I64d . The '20 ' will cause the value to be displayed in a field 20 characters wide.
Software Zen: delete this;
|
|
|
|
|
This will also require the use of a fixed-space font.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Any reason why you are not using a CListCtrl object for this?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
i would like to know how to send midi data to the usb using windows midi driver???i have already sent this midi data to the midi sw synth(default of window midi player),how can i route it to the usb driver???i am not supposed to make my own driver but use the already existing windows drivers!!!!!.....
please help.....
|
|
|
|
|
how to get list of ip address in my entire network.
i want to know list of all ip address of my entire network.
how can i get??
pls explain me..
some sample and refrence.pls give me..
|
|
|
|
|
Are you referring to NetServerEnum() , or the WNetOpenEnum() /WNetEnumResource() pair? Once you have the name of the resource, simply call gethostbyname() to get its IP address.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
can i get both computer and input device(com port).
now i get only computer ip address.
i want to get com port ip address.
|
|
|
|
|
vc-programmer- wrote:
i want to get com port ip address.
I was not aware that COM ports had IP addresses.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi,
When i'm using this code in my file,
if(!(OpenPort(portname)))
MessageBox("Cannot open Communication Port.Please\nquit the application & re-start your PC.","Error",MB_OK+MB_ICONERROR);
Following error has occured:
Messagebox function doesnot take 3 parameters.
Is there any need to include header file, or whats the error.?
Pls help.
Mithila
|
|
|
|
|
You are calling the global message box. It requires the first parameter to be an HWND of the owner window or NULL if the message box has no owner window.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Hello Friends,
Whenever my application is starting it is giving a beep sound which I don't require it. please help me regarding this problem. I am present the code which I am having in InitInstance() of App class.
BOOL CMMTRansApp::InitInstance()
{
AfxEnableControlContainer();
AfxInitRichEdit();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MMTRANS_MENU,
RUNTIME_CLASS(CMMTRansDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CMMTRansView));
AddDocTemplate(pDocTemplate);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
//AfxMessageBox("Test");
if (!ProcessShellCommand(cmdInfo))
return FALSE;
//AfxMessageBox("Test1");
// The one and only window has been initialized, so show and update it.
m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
// Setting the window title
((CMainFrame*)AfxGetMainWnd())->SetWindowTitle();
......
}
When I debugged I got known that the beep is coming when ProcessShellCommand(cmdInfo) condition is checked. But when I am having other applications it is not giving me the beep sound. So I want to solve this beep sound problem in my actual application.
Thanks in Advance.
Neelesh K J Jain.
|
|
|
|
|
Neelesh K J Jain wrote:
When I debugged I got known that the beep is coming when ProcessShellCommand(cmdInfo)...
So have you stepped into it to see what code is causing the beep?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I am building an application with embeded property pages in a dialog (CDialog)
Here is how i have done it;
Following code is in the OnInitDialog
m_PSheet=new CPropertySheet("Hello"); // Hello appears no where
// Adding two property pages CPropertyPage
m_PSheet->AddPage(&m_p1);
m_PSheet->AddPage(&m_p2);
//Modeless
m_PSheet->Create(this,WS_CHILD,NULL);
m_PSheet->ShowWindow(TRUE);
Each propertypage contains a button which simply displays Message from Page 1
or page2.
Both pages work absolutely fine as long there is no control on main dialog but if i add a button on main dialog; then pressing button on property pages losts the program (Hangs); the button on main dialog works fine;
I want all controls on property pages and as well as on main dialog working.
Please help;
|
|
|
|
|
What I did for adding a CPropertySheet on a dialog is that first of all I added a Picture control on the dialog which was of the same size as that of the property sheet. I named that picture control as IDC_PROPSHEET and then I added a member variable named m_dlgPropSheet of the type of CPropertySheet. Then in OnInitDialog i did the following steps, after adding pages in Sheet.
m_dlgPropSheet.Create(this,WS_CHILD|WS_VISIBLE,0);
m_dlgPropSheet.ModifyStyleEx(0,WS_EX_CONTROLPARENT);
m_dlgPropSheet.ModifyStyle( 0, WS_TABSTOP );
CRect rcSheet;
GetDlgItem(IDC_PROPSHEET)->GetWindowRect(&rcSheet);
ScreenToClient( &rcSheet );
m_dlgPropSheet.SetWindowPos(NULL,rcSheet.left-7, rcSheet.top-7, 0, 0,SWP_NOZORDER|SWP_NOSIZE|SWP_NOACTIVATE );
Try doing this, Hope it would help.
Still Alone in this beautiful world
My Articles
|
|
|
|
|
Thank u very much ur code has solved my problem,
Infact the difference between ur and my code is of the following two lines,
adding them in my code has solved my problem; I have not changed my remaining code.
m_PSheet.ModifyStyleEx(0,WS_EX_CONTROLPARENT);
m_PSheet.ModifyStyle( 0, WS_TABSTOP );
According to MSDN.
WS_EX_CONTROLPARENT Allows the user to navigate among the child windows of the window by using the TAB key
How simply changing style to WS_EX_CONTROLPARENT solved it ? please desribe.
|
|
|
|
|
You are right. I used Picture control just for sizing it properly at my required position.
AFAIK, WS_EX_CONTROLPARENT enables a control to be controlled by the parent. Since there is not a direct method to add CPropertySheet directly over a CDialog, therefore, I guess, we need to do this through this approach. I am not sure about its exact reason myself.
Still Alone in this beautiful world
My Articles
|
|
|
|
|
One thing more;
I think u have used Picture control only for sizeing, and it has nothing to do with real problem.
|
|
|
|
|
Obviously you are missing the PSheet point - it is not to be used in Dialog (at least normally). PSheet was designed to be used on itself only, providing general dialog with pages - I guess this is the reason you have problems. If you want to have dialog with pages among other controls, you will have to add it manually by adding tab control and managing tab switches yourself.
I do have a class for this, if someone would be interested I could try to make an article on CP on with it.
Igor Green
http://www.grigsoft.com
Compare It! + Synchronize It! : Files and folders comparison never was easier!
|
|
|
|
|
Thanks for reply
I was also thinking that property pages are not working because of CDialog; but surprisingly they have. If u have time then please look the above solution provided by "Amir Butt" simply by changing style to "WS_EX_CONTROLPARENT" solved the problem; i.e. embeded propertypages in a dialog where as controls on pages and dialog are working fine.
If u know what magic WS_EX_CONTROLPARENT has done then please describe.
I could try to make an article on CP on with it.
That will be a great greatness.
|
|
|
|
|