当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

    摘要: 做一个dll,要求其中的一个函数返回一个结构,该怎么做,具体一点 ......
 ·三角形剖分问题,啊    »显示摘要«
    摘要: 有上百个点的集合,这些点按次序给出,两两连线组成多边形(可能为凹多边形), 求算法,把这些点组成的多边形分割成若干个三角形,即已有点集vertex[?]= {p1,p2,p3.........},要求将这些点组成的多边形剖分成若干个不相交的三角形, 最后输出{p1,p2,p3},{p1,p3,p4},........ 一定要考虑凹多边形的情况,事实上令我头痛的也正是这个问题, 请各位施以援......


关于OpenDialog等的菜鸟问题

VB下怎样打开一个OpenDialog、SaveDialog之类的对话框?  
  对话框打开的文件怎样传递给调用者?

NO.1   作者: lilaclone

Dim   strFileName   As   String  
          CommonDialog1.ShowOpen   打开  
          CommonDialog1.ShowSave   保存  
          strFileName   =   CommonDialog1.FileName

NO.2   作者: rainstormmaster

也可以用API函数实现:  
  GetOpenFileName打开OpenDialog  
  GetSaveFileName打开SaveDialog

NO.3   作者: wzhiyuan

说句废话:要先添加CommonDialog控件:)  
 

NO.4   作者: starwx

同意lilaclone(~~阿九~~)   的

NO.5   作者: prettyladys

20分给定我。   CRTL+   T     然后   选择   Microsoft   common     dialog     6.0  
   
  然后画出来。                 Dim   strFileName   As   String  
          CommonDialog1.ShowOpen   打开  
          CommonDialog1.ShowSave   保存  
          strFileName   =   CommonDialog1.FileName

NO.6   作者: Rozre

20分给我吧。   先打开电脑     然后   --》单击开始——》程序…………再打开    
                            Microsoft   Visual   Basic   6.0     再打开你要编写的程序  
                          CRTL+   T     然后   选择   Microsoft   common     dialog   control   6.0  
                            这个控件的路径是:c:\windows\system\comdlg32.ocx  
                          双击     在左边工具栏   多出来的哪个图标  
      代码如下:  
          Dim   strFileName   As   String  
          CommonDialog1.ShowOpen   打开  
          CommonDialog1.ShowSave   保存  
          strFileName   =   CommonDialog1.FileName  
  哈哈   够详细了吧!

NO.7   作者: rainstormmaster

用API函数的话,不用加载Microsoft   common     dialog   control   6.0,但是要声明函数:Private   Declare   Function   GetOpenFileName   Lib   "comdlg32.dll"   Alias   "GetOpenFileNameA"   (pOpenfilename   As   OPENFILENAME)   As   Long  
  Private   Declare   Function   GetSaveFileName   Lib   "comdlg32.dll"   Alias   "GetSaveFileNameA"   (pOpenfilename   As   OPENFILENAME)   As   Long  
  Private   Type   OPENFILENAME  
          lStructSize   As   Long  
          hwndOwner   As   Long  
          hInstance   As   Long  
          lpstrFilter   As   String  
          lpstrCustomFilter   As   String  
          nMaxCustFilter   As   Long  
          nFilterIndex   As   Long  
          lpstrFile   As   String  
          nMaxFile   As   Long  
          lpstrFileTitle   As   String  
          nMaxFileTitle   As   Long  
          lpstrInitialDir   As   String  
          lpstrTitle   As   String  
          flags   As   Long  
          nFileOffset   As   Integer  
          nFileExtension   As   Integer  
          lpstrDefExt   As   String  
          lCustData   As   Long  
          lpfnHook   As   Long  
          lpTemplateName   As   String  
  End   Type  
   
  Private   Sub   Command1_Click()  
  Dim   OFName   As   OPENFILENAME  
          OFName.lStructSize   =   Len(OFName)  
          Set   the   parent   window  
          OFName.hwndOwner   =   Me.hWnd  
          Set   the   applications   instance  
          OFName.hInstance   =   App.hInstance  
          Select   a   filter  
          OFName.lpstrFilter   =   "Text   Files   (*.txt)"   +   Chr$(0)   +   "*.txt"   +   Chr$(0)   +   "All   Files   (*.*)"   +   Chr$(0)   +   "*.*"   +   Chr$(0)  
          create   a   buffer   for   the   file  
          OFName.lpstrFile   =   Space$(254)  
          set   the   maximum   length   of   a   returned   file  
          OFName.nMaxFile   =   255  
          Create   a   buffer   for   the   file   title  
          OFName.lpstrFileTitle   =   Space$(254)  
          Set   the   maximum   length   of   a   returned   file   title  
          OFName.nMaxFileTitle   =   255  
          Set   the   initial   directory  
          OFName.lpstrInitialDir   =   "C:\"  
          Set   the   title  
          OFName.lpstrTitle   =   "Open   File   "  
          No   flags  
          OFName.flags   =   0  
   
          Show   the   Open   File-dialog  
          If   GetOpenFileName(OFName)   Then  
                  MsgBox   "File   to   Open:   "   +   Trim$(OFName.lpstrFile)  
          Else  
                  MsgBox   "Cancel   was   pressed"  
          End   If  
  End   Sub  
   
  Private   Sub   Command2_Click()  
  Dim   OFName   As   OPENFILENAME  
          OFName.lStructSize   =   Len(OFName)  
          Set   the   parent   window  
          OFName.hwndOwner   =   Me.hWnd  
          Set   the   applications   instance  
          OFName.hInstance   =   App.hInstance  
          Select   a   filter  
          OFName.lpstrFilter   =   "Text   Files   (*.txt)"   +   Chr$(0)   +   "*.txt"   +   Chr$(0)   +   "All   Files   (*.*)"   +   Chr$(0)   +   "*.*"   +   Chr$(0)  
          create   a   buffer   for   the   file  
          OFName.lpstrFile   =   Space$(254)  
          set   the   maximum   length   of   a   returned   file  
          OFName.nMaxFile   =   255  
          Create   a   buffer   for   the   file   title  
          OFName.lpstrFileTitle   =   Space$(254)  
          Set   the   maximum   length   of   a   returned   file   title  
          OFName.nMaxFileTitle   =   255  
          Set   the   initial   directory  
          OFName.lpstrInitialDir   =   "C:\"  
          Set   the   title  
          OFName.lpstrTitle   =   "Save   File"  
          No   flags  
          OFName.flags   =   0  
   
          Show   the   Save   File-dialog  
          If   GetSaveFileName(OFName)   Then  
                  MsgBox   "File   to   save:   "   +   Trim$(OFName.lpstrFile)  
          Else  
                  MsgBox   "Cancel   was   pressed"  
          End   If  
  End   Sub  
 


    摘要: 菜鸟的问题,不要见笑!在jscript中在按钮的click中如何用response.redrict("")语句? ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE