CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 13 FirstFirst 1234512 ... LastLast
Results 16 to 30 of 186
  1. #16
    Join Date
    Sep 2002
    Posts
    1,747

    Yvesmeister

    Code:
      STDMETHOD(OnDisconnection)(ext_DisconnectMode RemoveMode, SAFEARRAY * * custom)
      {
        if(bConnected)
        {
          HRESULT hr = CommandButtonEvents::DispEventUnadvise((IDispatch*)m_spButton);
          if (FAILED(hr)) return hr;
    
          bConnected = false;
        }
    
        return S_OK;
      }
    Brilliant! Yves, you've got be one of the kewlest CodeGurus I know of! Props to aio as well!

  2. #17
    Join Date
    May 2000
    Location
    MI - USA
    Posts
    488
    Yves M,

    Great job!!!

    Narayana Murty.

  3. #18
    Join Date
    Sep 2002
    Location
    Belarus - Tirol, Austria
    Posts
    647
    Nice job, Yves!
    Good idea and with all your revisions it will be real nice!

    P.M. Why did U post debug version? It's more than 200 kb, and such people who has not VC++ compiler can't recompile it for release version wich has more less size?
    "UNIX is simple; it just takes a genius to understand its simplicity!"

  4. #19
    Join Date
    Aug 2002
    Location
    Madrid
    Posts
    4,588
    Originally posted by dimm_coder
    Nice job, Yves!
    Good idea and with all your revisions it will be real nice!

    P.M. Why did U post debug version? It's more than 200 kb, and such people who has not VC++ compiler can't recompile it for release version wich has more less size?
    Ups you are right I totally forgot about that when I first posted the program. I'll make the program again and change the first link.

    [ok it is changed now ]
    Last edited by Yves M; November 5th, 2002 at 08:26 AM.
    Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
    Supports C++ and VB out of the box, but can be configured for other languages.

  5. #20
    Join Date
    Sep 2002
    Location
    Singapore
    Posts
    673
    Code:
    int f(float d)
    // Checks whether the number is positive or negative
    {
      if (f > 0) {
        printf("postive\n");
        return 1;
      } else {
        printf("negative or zero\n");
        return -1;
      }
    }
    Hey guys, I had modified Yves's code to add *code* tags and a colour coding for integer and floating point.

    I got a bit of problem here, so I will upload the source later.

    The program is still not fully tested yet. If you found any bugs, please let me know.
    Attached Files Attached Files

  6. #21
    Join Date
    Oct 2001
    Location
    lake of fire and brimstone
    Posts
    1,628
    CBasicNet's exe gives an error when I click on the icon in the tray. [EDIT ]And I forgot to read the first post of Yves explaining how the program works, it probably works indeed. My sincere apologies.[/EDIT]
    Last edited by Simon666; November 5th, 2002 at 08:33 AM.
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞

  7. #22
    Join Date
    Sep 2002
    Location
    Singapore
    Posts
    673
    I just found out that I couldn't use winzip. Maybe it is due to mine is not registered.

    So you have to do it manually.

    Copy the modified source files in the zip to the original source directory. Backup the directory first if you want to retain Yves's original source.

    You may not get used to my colour scheme but that's the keyword colour coding in my VC. So feel free to change the code and colours.
    Attached Files Attached Files

  8. #23
    Join Date
    Sep 2002
    Location
    Singapore
    Posts
    673
    Originally posted by Simon666
    CBasicNet's exe does NOTHING on my computer and gives an error when I click on the icon in the tray.
    I tried it again. it worked fine.

    btw, did you remember copy the source to the clipboard before you click?

  9. #24
    Join Date
    Sep 2002
    Location
    Singapore
    Posts
    673
    Originally posted by Simon666
    CBasicNet's exe gives an error when I click on the icon in the tray. [EDIT ]And I forgot to read the first post of Yves explaining how the program works, it probably works indeed. My sincere apologies.[/EDIT]
    You gave me a big scare, you know.

  10. #25
    Join Date
    Oct 2001
    Location
    lake of fire and brimstone
    Posts
    1,628
    I was afraid the capitals could be misunderstood. I am not shouting or angry you know. I'm never angry when code doesn't work, except when it is mine or when it is formatting my harddisk. Neither is the case. Maybe I should have underlined it and added a couple of smilies. Sorry man, it is my fault. I just saw something interesting to download and never read how to use it in the first post.
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞
    ۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞۞

  11. #26
    Join Date
    Sep 2002
    Location
    Singapore
    Posts
    673
    Originally posted by Simon666
    I was afraid the capitals could be misunderstood. I am not shouting or angry you know. I'm never angry when code doesn't work, except when it is mine or when it is formatting my harddisk. Neither is the case. Maybe I should have underlined it and added a couple of smilies. Sorry man, it is my fault. I just saw something interesting to download and never read how to use it in the first post.

  12. #27
    Join Date
    Aug 2002
    Location
    Madrid
    Posts
    4,588
    Great, CBasicNet
    Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
    Supports C++ and VB out of the box, but can be configured for other languages.

  13. #28
    Join Date
    Aug 2002
    Location
    Madrid
    Posts
    4,588
    By the way, I really like your new avatar, Simon

    Ok, so what's up with the next version ? Well I didn't work on it yesterday, but maybe today I'll finish it. Thanks to a discussion with Gabriel, I decided to scrap the complicated configuration dialog and parse the "parsers" from text files instead. Maybe I don't even need the whole thing about the registry... Hum well

    Actually a small preview of what a configuration file looks like :
    Code:
    #Keywords
    int
    float
    void
    char
    
    #Rules
    //    \n    [-COLOR=green]     [-/COLOR]   1
    /*   */    [-COLOR=green]     [-/COLOR]   3
    "     "     [-COLOR=red]     [-/COLOR]   3  \
    
    #Symbols
    \r   \e
    \t   \w\w
    
    #KeywordColorBegin
    [-COLOR=blue]
    #KeywordColorEnd
    [-/COLOR]
    Of course the COLOR tags don't include the "-", that's just so that it doesn't get parsed by the board.

    The main things are:
    Special characters in the input file
    To be able to specify special characters in the input file, the following tags are used:
    • \n = newline (character 10)
    • \r = carriage return (character 13)
    • \t = tab (character 9)
    • \e = empty character (this ends a string if it appears in a string, or maps an input sequence to nothing. In the example, the carriage return is mapped to nothing)
    • \w = white space (character 32)
    • \# = # (this is used since comments and section starts in the input file begin with #)


    Rules
    The first string in the line is the start string for the rule, the second one the end string. Then comes the start code tag and finally the end code tag. The number (0, 1, 2 or) indicates whether to include the beginning (1) and the end (2) string inside the code tag. For example for the "//" comments its nicer not to include the newline inside the code tag.

    An optional string can be used for escaping the end string. This means that if in a string for example we find a "\", we'll just skip the next character and hence not end the string if it was actually \".

    One limitations is the fact that each rule must have a unique starting string. If two rules have the same one, the first rule will simply take precedence.

    Symbols
    This is the translation of the special symbols. For example here, a tab is converted to two spaces. This only works for one character at a time in the input though.
    Last edited by Yves M; November 5th, 2002 at 10:45 AM.
    Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
    Supports C++ and VB out of the box, but can be configured for other languages.

  14. #29
    Join Date
    Aug 2002
    Location
    Madrid
    Posts
    4,588
    And here it finally is

    Source (30Kb)
    Executable (52Kb)
    Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
    Supports C++ and VB out of the box, but can be configured for other languages.

  15. #30
    Join Date
    Aug 2002
    Location
    Madrid
    Posts
    4,588
    I guess nobody has noticed...

    The version of the Syntax Highlighter with customizable rules is out in the wild !

    So the new things in this version are (some announced before)
    User Interface
    The UI is pretty simple, here is an example what it looks like for default. Since you can change the parsers, you can also change the text that appears on the buttons in the right column.



    Usage is as before. You copy some source code to the clipboard, then left-click on the taskbar icon (or click on the "Parse" button), and then paste the parsed code into vBulletin.

    The active parser is highlighted in blue, so in the picture above you can see that I'm using the C++ for vBulletin parser

    Configuration Files
    The program doesn't come with configuration files and actually doesn't really need them. However if the directory you installed it into is not write protected, it automatically generates default configuration files named "SynHlt.cfg" and four files with an ".scg" extension. The SynHlt.cfg file contains the text that appears on the buttons and the names of the files describing the respective parsers. When the program is loaded, the first parser that appears in SynHlt.cfg is made the default.

    I described the format of the .scg files in the previous post. You can change them to change for example the colors or the list of keywords.

    License Agreement
    By downloading either the program, you accept full responsibility for it. That means that it is as if you had programmed it yourself. So no restrictions at all on copying, modifying, using to drive nuclear power plants, as long as you are aware that all responsibility falls on you
    Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
    Supports C++ and VB out of the box, but can be configured for other languages.

Page 2 of 13 FirstFirst 1234512 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured