|
Those are compiler defined values, and have nothing to do with your question.
|
|
|
|
|
I guess I could use the Visual Studio debugger and use OCR (optical character recognition) on the watch window. Can anybody recommend a good, free OCR application?
|
|
|
|
|
arnold_w wrote: OCR (optical character recognition) on the watch window I'd like to see that work.
|
|
|
|
|
The C and C++ runtime environments do not maintain metadata on the types in your program the way a .NET executable does.
Therefore, I don't see how you would dump the type names, unless you develop a program to process your source code and extract the information that way.
If I'm wrong about this, I invite correction.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hi,
Yes, I had to do this many years ago.
However you are not really giving me enough information. You need to be very specific when you ask for help. Do you need to do this on a Release build or Debug build? Do you need to do this at run-time or compile-time?
1.) Preprocessor abuse[^] that stores the variable name in an extra char field in the struct. Here is a partial example[^].
2.) If you are using C++ there are several boost libs[^] that allow you to implement some reflection.
3.) The Debug Interface Access SDK[^] can be used to get all of the structs and member variable names. If you go this route... you will need to generate a PDB.
Best Wishes,
-David Delaune
|
|
|
|
|
Since this a debug tool that only will be used in-house, it doesn't matter if I use release or debug and compile time is fine.
|
|
|
|
|
Hi,
arnold_w wrote: Since this a debug tool
If this is a debug tool I recommend that you check out the Debug Interface Access SDK[^] which will allow you to get all kinds of useful information and statistics about your executable. You can dump each function/class size and type along with the variable name.
Dia2dump Sample[^]
TYPEINFODUMP[^]
Best Wishes,
-David Delaune
|
|
|
|
|
Hi everyone!
I need to "send" data in a notepad every time I write double numbers on edit control and press save. I wrote some code but my dialog (where the edit control is) don't even open when I run the executable. What I've done so far:
void CDataDialog::OnBnClickedSave()
{
CFileDialog dlg(FALSE, L"Text Files (*.txt)|*.txt|Texr Files (*.h)|*.h|", NULL, OFN_OVERWRITEPROMPT, L"Text Files (*.txt)|*.txt|Text Files (*.h)|*.h|");
CStdioFile file;
CString buffer;
CString textfile;
if (dlg.DoModal() == IDOK)
{
file.Open(dlg.GetFileName(), CStdioFile::modeCreate | CStdioFile::modeWrite);
dlg.GetFileName();
file.WriteString(buffer);
file.Close();
}
}
void CDataDialog::OnEnChangeEdit1()
{
UpdateData(TRUE);
}
I think I must write some code here so the dialog box work fine but I can't it.
void CInputView::OnLinefeaturesData()
{
CInputDoc* pDoc = GetDocument();
CDataDialog DialogWindow;
}
|
|
|
|
|
You have to show the dialog after it has been created:
void CInputView::OnLinefeaturesData()
{
CInputDoc* pDoc = GetDocument();
CDataDialog DialogWindow;
DialogWindow.DoModal();
}
|
|
|
|
|
Great!!!I did it!! but how can I save what I write on edit box in a .txt. It worked fine but I din't manage to save what I wrote! Thanks again for your response!!
|
|
|
|
|
Just get the text from the edit box using GetWindowText :
CString buffer;
m_editBox.GetWindowText(Buffer);
CEdit *pEdit = (CEdit*)GetDlgItem(IDC_OF_THE_EDIT_BOX);
pEdit->GetWindowText(buffer);
|
|
|
|
|
I did it but I didn't manage to save them again. Also when I pressed <x> this message appeared: "Exception thrown at 0x104420C5 (mfc140ud.dll) in Input.exe: 0xC0000005: Access violation reading location 0x00000020.
If there is a handler for this exception, the program may be safely continued.------>Break, Continue, Ignore"
|
|
|
|
|
Actually, I fixed the second problem!! But still didn't saved in txt.
|
|
|
|
|
Then use the debugger to see what happens (e.g. by setting a break point somewhere after the output file has been selected using the CFileDialog ). You might also check if file.Open was successful. But if that fails calling file.WriteString should throw an execption.
|
|
|
|
|
I'll check it!Thank you very mush for your help!!
|
|
|
|
|
Hi all,
How can I give data in a dialog box dynamically? In a previous project I used edit boxes (e.g for 3 conductors) and gave those data separately for each conductor but now I have to give them dynamically and I don't have standard number of conductors and I can't use edit box again. Could you please give me an idea or a good link describing step by step how to create a table in a dialog box dynamically?
Thanks for your time!!
|
|
|
|
|
|
Thanks for your answer! Actually a want to edit the data. I think list box is for displaying data.. :/
|
|
|
|
|
lolici wrote: Actually a want to edit the data. Pity you did not make that clear in your question.
So what exactly are you trying to achieve with this dialog? Please edit your question and add some proper detail, if possible with some code showing where the problem is.
|
|
|
|
|
I have created a dialog box in which I insert data about conductors (resistivity, permeability, diameter etc (electric power systems )) in edit boxes but I have done it only for 3 conductors. I have to insert-edit the number of conductors and then edit their characteristics. But I can't use again edit boxes because this is static. I want something like a dynamic table which will have rows=number of conductors and columns about is characteristic (resistivity, permeability, diameter)and edit them in dialog box. I don't know how to upload my executable to male clear what I have done but here is a part of my code for the static case of three conductors I want another dynamic way to edit data :/
void CInputView::OnLinefeaturesFeatures()
{
CInputDoc* pDoc = GetDocument();
CFeaturesDialog DialogWindow;
DialogWindow.m_DialogCon = m_NumCond;
DialogWindow.m_DialogLayers = m_Layers;
DialogWindow.m_DialogPermeability = m_AirPermeability;
DialogWindow.m_DialogAirConductivity = m_AirConductivity;
DialogWindow.m_DialogAirPermittivity = m_AirPermittivity;
DialogWindow.m_DialogEarthPermeability1 = m_EarthPermeability1;
DialogWindow.m_DialogEarthConductivity1 = m_EarthConductivity1;
DialogWindow.m_DialogEarthPermittivity1 = m_EarthPermittivity;
DialogWindow.m_DialogDepth = m_depth;
DialogWindow.m_DialogEarthPermeability2 = m_EarthPermeability2;
DialogWindow.m_DialogEarthConductivity2 = m_EarthConductivity2;
DialogWindow.m_DialogEarthPermittivity2 = m_EarthPermittivity2;
DialogWindow.m_Dialogfrequency = m_frequency;
if (DialogWindow.DoModal() == IDOK)
{
m_NumCond = DialogWindow.m_DialogCon;
m_Layers = DialogWindow.m_DialogLayers;
m_AirPermeability = DialogWindow.m_DialogPermeability;
m_AirConductivity = DialogWindow.m_DialogAirConductivity;
m_AirPermittivity = DialogWindow.m_DialogAirPermittivity;
m_EarthPermeability1 = DialogWindow.m_DialogEarthPermeability1;
m_EarthConductivity1 = DialogWindow.m_DialogEarthConductivity1;
m_EarthPermittivity = DialogWindow.m_DialogEarthPermittivity1;
m_depth = DialogWindow.m_DialogDepth;
m_EarthPermeability2 = DialogWindow.m_DialogEarthPermeability2;
m_EarthConductivity2 = DialogWindow.m_DialogEarthConductivity2;
m_EarthPermittivity2 = DialogWindow.m_DialogEarthPermittivity2;
m_frequency = DialogWindow.m_Dialogfrequency;
}
}
|
|
|
|
|
A dialog does not seem the optimum choice for this. I would suggest switching to a CListView which allows much greater flexibility.
|
|
|
|
|
Can I edit data in a list view? Could you give me an example please or propose me a good tutorial for this case? cause I am new in programming.. :/
|
|
|
|
|
|
lolici wrote: Can I edit data in a list view?
Off course you can, advantage of using List View over Listbox is that you can create columns and ability of in place editing. Here is one such article ListCtrl Operations[^]
|
|
|
|
|
Good Morning Sir,
can we use std::string for handling names like chinese letters, japanese letters? I mean we can use them for string comparison like "some chinese stuff"=="some chinese stuff" will it work?? Thank you sir for your time excuse my english
|
|
|
|