|
Hi ALL,
I have a strange problem with me..... I have an application(vc++) in which i am taking login to SYBASE database.For that i am using Sybase SDk.My code is working fine with MS-2000 OS,But when i am working the same code in vista machine i am getting login crash when I enter wrong password/username....But working successfully with correct details...
I have code like this...
_dbproc = dbConnect (&_loginfo, _T("Phoenix")); (this is calling of my function)
Called Function:
DBPROCESS NEAR * CALLBACK dbConnect (LPLOGINFO li, LPSTR app)
{
DBPROCESS NEAR *dbproc;
LOGINREC *login;
if ((login = dblogin ()) == NULL)
return (DBPROCESS NEAR *) NULL;
DBSETLHOST (login, _dbhost); //for host
DBSETLUSER (login, li->dbid); //for username
DBSETLPWD (login, li->dbpwd);//for password
DBSETLAPP (login, app); //for application name
dbproc = dbopen (login, li->dbsrv); (My Login crashes here when i enter wrong username/password)
dbfreelogin (login);
if (dbproc != (DBPROCESS NEAR *) NULL)
dbuse (dbproc, li->dbdb);
return dbproc;
}
As i said above dblogin() is a function that returns LOGINREC structure pointer when we provide correct login details otherwise FALSE...
And dbopen() function takes the LOGINREC as a first input argument and tries to open the application...
But not returning back when i enter incorrect login details.....There it is crashing...
Can anybody helps in this..
Thanks in advance
|
|
|
|
|
Looks like a deja-vu to me...
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,
So I have Visual C++ 2008 Express, won't be buying Std edition any time soon, and I'm very annoyed to find out the Express doesn't have all the libraries, like the MFC libraries.
So I had this problem where my program would not compile because it couldn't find "winres.h" I just renamed "winresrc.h" to "winres.h" to get it to compile. I don't know if that is going to work out or not.
So, I'm guessing winres.h just isn't part of the Windows SDK, instead it is included in the MFC libraries?
My next step is to get the Windows Template Library, and see if that helps.
Does anyone have knowledge about these issues?
|
|
|
|
|
mtthw wrote: Visual C++ Express, No MFC? Does that matter?
That's actually a feature.
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]
|
|
|
|
|
Oh, thanks, Reading the instructions and manuals, I don't know
what I am reading half the time. But eventually it makes sense.
I appreciate the reply.
|
|
|
|
|
Express is free... be happy with that.
This signature was proudly tested on animals.
|
|
|
|
|
Thanks for replying.
Yes, I'm glad MS offers this tool to learn about windows development. I think its
awesome.
|
|
|
|
|
mtthw wrote: and I'm very annoyed to find out the Express doesn't have all the libraries, like the MFC libraries.
It does state that in the product information.
mtthw wrote: So, I'm guessing winres.h just isn't part of the Windows SDK, instead it is included in the MFC libraries?
Yes I think that is correct, I think winres is just a wrapper for winresrc, in the same way MFC is a wrapper for Win32.
On the plus side I do find VC++ Express a really good product for home use, and I have never missed MFC since I gave it up years ago.
|
|
|
|
|
Thanks.
Yeah, Just beginning to learn C++ last couple of months. It seems like Visual C++ express is the best free compiler. If I get good at this, I'll have the check out the upgraded versions.
|
|
|
|
|
mtthw wrote: Yeah, Just beginning to learn C++ last couple of months.
I would recommend you stick to pure C++ until you feel totally comfortable with it, and avoid trying to understand MFC, WTL or the like. I went through this process some years back and got totally confused trying to learn C++ and MFC at the same time.
Good luck.
|
|
|
|
|
See here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
the WTL is a fine library so learn to use it. At Code project the ware a lot of samples how to use it.
The MFC has the advantage that the wizards of the VC work with it but the disadvantage that it is like outdated glue.
If you need portability than you should consider other libraries. As Qt.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
KarstenK wrote: The MFC has the advantage that the wizards of the VC work with it but the disadvantage that it is like outdated glue. Sigh
I thought MFC is like hot glue. It's great for quick or simple work, even after years you can pull out your hot glue gun and it does the job. I once borrowed a van and lost a mirror on the Autobahn, luckily we could make one from spare parts (hand mirror and a plastic bowl), hotglued it back on and continued the travel. Can Silverlight do that?
Have a good weekend!
|
|
|
|
|
Working with glue is fine if you do a "glue" job. But if you want to engineer a car you need finer tools.
I do a lot with MFC, but for finer control, lighter setups you better stick to ATL or WTL. Or the code isnt portable to other platforms. A time ago after I throw all MFC stuff out of my code to get running on MAC OS with GCC. Since than I try to separate "pure C" and MFC code in classes.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hai,
I am developing a MDI based application. In that i have two set of splitter. For ex splitter1 has TestView1, TestView2 and splitter2 has TestView3, TestView4. In this situation i am loading the splitter1 as initial view for my application. Here i want to open the splitter2 by some menu selection in the same document. How can i get this result.
Expect your guidance to solve this issue.
Thanks in advance
by
bagavathikumar
Bagavathikumar
|
|
|
|
|
|
I'm using Visual C++ 2005 and have added a dialog to my project.
When i tried to add class for this dialog by right click and select "Add Class"
It pops up a script error: "Line: 815
Error: Object doesn't support this property or method".
Ratheesh.
|
|
|
|
|
|
Hi Friends,
Iam devloping a application where i want to write some set of contacts to outlook, where i tried off but unable to write it can any body help me out.
Procedre what i did.
1. created a session sucessfully
2. opned message store
3. opened contacts folder in outlook
4. stored that pointer into variable called m_pUser
5. with that pointer iam writing st of properties and saving it into the contacts folder.
Iam sure with the first three steps please go through 4 and 5 steps and help me out please.
Here i my core logic
::HrGetOneProp(MsgStore,PR_IPM_SUBTREE_ENTRYID,&propval);
MsgStore->OpenEntry(propval->Value.bin.cb,LPENTRYID(propval->Value.bin.lpb),0,MAPI_MODIFY,&ulObjType,(LPUNKNOWN*)&RootFolder);
hr=RootFolder->CreateFolder(FOLDER_GENERIC,(LPTSTR)"Contacts",NULL,0,OPEN_IF_EXISTS ,&ContactsFolder);
cout<<hr;
IMailUser *m_pUser = NULL;
hr=ContactsFolder->OpenEntry(propval->Value.bin.cb,LPENTRYID(propval->Value.bin.lpb),0,MAPI_BEST_ACCESS,&ulObjType,(LPUNKNOWN*)&m_pUser);
if(FAILED(hr))
{
cout<<"FAiled to Oen Contacts Folder";
}
SPropValue prop;
prop.ulPropTag=PR_DISPLAY_NAME;
prop.Value.lpszW=(LPTSTR)"ROCK";
m_pUser->SetProps(1,&prop,NULL);
prop.ulPropTag=PR_PRIMARY_TELEPHONE_NUMBER;
prop.Value.lpszW=(LPTSTR)"999999999999";
m_pUser->SetProps(1,&prop,NULL);
prop.ulPropTag=PR_BUSINESS_TELEPHONE_NUMBER;
prop.Value.lpszW=(LPTSTR)"1234567";
m_pUser->SetProps(1,&prop,NULL);
m_pUser->SaveChanges(true);
m_pUser->Release();
Can some body provide me any samples for referece so that i will be helpfull for me.
Thank in ADvance.
|
|
|
|
|
i missed the eror checking in the last steps of your pcde. It often helps more than believed
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
I tried the following in VS6.0. Created a simple "Hello World" application then added the following:
int i;
int j;
i = j = 5;
printf("%d %d %d %d %d %d\n",++i,j++,i++,++j,++i,j++);
printf("i %d j %d\n",i,j);
Now i expected the output to be:
8 7 6 7 6 5
i 8 j 8
But instead it printed as:
7 6 6 6 6 5
i 8 j 8

|
|
|
|
|
Ralph_2 wrote: Now i expected the output to be:
8 7 6 7 6 5
You cannot expect that behaviour (and you should avoid using the increment operators that way).
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]
|
|
|
|
|
CPallini wrote: and you should avoid using the increment operators that way
Oh, this is just for trying...I don't use it any where as such
CPallini wrote: You cannot expect that behaviour
Why cannot i expect the output to be that? You think the output is wrong? Or different compilers will treat the statement differently??
|
|
|
|
|
Ralph_2 wrote: Or different compilers will treat the statement differently??
Yes.
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]
|
|
|
|
|
This actually sounds absurd to me. Its more like anti-C 
|
|
|
|