|
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!
|
|
|
|
|
|
Can i add and remove the border of an editbox at runtime?
|
|
|
|
|
yes
take a look at GetWindowLong and SetWindowLong
|
|
|
|
|
hi i am writing a win 32 service while will detect the USB device when connected. I need to know the name of device which is connected i have written following service handler.
VOID WINAPI ServiceHandler(DWORD fdwControl,DWORD evtype, LPVOID evdata, LPVOID Context)
{
/*DEV_BROADCAST_VOLUME* pDev = (DEV_BROADCAST_VOLUME*)evdata;*/
DEV_BROADCAST_HDR* pHdr = (DEV_BROADCAST_HDR*)evdata;
switch(fdwControl)
{
case SERVICE_CONTROL_STOP:
case SERVICE_CONTROL_SHUTDOWN:
ProcessStarted = FALSE;
ServiceStatus.dwWin32ExitCode = 0;
ServiceStatus.dwCurrentState = SERVICE_STOPPED;
ServiceStatus.dwCheckPoint = 0;
ServiceStatus.dwWaitHint = 0;
// terminate all processes started by this service before shutdown
{
EndProcess(/*i*/0);
delete ProcessNames[/*i*/0];
}
break;
case SERVICE_CONTROL_PAUSE:
ServiceStatus.dwCurrentState = SERVICE_PAUSED;
break;
case SERVICE_CONTROL_CONTINUE:
ServiceStatus.dwCurrentState = SERVICE_RUNNING;
break;
case SERVICE_CONTROL_INTERROGATE:
break;
case SERVICE_CONTROL_DEVICEEVENT:
switch(evtype)
{
case DBT_DEVICEARRIVAL:
//DEV_BROADCAST_VOLUME* pDev = (DEV_BROADCAST_VOLUME*)evdata;
if(pHdr->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE)
{
DEV_BROADCAST_DEVICEINTERFACE *pDevInt = (DEV_BROADCAST_DEVICEINTERFACE*)evdata;
UpdateDevice(pDevInt,(WPARAM)evtype);
}
break;
case DBT_DEVICEREMOVECOMPLETE:
//DEV_BROADCAST_VOLUME* pDev = (DEV_BROADCAST_VOLUME*)evdata;
if(pHdr->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE)
{
DEV_BROADCAST_DEVICEINTERFACE *pDevInt = (DEV_BROADCAST_DEVICEINTERFACE*)evdata;
UpdateDevice(pDevInt,(WPARAM)evtype);
}
break;
}
break;
}
in case of DBT_DEVICEARRIVAL the pDevInt i am getting does not contain the dbcc_name string. it only contains "\". Plz help where i am doing wrong
thanx in advance
|
|
|
|
|
How to Wipe/Clean Internet Explorer's temporary internet Files, Cookies, History, Cache using C++/VC++/MFC
|
|
|
|
|
|
i need C++/VC++/MFC Code to wipe/clean Internet Explorer temporary internet Files, Cookies, History, Cache
|
|
|
|