|
If you have global objects in your program their constructor runs before main gets executed and if these perform something ugly then your program will crash before hitting main. And you handle it by not doing anything that causes your program to crash. What do you mean by "How we handle that"?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
thanks
-----------------------------
I am a beginner
|
|
|
|
|
hrishiS wrote: how do we handle that?
We don't launch your program...
On the serious side: What program (or, at least kind of)? Could you please elaborate (and possibly post some code)? Could you debug it (the call stack window is usually pretty informative)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Sounds like an interview / homework question to me
|
|
|
|
|
Yes, maybe.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hello all
i made an application in which i had to display icons next to menu item and i did it successfully and it works fine in windows 2000, vista, 7 but in case of windows 2003 and Xp, there lies a problem as if in case any tool tip is displayed over my context menu, the menu item over which the tool tip lies that menu item`s icon (Only Icon And Not The Text)gets erased......
Can Anybody Suggest me where exactly the problem lies
Any help is highly appreciated
Note :: It happens Only In Case Of Win 2003 and Win. Xp
|
|
|
|
|
Did you display the popup menu the way it is suggested here[^]? I mean this:
SetForegroundWindow(hDlg);
TrackPopupMenu( hSubMenu,
TPM_RIGHTBUTTON,
pt.x,
pt.y,
0,
hDlg,
NULL);
PostMessage(hDlg, WM_NULL, 0, 0);
I know this seems unrelated to the drawing part but who knows...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Hi all,
I have migrated my application(vs-2003 developed) into vs-2008 to be worked on vista machine.I got the .exe and working successfully when i enter a valid username and valid password but fails when i enter a wrong password/username......I am using SYBASE for my aplication,so it comunicates with some SYBASE dlls to get the access.
the code looks like below
(I am providing login details from other dialog)
int DBInterface::LoginSequence (BOOL bFirstLogin)
{
CString user_name;
char dbver[16];
CString srvrname, dbname;
char uname[33];
char upwd[33];
UINT msg;
if (bFirstLogin)
{
dbinit ();
dbsetlogintime (8);
dbmsghandle ((MHANDLEFUNC) msghandle);
dberrhandle ((EHANDLEFUNC) errhandle);
}
int rv = 0;
while (Ops.m_bAutologin && bFirstLogin)
{
if (CSD_DdeReqUserName (uname) == 0)
break;
if (CSD_DdeReqUserPassword (upwd) == 0)
break;
srvrname = App.GetProfileString (INI_SEC, _T("DBServer"), "");
if (srvrname.IsEmpty ())
break;
dbname = App.GetProfileString (INI_SEC, _T("DBDatabase"), "");
if (dbname.IsEmpty ())
break;
strcpy (_loginfo.dbid, uname);
strcpy (_loginfo.dbpwd, upwd);
strcpy (_loginfo.dbsrv, srvrname);
strcpy (_loginfo.dbdb, dbname);
_dbproc = dbConnect (&_loginfo, "Phoenix");
if (_dbproc == NULL)
break;
rv = 1;
TRACE0("Phoenix: successfully logged in using LOGPARMS from anotherapp...\n");
break;
}
CLoginDlg dlg;
while (rv == 0)
{
if (dlg.DoModal() != IDOK)
{
PostQuitMessage(0);
return 0;
}
else {
lstrcpyn(_loginfo.dbpwd, dlg.m_csPassword, 31);
lstrcpyn(_loginfo.dbid, dlg.m_csUser, 31);
lstrcpyn(_loginfo.dbsrv, dlg.m_csServer, 31);
lstrcpyn(_loginfo.dbdb, dlg.m_csDatabase, 31);
}
_dbproc = dbConnect (&_loginfo, _T("Phoenix") );
if (_dbproc != NULL)
break;
msg = (::GetKeyState (VK_CAPITAL) & 0x0001) ?DS_ERR_LOGINFAILEDCAPS : IDS_ERR_LOGINFAILED;
if (AfxMessageBox (msg, MB_OKCANCEL | MB_ICONHAND) == IDCANCEL)
{
PostQuitMessage(0);
return 0;
}
}
In the abobe code from dbconnect()(bold code) it is calling some SYBASE dll and it is not getting the return value when i enter wrong password/username.......
Is there any problem with the dll or anyting else?????
Since i have migrated the code i am thinking that the dll is not compatiable,but this is just an assumption....!
So can anybody help me to solve this issue......
Thaks in advance.
|
|
|
|
|
BTW: why don't you write a minimal application just to test the dbConnect call?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi thanks for the reply...
From dbConnect() control is not getting a return value from a specific dll of SYBASE(hopefully libsybdb.dll) when i enter a wrong password/username..
Sybase works fine for vista ????
|
|
|
|
|
Vetukuri Raju wrote: ybase works fine for vista ????
I don't know. Why don't you make some tests?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
hi everybody.
I need data in edit box : 5 line, 1 line max = 50 characters. then I must set font Courier for Edit box. i using code:
... ::OnInitDialog()
{
CFont m_Font;
VERIFY(m_Font.CreateFont(
12, // nHeight
0, // nWidth
0, // nEscapement
0, // nOrientation
FW_NORMAL, // nWeight
FALSE, // bItalic
FALSE, // bUnderline
0, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
"Courier")); // lpszFacename
CWnd *pWnd = GetDlgItem(IDC_MESSAGE_TEXT);
pWnd->SetFont(&m_Font);
m_Font.DeleteObject();
...
}
=>Data in Edit text is Bold. When I using mouse to choice this Edit text , it show text wrong. seem, it need control of mouse.
for example: show text wrong when type : "y" or "g", it have lost under.
i wish you help me. thanks very much.
**) when using all character UPPER ==> 1 line don't show 50 character.
hope your help. thanks very much
regards
nothing
|
|
|
|
|
First, m_Font needs to persist - you have declared it on stack, therefore it will be destroyed when OnInitDialog() exits. Make it a class variable.
Second, if all you're trying to do is limit the text to 50 characters, you can use pWnd->SetLimitText(50) on the edit box. No need to change the font.
|
|
|
|
|
Hans Dietrich wrote: First, m_Font needs to persist
Not necessarily, I have been using this for years (usually in OnInitDialog):
CFont f1;
LOGFONT lf1;
::ZeroMemory(&lf1, sizeof(lf1));
lf1.lfHeight = 14;
lf1.lfCharSet = ANSI_CHARSET;
lf1.lfWeight = FW_BOLD;
::lstrcpy(lf1.lfFaceName, "Verdana");
f1.CreateFontIndirect(&lf1);
GetDlgItem(IDC_STATUS)->SetFont(&f1);
f1.Detach();
modified on Monday, October 5, 2009 1:06 PM
|
|
|
|
|
thanks everybody very much. thanks Hans Dietrich and Michael Schubert
Michael Schubert answer very good .
nothing
|
|
|
|
|
Dear all,
Is there any class for ECDSA in Visual C++ 6.0?
I search on google and MSDN, but I just found ECDSA class for Visual C++ 2008.
Please give me the reference, if anybody know about that. I really need it.
Thank you,
Eka Candra
|
|
|
|
|
|
Crypto++[^] has ECDSA (presuming you mean Elliptic Curve DSA) and works with VC++6.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
Do we require .Net framework and MFC runtime to run the exe developed in VC++ 6.0 in the system where Visual studio or VC++ 6.0 is not installed.
The exe is built using static linking (set in project setting).
Thanks in advance
|
|
|
|
|
If you statically link to the MFC and C runtime libraries, then there's no need to redistribute anything (except if you are using third party dll's). And certainly not the .NET framework...
|
|
|
|
|
Thanks for the quick reply.
One clarification by setting Use MFC static libraty in the General tab of project setting means both
MFC and C runtime libraries are statically linked, am i correct?
|
|
|
|
|
shir_k wrote: by setting Use MFC static libraty in the General tab of project setting means both
MFC and C runtime libraries are statically linked, am i correct?
Nope. They are independent settings.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Please let me know how to set it.
|
|
|
|
|
Select Project-name->Properties menu item, then (in the newly appeared window) select the Configuration Properties->C/C++->Code Generation node, finally select the Runtime Library item of the list and set it choosing the proper value (for instance Multi-threaded instead of Multi-threaded DLL ).
BTW you may also choose to link with the DLL and then use the Microsoft Visual C++ Redistributable Package (see, for instance, here [^]) to install the required copmponents on the target machine.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
The OP said he was using VC6 and the link to the redistributable that you gave was for VC2008. The VC2008 redist will not work with VC6. The VC6 redist was included in the VC6 SP5 and SP6. Alternately you can get the SP4 file here[^].
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|