![]() |
|
#1
|
|||
|
|||
Visual C++ and postgres!Hello ,
What works I have built a application in Visual Basic (Visual Studio 200 what I seek? The need of my current project is to implement the same feature using Visual C++ . I am unaware if this could be implemented more or less in the same way as i did in Visual basic and need your advice/suggestion, how do i proceed. importantly i was playing around visualc++ and created more or less a succesfull connection to postgres using following. MFC Application Wizard -> Database support Choose : Database view with file support ODBC (Client type) and proceeding thereafter . connection is tested successfully ,no wonder but form also shows a application menu Record on menu bar, however i fail to access the records. Please let me know your advice to help me proceed further. Any example, weblink would be simply great. thanks, Regrds Abhi |
|
#2
|
|||
|
|||
Re: Visual C++ and postgres!Hi there....
I'm not that gud in VC++..But i have some bad experience on it. I was also put in the same position..But I just wanna share what I happened to me and what I did... I had to modify an existing file-based MFC VC++ application to store the information to MySQL.. I was having problems with the wizard because my project was being converted from old versions of visual studio and it seems that there were lots of issues to be sorted.... Since the wizard didn't work well with the database, I had to go for the manual way.... I ended up with the following problems... - it was an unmanaged C++ program. So we cant simply include any dlls. The reason is unclear(I don;t know). /CLR option is needed if we are using #using . - I tried to use mysql.data.dll .This is an ADO connector. But couldnt get it right.. - I also tried to use the MySql C++ libraries. I was not competent enough to use it Since my project is a complicated one..I didn't know what to do.. Finally I withdrew from the C++ application and created a VB .NET application to handle the data , database and results and executed this particular vb .net application from the c++ application using the createprocess() I used ODBC driver for MySQL with the VB .NET application I know I wrote lot of unwanted stuffs for your question...I just wanna share this...thats all... Gud luck with ur application... Cheers Jana |
|
#3
|
|||
|
|||
Re: Visual C++ and postgres!Finally I withdrew from the C++ application and created a VB .NET application to handle the data , database and results and executed this particular vb .net application from the c++ application using the createprocess()
Hi Jana, Well..!! i already have a a vb. net application which i can use to handle my database., Could you throw some more light on how to create and use createprocess().Is tthere any wizard available..how do i proceed with this? please let me know Thanks, Abhi |
|
#4
|
|||
|
|||
Re: Visual C++ and postgres!Source: forums.devx.com
Here is the code which does the trick which was copied from the above link.... ############################# STARTUPINFO si = {0}; PROCESS_INFORMATION pi = {0}; ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) ); TCHAR szCommandLine[] = _T("\"C:\\Windows\\system32\\calc.exe\""); if( !CreateProcess( NULL, szCommandLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ) ) { _tprintf( _T("CreateProcess failed - %d\n"), GetLastError() ); return; } WaitForSingleObject( pi.hProcess, INFINITE ); CloseHandle( pi.hProcess ); CloseHandle( pi.hThread ); ------------------------------ I'm not familiar with any wizards as they don't work for my projects.. But if you are starting from scratch, then you can create dialog boxes/forms and connect your class to them and do your thing.... |
Recent GIDBlog
Last Week of IA Training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The