Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. OlafBogus

    Loop Through A Table

    Indeed if you can do what you want without iteration via set based commands then that would be preferable due to the performance problems associated with Cursors.
  2. OlafBogus

    Subtracting Hexidecimal

    As Salem says arithmetic in hexadecimal is the same as in decimal. Decimal is base 10, there are 10 symbols 0,1,2,3,4,5,6,7,8,9. 10 in decimal is 1 ten and 0 units, 11 is 1 ten and 1 unit etc… Hexadecimal is exactly the same except its base is 16, there are 16 symbols...
  3. OlafBogus

    Loop Through A Table

    Hi JohnEOasis, sorry if i missunderstand the question but: To loop through a query output table use a cursor. The example below will read each row of an eventsTable reading the EventID,StartDate and EndDate into 3 variables Declare your cursor for the table and the variables to hold your...
  4. OlafBogus

    How do you copy a range?

    With the last post you would need to reset RowOffset to 0 for each new sheet. I really need more coffee :) Sub Summarize() ' ' Summarize Macro ' by Olaf Bogus ' Dim Counter As Long Dim Source As Workbook Dim Dest As Workbook Dim DestSheet As Worksheet Dim RowOffset As...
  5. OlafBogus

    How do you copy a range?

    Quick modification, this will copy each source book to a new sheet in your destination book. Sub Summarize() ' ' Summarize Macro ' by Olaf Bogus ' Dim Counter As Long Dim Source As Workbook Dim Dest As Workbook Dim DestSheet As Worksheet Dim RowOffset As Integer Const...
  6. OlafBogus

    How do you copy a range?

    Sorry. Change the Set Dest = ActiveWorkbook.Worksheets("DB") to Set Dest = ActiveWorkbook.Worksheets(1) O.B
  7. OlafBogus

    How do you copy a range?

    This copies range (B10:O29) from each sheet in the source book to different rows in the destination "DB" worksheet Sub Summarize() ' ' Summarize Macro ' by Olaf Bogus ' Dim Counter As Long Dim Source As Workbook Dim Dest As Worksheet Dim RowOffset As Integer Const Directory...
  8. OlafBogus

    You are subscribed to this thread Adding toolbar to MFC Application

    Hi Takhysis Add to the .h file. CToolBar m_ToolBar; Add to the dlg .cpp file in OnInitDialog() if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !m_wndToolBar.LoadToolBar(IDR_TOOLBAR1)) {...
  9. OlafBogus

    Number of records created during an indefinate timespan

    Hi Mutley, the following select statement will return the count of in T2 that occur between the entries in T1. Tables are T1 Size Recorded 10k 23/09/2008 02:00:00 20k 23/09/2008 10:00:00 30k 23/09/2008 12:00:00 T2 Item AddedAt Item1 23/09/2008 01:00:00 Item2 23/09/2008 06:00:00 Item3...
  10. OlafBogus

    MessageBox in VC++ Windows Form

    The first error is most likely due to the type of variable msg is. Check you arn't mixing managed and unmanaged code. The second is a result of the first. Try... String^ msg("The Message"); string on the managed heap if (MessageBox::Show(msg,"Warning",MessageBoxButtons::OKCancel) ==...
  11. OlafBogus

    Open a Form2 with a Button

    I'll take a look when I get back to me VS2008 box. O.B
  12. OlafBogus

    Open a Form2 with a Button

    add #include "Form2.h" before namespace Form1 { Then in the button handler add something like:- Form2 myForm; if(myForm.ShowDialog() == System::Windows::Forms::DialogResult::OK) { //Do stuff }
  13. OlafBogus

    My second form is undeclared

    Assuming your forms are called Form1 and Form2, add a #include "Form2.h" below the #pragma once in your Form1.h O.B
  14. OlafBogus

    Visual Studio 2003 convert System::String to char array

    you could try char* wch = (char*)(void*)Marshal::StringToHGlobalAns(this->textBox1->Text); //Do stuff with wch Marshal::FreeHGlobal(wch); // dont forget to free the created char*
  15. OlafBogus

    Simple XML writer routine. Need help!

    void AddaNode(ref string xmlString, string nodeName, string value) { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(xmlString); string xPath = string.Format("//{0}",nodeName); XmlNode node = xmlDoc.SelectSingleNode(xPath); if (node != null) { node.InnerXml...
  16. OlafBogus

    binding data to a treeview

    If i understand you correctly I believe that the TreeNodes Tag property is what you are after. Any Object derived type can be assigned to this property. O.B
  17. OlafBogus

    inserting elements to an existing node in XML using c#

    This is just one way of doing it. XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(/*your xml here*/); XmlNode userInputsNode = xmlDoc.SelectSingleNode("system/base/userinputs"); foreach(/*your objecthere*/ in /*your ArrayList here*/) { XmlNode nodeToAdd =...
  18. OlafBogus

    Open File Dialog

    this is how to open a common dialog open/save this is set to open and I have added the *.xtr filter for you. CFileDialog dlg(TRUE/*Open=TRUE Save=False*/,NULL/*Filename Extension*/,"Directory Selection"/*Initial...
  19. OlafBogus

    Using a DLL function in VC++

    You do not need the header file if you are doing dynamic linking. You need only to know the name and signature of the function you want to call. The example below calls a function from myDll.dll called myfunction. myfunction takes and returns an int. //function signature typedef int...
  20. OlafBogus

    MFC -adding extension in Save As

    if tis MFC then something along the lines of... CFileDialog dlg(FALSE,NULL,"Directory Selection",OFN_ENABLESIZING|OFN_EXPLORER|OFN_FILEMUSTEXIST,"Text (*.txt)|*.txt|All Files (*.*)|*.*||",this); if (dlg.DoModal() == IDOK) { CString fileName = dlg.GetFileName(); } the bit I think you are...

Part and Inventory Search

Back
Top