Click here to Skip to main content
15,914,481 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Storing binary data in SQLServer Field Pin
Jeremy Falcon23-Aug-04 6:58
professionalJeremy Falcon23-Aug-04 6:58 
GeneralRe: Storing binary data in SQLServer Field Pin
David Salter23-Aug-04 7:13
David Salter23-Aug-04 7:13 
GeneralMFC and DLL Pin
SylL23-Aug-04 6:17
SylL23-Aug-04 6:17 
GeneralRe: MFC and DLL Pin
Doug Mitchell23-Aug-04 6:20
Doug Mitchell23-Aug-04 6:20 
GeneralRe: MFC and DLL Pin
SylL23-Aug-04 22:42
SylL23-Aug-04 22:42 
GeneralRe: MFC and DLL Pin
SylL23-Aug-04 23:17
SylL23-Aug-04 23:17 
GeneralRe: MFC and DLL Pin
SylL23-Aug-04 23:57
SylL23-Aug-04 23:57 
Questionhow to auto load from ini esp the numbers from the ini file Pin
ELY M.23-Aug-04 5:59
ELY M.23-Aug-04 5:59 
well Im working on clock program...



BOOL CMyDigClockDlg::OnInitDialog()
{
CDialog::OnInitDialog();

// Add "About..." menu item to system menu.

// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);

CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}

// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon

// TODO: Add extra initialization here



SYSTEMTIME CurTime;
CString Time, tmp;
GetLocalTime(&CurTime);
bool cPM = false;


if(CurTime.wHour >12) {
CurTime.wHour -= 12;
cPM = true; }

Time.Format("%u:", CurTime.wHour);

if(CurTime.wMinute <= 9)
{
tmp.Format("0%u:", CurTime.wMinute);
Time.Insert(Time.GetLength(),tmp.GetBuffer(tmp.GetLength()));
}
else {
tmp.Format("%u:",CurTime.wMinute);
Time.Insert(Time.GetLength(),tmp.GetBuffer(tmp.GetLength()));
}

if(CurTime.wSecond <= 9)
{
tmp.Empty();
tmp.Format("0%u", CurTime.wSecond);
Time.Insert(Time.GetLength(),tmp.GetBuffer(tmp.GetLength()));
}
else {
tmp.Empty();
tmp.Format("%u",CurTime.wSecond);
Time.Insert(Time.GetLength(),tmp.GetBuffer(tmp.GetLength()));
}
if(cPM == true)
{
Time.Insert(Time.GetLength()," PM");
}
else {
Time.Insert(Time.GetLength()," AM");
}

m_clock.SetWindowText(Time);
SetTimer(55,1000,NULL);



char sIniFile[MAX_PATH];
GetModuleFileName( NULL, sIniFile, MAX_PATH );
strcpy( strrchr( sIniFile, '\\' ) + 1, "reminderclock.ini" );


char getname[MAX_PATH];
char gethour[MAX_PATH];
char getminutes[MAX_PATH];

char getname2[MAX_PATH];
char gethour2[MAX_PATH];
char getminutes2[MAX_PATH];

char getname3[MAX_PATH];
char gethour3[MAX_PATH];
char getminutes3[MAX_PATH];

char getname4[MAX_PATH];
char gethour4[MAX_PATH];
char getminutes4[MAX_PATH];

char getname5[MAX_PATH];
char gethour5[MAX_PATH];
char getminutes5[MAX_PATH];

char getname6[MAX_PATH];
char gethour6[MAX_PATH];
char getminutes6[MAX_PATH];


GetPrivateProfileString("BOX1", "Title", "", getname, sizeof(getname), sIniFile);
GetPrivateProfileString("BOX1", "Hour", "", gethour, sizeof(gethour), sIniFile);
GetPrivateProfileString("BOX1", "Minutes", "", getminutes, sizeof(getminutes), sIniFile);

GetPrivateProfileString("BOX2", "Title", "", getname2, sizeof(getname2), sIniFile);
GetPrivateProfileString("BOX2", "Hour", "", gethour2, sizeof(gethour2), sIniFile);
GetPrivateProfileString("BOX2", "Minutes", "", getminutes2, sizeof(getminutes2), sIniFile);

GetPrivateProfileString("BOX3", "Title", "", getname3, sizeof(getname3), sIniFile);
GetPrivateProfileString("BOX3", "Hour", "", gethour3, sizeof(gethour3), sIniFile);
GetPrivateProfileString("BOX3", "Minutes", "", getminutes3, sizeof(getminutes3), sIniFile);

GetPrivateProfileString("BOX4", "Title", "", getname4, sizeof(getname4), sIniFile);
GetPrivateProfileString("BOX4", "Hour", "", gethour4, sizeof(gethour4), sIniFile);
GetPrivateProfileString("BOX4", "Minutes", "", getminutes4, sizeof(getminutes4), sIniFile);

GetPrivateProfileString("BOX5", "Title", "", getname5, sizeof(getname5), sIniFile);
GetPrivateProfileString("BOX5", "Hour5", "", gethour5, sizeof(gethour5), sIniFile);
GetPrivateProfileString("BOX5", "Minutes5", "", getminutes5, sizeof(getminutes5), sIniFile);

GetPrivateProfileString("BOX6", "Title", "", getname6, sizeof(getname6), sIniFile);
GetPrivateProfileString("BOX6", "Hour6", "", gethour6, sizeof(gethour6), sIniFile);
GetPrivateProfileString("BOX6", "Minutes6", "", getminutes6, sizeof(getminutes6), sIniFile);


m_name = _T(getname);
m_hour = gethour; ----- PROBLEM HERE -----
// m_minutes = getminutes;






UpdateData(FALSE);



return TRUE; // return TRUE unless you set the focus to a control
}



ERROR HERE:


--------------------Configuration: MyDigClock - Win32 Debug--------------------
Compiling...
MyDigClockDlg.cpp
C:\-= My Stuff =-\-= programs =-\-= MY CLOCKS =-\MyDigClockTest\MyDigClockDlg.cpp(268) : error C2440: '=' : cannot convert from 'char [260]' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
Error executing cl.exe.

MyDigClock.exe - 1 error(s), 0 warning(s)





look at the bottom of the code.

m_hour = gethour; is problem.

how could get numbers from ini to load in the edit boxes properly ?
AnswerRe: how to auto load from ini esp the numbers from the ini file Pin
David Salter23-Aug-04 6:07
David Salter23-Aug-04 6:07 
AnswerRe: how to auto load from ini esp the numbers from the ini file Pin
David Crow23-Aug-04 7:50
David Crow23-Aug-04 7:50 
Generalemo75u Pin
emo75u23-Aug-04 4:28
emo75u23-Aug-04 4:28 
GeneralRe: emo75u Pin
Cedric Moonen23-Aug-04 4:33
Cedric Moonen23-Aug-04 4:33 
GeneralCTreeCtrl with checkboxes Pin
фил23-Aug-04 3:41
фил23-Aug-04 3:41 
GeneralRe: CTreeCtrl with checkboxes Pin
vcplusplus23-Aug-04 5:16
vcplusplus23-Aug-04 5:16 
Generalexit( ); Error descriptions in VC++ 7! Pin
CreepingFeature23-Aug-04 1:55
CreepingFeature23-Aug-04 1:55 
GeneralRe: exit( ); Error descriptions in VC++ 7! Pin
jhwurmbach23-Aug-04 2:18
jhwurmbach23-Aug-04 2:18 
GeneralBounding box of a set of points... Pin
Anonymous23-Aug-04 1:09
Anonymous23-Aug-04 1:09 
GeneralRe: Bounding box of a set of points... Pin
Cedric Moonen23-Aug-04 1:20
Cedric Moonen23-Aug-04 1:20 
GeneralRe: Bounding box of a set of points... Pin
Anonymous23-Aug-04 2:32
Anonymous23-Aug-04 2:32 
GeneralRe: Bounding box of a set of points... Pin
Maximilien23-Aug-04 2:46
Maximilien23-Aug-04 2:46 
GeneralRe: Bounding box of a set of points... Pin
Cedric Moonen23-Aug-04 2:55
Cedric Moonen23-Aug-04 2:55 
GeneralRe: Bounding box of a set of points... Pin
Anonymous23-Aug-04 3:23
Anonymous23-Aug-04 3:23 
GeneralRe: Bounding box of a set of points... Pin
Maximilien23-Aug-04 3:30
Maximilien23-Aug-04 3:30 
GeneralRe: Bounding box of a set of points... Pin
Anonymous23-Aug-04 3:35
Anonymous23-Aug-04 3:35 
GeneralRe: Bounding box of a set of points... Pin
Cedric Moonen23-Aug-04 3:30
Cedric Moonen23-Aug-04 3:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.