| |

VerySource

 Forgot password?
 Register
Search
View: 4644|Reply: 3

2021-06-02 resource price adjustment, points reward adjustment notice

[Copy link]

11

Threads

68

Posts

4509.00

Credits

Administrator

Rank: 9Rank: 9Rank: 9

Credits
4509.00

 China

Post time: 2021-6-2 10:26:50
| Show all posts |Read mode
In order to better serve the netizens, it also adjusts the resource price and integration rules again in the 2021-06-02 to increase the resource price and integration rules again:

1. Resource prices are adjusted from 5 gold coins to 10 gold coins;
2, points rules added daily blog auto rewards:
[List]
  • User for more than 1 hour online time, as long as it issues a blog that meets the requirements, 10 gold coins in the system automatic reward can be rewarded in real time, and reward a maximum daily;
  • New users in online time, the system will notify the administrator to manually review the reward, usually working time, the audit time is about 5-10 minutes, other time audit time is uncertain;
    [/ List] 3, the original release download resource gains the integration rules unchanged;

    Point rules details, please see: [URL = http://bbs.verysource.com/thread-3625-1-1.html] http://bbs.verysource.com/thread-3625-1-1.html [/ url]
    Has been verified to open blogs, please visit: [URL = http://blog.verysource.com/create_blog.php] http://blog.verysource.com/create_blog.php [/ url]
  • Losing My Religion.
    Reply

    Use magic Report

    0

    Threads

    1

    Posts

    4.00

    Credits

    Newbie

    Rank: 1

    Credits
    4.00

     China

    Post time: 2022-11-19 10:08:42
    | Show all posts
    到底写博客跟积分有什么关系呢?
    Reply

    Use magic Report

    0

    Threads

    1

    Posts

    2.00

    Credits

    Newbie

    Rank: 1

    Credits
    2.00

     China

    Post time: 2023-1-30 16:51:27
    | Show all posts
    可以只写你好博客字样吗?
    Reply

    Use magic Report

    1

    Threads

    2

    Posts

    4.00

    Credits

    Newbie

    Rank: 1

    Credits
    4.00

     Vietnam

    Post time: 2023-10-1 22:21:34
    | Show all posts
    Ribbon Images in Excel 2007/2010 using a Delphi COM DLL

    This problem has been bubbling away for more than a year. I’ve pick it up every now and then tried some fixes, found they didn’t work and put it down again. However last night I found the solution to the whole problem and I want to write it down so others can benefit from this knowledge.

    If you review most of the knowledge on Office Ribbon controls, the examples are always in Visual Studio where some things are done in the background for you. With Delphi you need to understand all the nitty gritty to get the solution working.

    What I’m going to do is describe the solution in pieces and point out the problems I had to over come and why they were a problem.

    First up is to enable your custom Ribbon to ask for images. This is done in two parts. Firstly, by adding a loadImage tag to the customUI element as follows:

    <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="RibbonLoaded" loadImage="GetImage">
    Where GetImage is the name of the call back function in my COM DLL.

    Secondly, we add image tags to the button elements of the custom ribbon as follows:

    <button id="EidolonAbout" label="About" onAction="RibbonClick" image="EidolonAbout" keytip="A" screentip="Display the About dialogue" supertip="This option displays the about dialogue so that you can get Eidolon's version number for support."/>
    Where “EidolonAbout” is the name that will be passed to the GetImage() function.

    Before we get to the GetImage() implementation in the COM DLL, lets make sure we have some images to work with. I prefer to have the images created externally with any package (GIMP or the Borland Image Editor) and put them in a windows resource file using a resource script. Below is a portion of the RC script for these images:

    ...
    EidolonNewQueryImage          ICON "Images\Toolbar Images\EidolonNewQueryImage.ico"
    EidolonNewPivotTableImage     ICON "Images\Toolbar Images\EidolonNewPivotTableImage.ico"
    EidolonEditQueryPivotImage    ICON "Images\Toolbar Images\EidolonEditQueryPivotImage.ico"
    EidolonUpdateQueryPivotImage  ICON "Images\Toolbar Images\EidolonUpdateQueryPivotImage.ico"
    ...
    If you bind this into your project then it will be checked and compiled with your project. This then allow us to load the images from the DLL and not have to maintain additional external files.

    You will notice I’ve used icon files for the images rather than bitmaps. When I tried bitmaps, they didn’t behave the same as in Delphi with the bottom left pixel being used as the transparent colour. There is probably something I’m missing here. As an aside, I’ve added the name “Image” to the end of all the icon files as I have a lot of images in my DLL for different components and so wanted to make sure there were no name clashes.

    So now we come to the tricky bit, the implementation of GetImage().

    First we need to added a method to the COM DLL’s automation class as follows:

      IEidolonAddin = interface(IDispatch)
        ['{25F65BDF-36E0-4A51-B222-8A86AC4CCCCB}']
        Procedure RibbonClick(Const control: IRibbonControl); safecall;
        Procedure RibbonLoaded(Const RibbonUI: IRibbonUI); safecall;
        function GetImage(Const imageName: WideString): IPictureDisp; safecall;
      end;

      IEidolonAddinDisp = dispinterface
        ['{25F65BDF-36E0-4A51-B222-8A86AC4CCCCB}']
        Procedure RibbonClick(Const control: IRibbonControl); DispID 201;
        Procedure RibbonLoaded(Const RibbonUI: IRibbonUI); DispID 202;
        function GetImage(Const imageName: WideString): IPictureDisp; DispID 203;
      end;
    Now I always thought that this information was synchronised with the RIDL file but for me its not. We’ll come to the RIDL file at the end.

    Obviously this then means the method needs to be implemented in the automation class as follows:

        TEidolonAddin = Class(TAutoObject, IUnknown, IDispatch, IEidolonAddin,
          IDTExtensibility2, IRibbonExtensibility)
          ...
        Public
          ...
          Function GetImage(Const imageName: WideString): IPictureDisp; Safecall;
        End;

      Function TEidolonAddin.GetImage(Const imageName: WideString): IPictureDisp;

      Var
        PictureDesc : TPictDesc;

      Begin
        Result := Nil;
        PictureDesc.cbSizeofstruct := SizeOf(PictureDesc);
        PictureDesc.picType := PICTYPE_ICON;
        PictureDesc.hIcon := LoadIcon(HInstance, PWideChar(imageName + 'Image'));
        If PictureDesc.hIcon <> 0 Then
          Case OleCreatePictureIndirect(PictureDesc, ActiveX.IPicture, True, Result) Of
            E_NOINTERFACE: OutputDebugString('Picture NO INTERFACE');
            E_POINTER:     OutputDebugString('Picture NO POINTER');
            S_OK:          OutputDebugString('Picture OK');
          Else
            OutputDebugString('Picture Unknown');
          End;
      End;
    This method is surprisingly simple. It gets the icon images from the DLL resource and and passes this to the OLECreatePictureIndirect method to create the image to be passed to Excel. You will notice that there is some debugging code in here. I needed to step through this code to understand whether the reason the image was not appearing the Excel was because it was not being created in Delphi properly.

    As it happened this code was not the actual problem. The method was called and ran okay but as soon as the execution passed out of the function Excel locked up or AVed depending on whether it was Excel 2007 or 2010. This started me thinking about the definition on the type library element associated with this call.

    I wrongly thought that you only had available the items that were in the drop down lists so my definition was as follows:

    IPicture* _stdcall GetImage([in] BSTR imageName);
    I looked on the internet to see if anyone had posted a solution to this and found a Russian website (Delphi Masters) that had. Unfortunately my Russian is non-existent BUT by methodically looking at the code I found the probably. It was because the above RIDL definition was wrong and it should have been as below.

    HRESULT _stdcall GetImage([in] BSTR imageName, [out, retval] IPictureDisp** aImage);
    I run the code (with at the time very like hope that it would work) and I tried to click on Excel after stepping through the code to see if it was responding and to my supprise there was a little image next to one of my buttons
    Reply

    Use magic Report

    You have to log in before you can reply Login | Register

    Points Rules

    Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

    Quick Reply To Top Return to the list