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
G

Gavin Jerman

@Gavin Jerman
About
Posts
35
Topics
12
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • C# and IBM WebSphere MQ message borwsing
    G Gavin Jerman

    Replace MQC.MQGMO_BROWSE_FIRST with MQC.MQGMO_BROWSE_NEXT and call Get in a loop until it fails - it will throw a harmless exception with a reason code of MQRC_NO_MSG_AVAILABLE when there are no more messages to browse. I would also suggest that you use MQGMO_NO_WAIT rather than MQGMO_WAIT so that you don't have to wait until a message appears on the queue when you browse an empty queue. Example code using home-brewed helper methods:

    public bool browseMessages(out ArrayList messages, string queue)
    {
    // browse (i.e. get without removing) a message on the message queue
    messages = new ArrayList();
    MQQueueManager mqQM = null;
    MQQueue mqQ = null;

      try
      {
        if (queue == null || queue.Length == 0)
          throw new Exception("Queue name required");
    
        // connect to queue manager
        connectManager(out mqQM);
    
        // open queue with required access
        connectQueue(mqQM, queue, MQC.MQOO\_FAIL\_IF\_QUIESCING + MQC.MQOO\_BROWSE, out mqQ);
    
        // get message options
        MQGetMessageOptions mqGMO = new MQGetMessageOptions();
        mqGMO.Options = MQC.MQGMO\_FAIL\_IF\_QUIESCING + MQC.MQGMO\_NO\_WAIT + MQC.MQGMO\_BROWSE\_NEXT; // browse with no wait
        mqGMO.MatchOptions = MQC.MQMO\_NONE; // no matching required
    
        MQMessage mqMsg = new MQMessage(); // object to receive the message
    
        // browse all messages on the queue
        while (true)
        {
          // browse message - exception will be thrown when no more messages
          mqQ.Get(mqMsg, mqGMO);
    
          // get message text from the message object
          messages.Add(mqMsg.ReadString(mqMsg.MessageLength));
        }
      }
      catch (MQException mqex)
      {
        if (mqex.ReasonCode == MQC.MQRC\_NO\_MSG\_AVAILABLE)
        {
          // harmless exception MQ throws to indicate that there are no messages on the queue
          return true;
        }
        else
          throwMQException(mqex);
      }
      finally
      {
        if (mqQ != null)
          mqQ.Close();
    
        if (mqQM != null)
          mqQM.Disconnect();
      }
    
      return false;
    }
    

    Gavin

    C# question csharp data-structures help tutorial

  • Hard Drive Directory Analyzer
    G Gavin Jerman

    Could it be Jeff Key's FolderSizeBrowser http://www.sliver.com/dotnet/foldersizebrowser/[^]? Gavin

    The Lounge linux question

  • Andrew Schulman diskette ?
    G Gavin Jerman

    I have a folder named 'Unauthorized Windows 95' on my floppy disk CD-ROM archive. The floppy disk has long since disappeared but the folder contains 6 zip files and the readme file says that it's the disk accompanying Unauthorized Windows 95, by Andrew Schulman (IDG Books, 1994). Let me know if you want me to email the files to you - approx 800Kb. Gavin

    The Lounge c++ csharp learning dotnet com

  • Where can I find and download Old Version of Visual Assist!?
    G Gavin Jerman

    I have a copy of the file VA6Setup1106.exe. I could email it to you if you still want it. Gavin

    The Lounge question announcement

  • iPAQ stuff
    G Gavin Jerman

    Hopefully my iPAQ 2210 should be turning up today. Convinced the wife that I needed an iPAQ because I can use it as an WMA/MP3 player and view photos from our Canon Ixus on it - hence the 2210 as it supports both compact flash and SD. My main reason for getting it is I needed a new toy. So, what web sites should I visit to download fun/useful stuff in order to fill it up within 10 minutes of opening the box? Gavin

    The Lounge adobe question

  • VS .NET 2003 BSOD
    G Gavin Jerman

    The latest video drivers and a BIOS update fixed the problem. Gavin

    Visual Studio visual-studio csharp help question

  • TxTextControl (RTF -> PDF)
    G Gavin Jerman

    I'm not sure I understand what you're asking. The control is visual e.g. you can use to write a word processor. It's just that I'm going to use its RTF -> PDF feature rather than its graphical/user interface. Gavin

    The Lounge question com c++ adobe tools

  • TxTextControl (RTF -> PDF)
    G Gavin Jerman

    I hope this is an acceptable programming related question for the lounge. I have an MFC application that uses Word and the Adobe Acrobat PDFWriter to create PDF documents from RTF. This is working ok but the runtime licence costs are high i.e. Word and Adobe Writer, and I've been tasked with finding a cheaper alternative. I've found the TxTextControl [^] which, amongst other things, can create PDF documents from RTF with no runtime licencing costs and requires no printer driver nor additional 3rd party tools. It comes in various flavours, but the professional edition includes an ActiveX control and MFC classes. All this for a reasonable $949. I've downloaded the trial edition and is seems to do what is says on the can. Before I jump in and purchase the full licence, does anyone have any good/bad experience of this control (esp the MFC classes)? Are there any gotchas I should watch out for? Gavin

    The Lounge question com c++ adobe tools

  • MS Action Pack
    G Gavin Jerman

    Yesterday I received my Visual Studio .NET 2003 upgrade. I was only expecting it to include VS .NET CDs but it also came with a box of server CDs. These included Windows 2003 Server, Windows 2k Adv Server, SQLServer 2000 Developer edition and some other CDs that I can't remember. I haven't installed any of these yet, but they look like the full editions and I don't suppose they will require a VS .NET 2002 CD/DVD before installing ;). Not bad for £19 (GBP) :). Gavin

    The Lounge sysadmin question announcement

  • Resource leak?
    G Gavin Jerman

    BoundsChecker v7 is reporting the error 'Argument 2 in ReleaseDC (HDC__ hdc = 0xE00105F5) still contains non default/stock objects.' in the d'tor for CClientDC in the code:

    void CHListBox::updateWidth(LPCTSTR s)
    {
    CClientDC dc(this);
    CFont * f = CListBox::GetFont();
    CFont* pOldFont = dc.SelectObject(f);

    CSize sz = dc.GetTextExtent(s, \_tcslen(s));
    
    dc.SelectObject(pOldFont);
    
    sz.cx += 3 \* ::GetSystemMetrics(SM\_CXBORDER);
    if (sz.cx > width)
    { /\* extend \*/
    	width = sz.cx;
    	CListBox::SetHorizontalExtent(width);
    } /\* extend \*/
    

    }

    I'm fairly confident that there is no leak. Do you agree? Gavin

    C / C++ / MFC help question learning

  • MSXML 3 and escape sequences
    G Gavin Jerman

    I have a problem with a string containing the £ symbol (GB pounds). I can set the text of a child node using m_pXMLDoc->createTextNode(pszText) to a string containing £ chars ok, but if I try to reparse the xml using MSXML e.g. try displaying it in IE it complains about an invalid character i.e. the £. No problem I thought, I'll replace all £ chars with their escape sequence i.e. &#_163; (please ignore the _ - I had to include it to prevent HTML replacing the escape sequence with a £). All appears to work ok e.g. I can reparse the XML with MSXML and display it in IE, but MSXML has escaped my escape sequence i.e. instead of &#_163; the string contains £. How can I stop MSXML doing this to my escape sequence? Or, how can I include a £ char in a string. I have to use MSXML 3, I can't use a DTD/Schema (don't ask) and I can't use a CDATA section (again, don't ask). Any help/advice would be much appreciated. Gavin

    XML / XSL xml help question html database

  • Sweet .NET tool!
    G Gavin Jerman

    5,750,418 bytes / 5,626 KB / 5.48 MB Gavin

    The Lounge csharp com sysadmin linux career

  • Puzzling OnInitialUpdate() behavior for CHtmlView derived class
    G Gavin Jerman

    An off topic question - how did you get your code snippet nicely formatted? Gavin

    C / C++ / MFC html com hosting

  • Is this a genuine memory leak?
    G Gavin Jerman

    BoundsChecker is reporting the following code as a memory leak: void foo() { _bstr_t bstrA; _bstr_t bstrB; bstrA = "Fred"; bstrB = "Wilma"; bstrB = bstrA.copy(); // this causes the leak // this fixes the leak - bstrB = bstrA } At first I thought it was a leak, then I decided it wasn't, now I can't decide! Is it, or isn't it :confused: Gavin

    C / C++ / MFC performance question

  • Free Windows Form Designer
    G Gavin Jerman

    I can't afford a copy of Visual Studio .NET for home use, so I'm trying to learn C# and .NET the cheap (hard) way i.e. the .NET SDK, a text editor and the command prompt. What I'd like to write are some Windows Forms applications, but I can't stand the thought of having to write the form layout by hand. Does anyone know of a free form designer that I can download and use with C#? Gavin

    C# csharp visual-studio winforms question

  • Free Windows Form Designer
    G Gavin Jerman

    I can't afford a copy of Visual Studio .NET for home use, so I'm trying to learn C# and .NET the cheap (hard) way i.e. the .NET SDK, a text editor and the command prompt. What I'd like to write are some Windows Forms applications, but I can't stand the thought of having to write the form layout by hand. Does anyone know of a free form designer that I can download and use with C#? Gavin

    .NET (Core and Framework) csharp visual-studio winforms question

  • Google Labs
    G Gavin Jerman

    I typed Janeway, Tuvok, Paris and Kim using the Large Set. At first I thought it had returned all the popular Voyager crew, but then I realised that it had missed two-of-two - unforgiveable! Gavin

    The Lounge csharp java wcf com

  • MDSN Library Blues
    G Gavin Jerman

    We've only just renewed our subscription after a break of some months. So it's either January 2002 (first of new subscription) or April 2001 (last of old subscription) Gavin

    The Lounge question announcement

  • MDSN Library Blues
    G Gavin Jerman

    Bureaucracy - it hasn't been evaluated and approved by the 'software police' :( Gavin

    The Lounge question announcement

  • MDSN Library Blues
    G Gavin Jerman

    I've just tried installing the Jan 2002 MSDN Library and it failed. It's demanding that I upgrade from IE5.5 to IE6 - this is not an option at work. So, not only does it not integrate with VS6, it's also dictating my IE version. Why does it want/need IE6? Does anyone know of a work around for IE5.5? Gavin

    The Lounge question announcement
  • Login

  • Don't have an account? Register

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