Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
V

venadder

@venadder
About
Posts
42
Topics
15
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • MS Word Automation - Combining word documents
    V venadder

    Hi, I am working on a MS Word Automation project using VS2008 and Office 2003 in c# language. I have a One Page Word template which have bookmarks in table cells. These bookmarks are placeholders where specific information is put in from database using c#. I generate say 10 documents based on the template and save them as seperate file. What I would like is to have a 10 page single document. I can use selection.insertfile to create this document. When I do this, all the formatting goes bersek. Basically what i do is:

    Word.Application app = new Word.Application( );
    Word._Document wordDocument = app.Documents.Add(

                                    ref originalTemplate
    
                                  , ref oMissing
    
                                  , ref oMissing
    
                                  , ref oMissing);
    
    
      Word.Selection selection = app.Selection;
    
      
    
      int documentCount = MyGeneratedFiles.Length;
      int breakStop = 0;
    
      foreach (string file in MyGeneratedFiles)
    
      {
    
        breakStop++;
    
        // Insert the files to our template
    
        selection.InsertFile(
    
                                file
    
                                , ref oMissing
    
                                , ref oMissing
                                , ref oMissing
    
                                , ref oMissing);
    
    
    
    
    
    
    
        try
    
        {
    
          if (breakStop != documentCount)
    
            selection.InsertBreak(ref pageBreak);
    
        }
    
        catch (Exception ex) { }
    
      }
    
      wordDocument = null;
    
      app.Visible = true;
    

    This works as far as combining all documents is concerned. But the formattign goes crazy and there are no clearly defined pageBreaks. Is there a better way to combine multiple one page documents into one multi-page single document? I have been stuck on this for a while, any help will be much appreciated. Thank you

    C# help csharp database testing tools

  • copy data from two buffer into one
    V venadder

    yupp it was ridiculous. VOID does not have size so the compiler does not allow pointer aithemetic on it. Any suggestions please!!!!

    C / C++ / MFC help question

  • copy data from two buffer into one
    V venadder

    Hi, I am curious abt shortcuts to copying data from two buffers into one. let's say I have an integer and a buffer of LPVOID type. Now i want to copy these two, int first and then all contents of LPVOId buffer( size known ) into the buffer supplied by the user(LPVOID type). memcpy or memmove will do only wholesale copy, no way to specify from what byte to start. is there any way other then byte by byte copy?? how do u do this kinda thing anyways? any pointers will help, thnx will something like this work mydata is allocated and is of LPVOID type myDataSize is UINT and have correct size( hopefully ) of myData void copy( LPVOID buff, size ) { memmove_s( buffer, size, (LPVOID)&someint, sizeof(int) ); buff += sizeof( int ); memmove_s( buffer, ( size - sizeof( int ) ), myData, myDataSize ); //return the input pointer to original value buff -= sizeof( int ); } //this could be totally laughable thing, but am jsut new to this kinda thing //please excuse me if this code seems ridiculous thnx for help.

    C / C++ / MFC help question

  • dialog button disabled !!!!
    V venadder

    Thanx for your input. I changed it from dialog bar to CDialog anywyas. I have much more control and flexibility that way. It's easy to position teh window even with CDialog. But thanx for your help. I appreciate it.

    C / C++ / MFC help c++ question learning

  • how to save the value/string of CFlexgrid cells as a file onto hard disk?
    V venadder

    Check the SaveGrid method for FlexGrid,here is a quick look: SaveGrid Method Saves grid contents and format to a file. Syntax [form!]VSFlexGrid.SaveGrid FileName As String, SaveWhat As SaveLoadSettings, [ FixedCells As Boolean ] Remarks This method saves a grid to a binary or to a text file. The grid may be retrieved later with the LoadGrid method. Grids saved to text files may also be read by other programs, such as Microsoft Excel or Microsoft Word. The parameters for the SaveGrid method are described below: FileName As String The name of the file to create, including the path. If a file with the same name already exists, it is overwritten. SaveWhat As SaveLoadSettings This parameter specifies what should be saved. Valid options are: Constant Value Description flexFileAll 0 Save all data and formatting information. flexFileData 1 Save only the data, ignoring formatting information. flexFileFormat 2 Save only the global formatting, ignoring the data. flexFileCommaText 3 Save data to a comma-delimited text file. flexFileTabText 4 Save data to a tab-delimited text file. flexFileCustomText 5 Save data to a text file using the delimiters specified by the ClipSeparators property. flexFileExcel 6 Save all data and formatting information to an Excel97 file. This filter does not support frozen color rows or columns. Options As Variant (optional) When saving and loading text files, this parameter allows you to specify whether fixed cells are saved and restored. The default is False, which means fixed cells are not saved or restored. When saving and loading Excel files, this parameter allows you to specify the name or index of the sheet to be loaded, or the name of the sheet to be saved. If omitted, the first sheet is loaded. The options for saving fixed rows, columns, and translated combo values include: Constant Value Description flexXLSaveFixedCells 3 Saves fixed cells. flexXLSaveFixedRows 2 Saves fixed rows. flexXLSaveFixedCols 1 Saves fixed columns. flexXLSaveRaw 4 Saves raw (untranslated) data. For example, the options can be written as: fg.SaveGrid "book1.xls", flexFileExcel fg.SaveGrid "book1.xls", flexFileExcel, "sheetName" fg.SaveGrid "book1.xls", flexFileExcel, flexXLSaveFixedCells fg.SaveGrid "book1.xls", flexFileExcel, flexXLSaveFixedRows fg.SaveGrid "book1.xls", flexFileExcel, flexXLSaveFixedCols fg.SaveGrid "book1.xls"

    C / C++ / MFC tutorial question

  • how to save the value/string of CFlexgrid cells as a file onto hard disk?
    V venadder

    The flexgrid has option to save files as CSV. I did it over a year ago, so don't remember the details, but i do remmeber saving files as CSV from Flexgrid. Check the method listings in the help.

    C / C++ / MFC tutorial question

  • dialog button disabled !!!!
    V venadder

    already have event handlers for on click as folows: public: afx_msg void OnBnClickedLbrexitapp(); void CLaunchbar::OnBnClickedLbrexitapp() { // TODO: Add your control notification handler code here }

    C / C++ / MFC help c++ question learning

  • dialog button disabled !!!!
    V venadder

    Hi, I have an MDI MFC VS2005 app. I added a dialog bar in resource view and changed the basze class from CDialog to CDialogBar. I use following code to create the dialogbar. Now it is created fine and it aligns at bottom as intended, but all the buttons on the dialogbar are disabled!!!. What's going on here? int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; EnableDocking(CBRS_ALIGN_ANY); m_launchbar.Create( this, IDD_LAUNCHBAR, CBRS_BOTTOM , IDD_LAUNCHBAR ); } In addition to the above problem the OnShowWindow is fired only when exiting the app and never when the app is started. IMPLEMENT_DYNAMIC(CLaunchbar, CDialogBar) CLaunchbar::CLaunchbar(CWnd* pParent /*=NULL*/) : CDialogBar() { } CLaunchbar::~CLaunchbar() { } void CLaunchbar::DoDataExchange(CDataExchange* pDX) { CDialogBar::DoDataExchange(pDX); DDX_Control(pDX, IDC_LBREXITAPP, m_lbrExitApp); } BEGIN_MESSAGE_MAP(CLaunchbar, CDialogBar) ON_WM_SHOWWINDOW( ) ON_BN_CLICKED(IDC_LBREXITAPP, &CLaunchbar::OnBnClickedLbrexitapp) END_MESSAGE_MAP() // CLaunchbar message handlers void CLaunchbar::OnShowWindow( BOOL bShow, UINT nStatus ) { } void CLaunchbar::OnBnClickedLbrexitapp() { // TODO: Add your control notification handler code here } Any help please?

    C / C++ / MFC help c++ question learning

  • displaying dialog in MDIParent when it's loaded
    V venadder

    A couple fo things: 1. The object was a CDialog so I changed the base class to CDialogBar 2.I used following code m_launchbar->Create( this,IDD_LAUNCHBAR,CBRS_BOTTOM ,IDD_LAUNCHBAR ); this docs the window fine at the bottom without any setting of position and size using the SetWindowPos. Now what happens is every button on the dialogbar is disabled and it took away the WinXp kind of look from the buttons too!!! Any ideas, am reading MSDN too on this. Thanks for your help , it was awesome

    C / C++ / MFC c++ help question

  • set icon for a CButton
    V venadder

    thankx a lot guys. Problem solved. Appreciate the help

    C / C++ / MFC c++

  • how big array size does a visual c++ program allow ?
    V venadder

    i agree, Use heap instead of stack. If you ar ein C++ now, then you won't be really be able to avoid pointers and dynamic allocation.

    C / C++ / MFC help c++ data-structures tutorial question

  • set icon for a CButton
    V venadder

    hi, how will you display an icon on a button(CButton MFC VS2005 ), the icon is in say a fil c:\something.ico

    C / C++ / MFC c++

  • displaying dialog in MDIParent when it's loaded
    V venadder

    how do you dock, actually I am using a dialog bar I thoguht docking was not possible , so i was doign poisitioning and sizing myself.\ how would you suggest I try docking?

    C / C++ / MFC c++ help question

  • displaying dialog in MDIParent when it's loaded
    V venadder

    I did that man. here is the problem first if i get rid of the startup child form, the CGUIView OnInitialUpdate does not even get called, so that code do nothing. Second i have no idea how to use SendMessage but this is what i did: void CQCProGUIView::OnInitialUpdate( ) { LoadLaunchBar( ); } int CQCProGUIView::LoadLaunchBar( ) { m_launchbar = new CLaunchBar( ); m_launchbar->DoModal( ); return 0; } now this what this does is basically the application runs, but i don't seee anything at all( not even main MDi form ). if i replace that with: m_launchbar->ShowWindow( SW_NORMAL); the following assertion fails: BOOL CWnd::ShowWindow(int nCmdShow) { ASSERT(::IsWindow(m_hWnd) || (m_pCtrlSite != NULL)); if (m_pCtrlSite == NULL) return ::ShowWindow(m_hWnd, nCmdShow); else return m_pCtrlSite->ShowWindow(nCmdShow); } :confused:

    C / C++ / MFC c++ help question

  • displaying dialog in MDIParent when it's loaded
    V venadder

    where is this OnInitialUpdate sorry am new to MFC.

    C / C++ / MFC c++ help question

  • displaying dialog in MDIParent when it's loaded
    V venadder

    hey thanks cool ju, that FileNothign worked like a charm. am still trying to show up the dialog thou

    C / C++ / MFC c++ help question

  • save data as csv or excel
    V venadder

    have your data as comma seperated values each row seperated by newline adn then jsut give the file .csv extension. That's how I used to do it.

    C / C++ / MFC c++ question

  • displaying dialog in MDIParent when it's loaded
    V venadder

    Hi, I created a MFC doc/view application. 1. When the main window( the mdi ) is loaded it displays a empty chiled form. I don't want it to display anything. 2.Now I have dialog which i want to dock along the bottom of the parent window when it's displayed. I am really enw and have done readings and stuff onlien but nothing seem to point in right direction. Any pointers towards this? Any help is appreciated Thanks

    C / C++ / MFC c++ help question

  • Really Relly Stuck!!!
    V venadder

    brackets didn't help either. I changed the name of the table to Sections and everything is working fine. Thanks for all you guys help

    Database database help csharp

  • listview control problem
    V venadder

    Yeah this is what am doign currently, I thought there could be soemthing better. Thank You thou.

    Visual Basic question csharp help css
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups