Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

VC++µÄADOÁ¬½ÓAccess²½Öè

1:ÔÚStaAfx.h ÖÐÌí¼ÓÈçÏ´úÂë #import "C:\\Program Files\\Common Files \\System\\ado\\msado15.dll" no_namespace rename("EOF","adoEOF")rename("BOF","adoBOF")
2:ÔÚBOOL CXXXApp::InitInstance()Öгõʼ»¯COM»·¾³
   ::CoInitialize(NULL);
   ÊÍ·ÅCOM»·¾³
   ::CoUninitialize();
  
3£ºÔÚCXXXAppÍ·ÎļþÖж¨ÒåÁ½¸öÖÇÄÜÖ¸Õëpublic
   Ö¸ÏòRecordset¶ÔÏóµÄÖ¸Õë
   _RecordsetPtr m_pRecordset;
   Ö¸ÏòConnection¶ÔÏóµÄÖ¸Õë
   _ConnectionPtr m_pConnection;
  
  
4:ÔÚvoid CXXXApp::OnInitADOConn()
{
 //ÓÃÓÚÈ«¾Ö±äÁ¿µ÷ÓÃÁ¬½ÓÊý¾Ý¿â
       try
 {
  //´´½¨Á¬½Ó¶ÔÏóʵÀý
  m_pConnection.CreateInstance("ADODB.Connection");
  //ÉèÖÃÁ¬½Ó×Ö·û´®
  CString strConnect="DRIVER={Microsoft Access Driver/                                 (*.mdb)};uid=;pwd=;DBQ=canyin.mdb;";
  //ʹÓÃopen·½·¨Á¬½ÓÊý¾Ý¿â
  m_pConnection->Open((_bstr_t)strConnect,"","",adModeUnknown);
 }
 catch(_com_error e)
 {
  CString temp;
  temp.Format("Á¬½ÓÊý¾Ý¿â´íÎóÐÅÏ¢£º%s",e.ErrorMessage());
  ::MessageBox(NULL,temp,"ÌáʾÐÅÏ¢",NULL);
 }
}
5£ºvoid CXXXApp::ExitConnect()
{
 //ÓÃÓÚÈ«¾Ö±äÁ¿µ÷ÓùرÕÊý¾Ý¿â
        //¹Ø±Õ¼Ç¼¼¯
 if(m_pRecordset!=NULL)
  m_pRecordset->Close();
   m_pConnection->Close;
}
5£º
<1>   //´ò¿ªÊý¾Ý¿âÁ¬½Ó
      OnInitADOConn();
             1£© //´´½¨Á¬½Ó¶ÔÏóʵÀý
                m_pConnection.CreateInstance("ADODB.Connection");
&n


Ïà¹ØÎĵµ£º

c/c++Êä³öºº×Ö

1. ʹÓÃTCHARÀàÐÍ£¬¶¨ÒåÔÚtchar.hÖÐ
#include <tchar.h>
#include <stdio.h>
int main()
{
 TCHAR s[] = "Äã";
 printf("%s \n",s);
 return 0;
}
2.¹ØÓÚC++ÖÐÎÄ×Ö·ûµÄ´¦Àí
 
Ò» ÒýÈëÎÊÌâ
´úÂë wchar_t a[3]=L”Öйú”£¬±àÒëʱ³ö´í£¬³ö´íÐÅϢΪ£ºÊý×éÔ½½ç¡£µ«wchar_ ......

ÈçºÎÔÚLinuxʹÓÃEclipse + CDT¿ª·¢C/C++³ÌÐò?

A. ΪʲôҪÔÚLinuxʹÓÃEclipse¿ª·¢C/C++³ÌÐò?
LinuxÊÇÒ»¸öÒÔC/C++¿ª·¢ÎªÖ÷µÄƽ̨£¬ÎÞÂÛÊÇKernel»òÊÇApplication£¬Ö÷Òª¶¼Ê¹ÓÃC/C++¿ª·¢¡£´«Í³ÔÚLinuxÏ¿ª·¢³ÌÐò£¬ÊÇÔÚÎÄ×ÖģʽÏ£¬ÀûÓÃviµÈÎÄ×ֱ༭Æ÷׫дC/C++³ÌÐò´æÅ̺ó£¬ÔÚCommand lineÏÂʹÓÃgcc±àÒ룬ÈôÒªdebug£¬ÔòʹÓÃgdb¡£
ÕâÖÖ¿ª·¢·½Ê½Éú²úÁ¦²¢²»¸ß£¬ÈôÖ»ÊÇ¿ª·¢Ñ§ ......

ÉîÈëC/C++Ö®»ùÓÚCheckStackVarsµÄ°²È«¼ì²é£¨VS2008£©

×î½üһֱæ±ÏÒµµÄÏà¹ØÊÂÇ飬¼ÓÉϹ¤×÷£¬×ªÑۼ䣬ÓÖµ½Ôµ×ÁË£¬Ö®Ç°³ÐŵµÄÿÔÂһƪ²©ÎÄ£¬Ç°¼¸Ìì¾ÍÒ»Ö±ÔÚÑ°ÕÒµ½µ×Ҫдʲô£¬½üÁ½ÌìÓÖͻȻ·¢ÏÖÓкܶණÎ÷¿ÉÒÔд¡£±¾Æª¾ÍÏÈÑÓÐø֮ǰµÄһƪ»ùÓÚCookieµÄ°²È«¼ì²é»úÖÆ£¨ÉîÈëC/C++Ö®»ùÓÚCookieµÄ°²È«¼ì²é£¨VS2005£©£©À´½éÉÜÏÂÁíÍâÒ»ÖÖÔÚDEBUG°æ±¾Ïµİ²È«¼ì²é£¬Ò²¾ÍÊÇCheckStackVars¼ì ......

ÔÚEclipseϵÄC/C++¿ª·¢£¨Eclipse3.2 + CDT 3.1£©


ÒªÈàEclipse ¿ÉÒÔ¿ª·¢ C/C++ ³Ìʽ£¬Òª¹ÒÉÏ CDT ²Å¿ÉÒÔ¡£
 
Ê×ÏÈÒªÏÂÔØCDT
 
CDTµÄ×îа汾ÊÇ 3.1.0£¬ËüÖ§³Öeclipse3.2.0£¬ÆäÏÂÔصØÖ·£ºhttp://download3.eclipse.org/tools/cdt/releases/callisto/dist/3.1.0/£¬»òÕßÊǵ½http://www.eclipse.org/cdt/downloads.phpÏÂÔØÆäËü° ......

C++&wxWidgets ¿çƽ̨´°¿Ú³ÌÐò¿ª·¢(¶þ,Linuxƪ)

ÎÒÓõÄLinuxϵͳÊÇUbuntu 10.04
Ê×ÏÈ, °²×°wxWidgets 2.8. Ä¿Ç°wxWidgetsÓÐÁ½¸öÎȶ¨°æ±¾, 2.6ºÍ2.8, ÎÒÃÇÑ¡×îеÄ. ´ò¿ª “Ubuntu
Èí¼þÖÐÐÄ”, ÔÚËÑË÷¿òÀïÊäÈë “wxWidgets”, °ÑÏÂÃ漸¸öÃû×ÖÒÔ”wxWidgets Cross-platform C++ GUI
toolkit”¿ªÍ·µÄÈ«²¿°²×°. ×°Íêºó, ´ò¿ªÒ»¸öÖÕ¶Ë, ÊäÈ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ