|
Do you know suchon_phuong ?
|
|
|
|
|
I recognize the name. If you look at the users posts they are mostly gibberish or the most general questions in programming. I have a few people whose names tend to pop out for bad behavior, such as URGENT all the time.
______________________
stuff + cats = awesome
|
|
|
|
|
You can ask on the correct forum for C# we have a forum on the codeproject.
|
|
|
|
|
Hi,
Whenever we generate a MFC app, it generates standard skeleton and code for storing
options and MRU in the registry in the BOOL CSampleApp::InitInstance()
function.
<br />
SetRegistryKey(_T("SampleApp"));<br />
LoadStdProfileSettings(0);
The above comment suggests that options can be loaded either from INI or registry,
and by default registry is used.
How to activate the use of INI files insted of registry.
I'm using VS2005.
Thanks
--
Why buy the cow when milk is free?
|
|
|
|
|
One INI file is a standard file, you should search the MSDN or here in the CP in order to get more information on how to open, read, write and close files.
I would recommend you to use XML files instead of ini files... but this is only a matter of preferences...
If you would like to go to the XML way you should learn how to use any of the interfaces that are in the market.
Hope this helps.
|
|
|
|
|
You can easily switch to using INI files. The major problem you will have is deciding where to put them - Microsoft discourages writing into any of the C:\Program Files folders, which is where your app will usually be installed. But, once you know where you want it, switching to INI file is easy:
- Construct path to INI file:
BOOL CApp::InitInstance()
{
.
.
.
m_strProfileFilePath = "";
m_strProfileFilePath = GetModulePath();
m_strProfileFilePath += "\\";
m_strProfileFilePath += "MyApp.ini";
- Next we need to clean up MFC's default INI string:
free((void*)m_pszProfileName);
m_pszProfileName = _strdup(m_strProfileFilePath);
- Now we can use the standard profile functions in CWinApp:
WriteProfileString("FilesToAdd", "File001", "CRASH.DMP,Crash Dump,DMP File");
WriteProfileString("FilesToAdd", "File002", "ERRORLOG.TXT,Crash log,Text Document");
WriteProfileString("FilesToAdd", "File003", "MyApp.ini,INI File,Text Document");
.
.
.
|
|
|
|
|
Hi,
I've got a static text box on my dialog, I've renamed the text box which then allows me to access its events. I've added an on click event which has automatically created an 'OnStnClicked' method and added an entry to the message map. However when I run the code the 'OnStnClicked' doesn't get called.
Do I need to add change any of the properties on the text control to allow this method to be called? (Double clicking on the text whilst in design mode takes me to the created method)
TIA,
Andy
|
|
|
|
|
Figured it out, needed to set the 'Notify' property to True.
|
|
|
|
|
You need to set the Notify property to True
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
|
|
|
|
|
If you add the SS_NOTIFY then the parent window will receive a STN_CLICKED notification (in a
WM_COMMAND message). You can set the SS_NOTIFY style in the control's property window by setting
the Notify property to true.
You can catch the message in the parent with
afx_msg void OnStaticClicked();
...
ON_CONTROL(STN_CLICKED, IDC_MYSTATIC, OnStaticClicked)
...
void CMyDialog::OnStaticClicked()
{
// do something here
}
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Hi.
Anybody know.
what's function use for convert number between binary and decimal.
|
|
|
|
|
A number is a number whether binary or decimal.
You have to define what you are trying to do before anyone will be able to help.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
|
|
|
|
|
Wes Aday wrote: A number is a number whether binary or decimal.
what about octal?
|
|
|
|
|
octal is so 1980s. I prefer base 7.
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
led mike wrote: what about octal
Well I can only count zero and not zero.... so octal is out of my league....
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
|
|
|
|
|
What is the binary type? Integer? Floating point?
By decimal, do you mean a decimal string?
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
For Example
(binary) (decimal)
00 0
01 1
10 2
11 3
What's function support this issue?
|
|
|
|
|
Ok... watching this could prove entertaining
|
|
|
|
|
#include <iostream>
#include <string>
#include <math.h>
using namespace std;
int main(void){
string bi = "1010"; //binary
int result= 0;
for (int i = 0; i< bi.size(); i++){
if (bi[i] == '1'){
result += pow((double)2,(double)bi.size()-i)/2;
}
}
cout << result << endl;
return 0;
}
that should work
|
|
|
|
|
string sbin("1011");<br />
char* ptr;<br />
long num = strtol( sbin.c_str(), &ptr, 2);<br />
cout << num << endl;<br />
<br />
|
|
|
|
|
oh cool function
|
|
|
|
|
I see we are having another Fish Fillet special [below]
I must horizontally challenged ... below above
Last modified: 1hr 25mins after originally posted --
|
|
|
|
|
That's two mornings in a row I smelled McD's first thing
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Hi,
I have a program, SDI, with FormView, CGreenView written in vc++6. I have created a subclass of CListCtrl named CMyListCtrl .
Now, when the user right-clicks on the listctrl, a menu pops up with options like 'edit', 'delete' etc. When the user selects 'edit' a dialog pops up and some stuff is done. The coding for the handling the right-click, calling the dialog box is done in CMyListCtrl.
After the dialog box closes, I want to call a function which is written in CGreenView the main view class.
Please can you tell me the right way of doing it?
void CMyListCtrl::OnRecordEdit()
{
if (nItem != -1)
{
CAddNew *pDlg = new CAddNew();
pDlg->type = 2;
Dlg->DoModal();
delete pDlg;
}
}
Thanks.
Fortitudine Vincimus!
|
|
|
|
|
I wouldn't try to call the containing view directly from the contained control. Rather you want to catch the EN_CHANGE or similar message that the control will send to its parent when you commit the changes to it. This will probably turn up at the parent as a WM_NOTIFY and you'll need to pull it apart from there and determine that it came from the control you're interested in and due to the cause you're looking for. Have fun
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|