Some simple tips for integrating COM components in. Net apps

Source: Internet
Author: User
The last time I wrote a simple example of calling the fastreport component in my blog, some students may also be using fr for reporting. I don't know how people feel after their experiences?
Here I will not copy some authoritative introductions about com. If you do not understand it at all, this article Article Not suitable for you.
First, let's talk about my feelings about Fr. fr originated from a casual decision of 1997 Russians. in Delphi programming, he found that no report system could meet his current needs, so I plan to do it myself. In 98 years, the author wanted to make a quick response, simple, and script-supported report system named officially. With strong Ole operation skills, the author quickly converted fr into a report component with high intermediate usage in Delphi. I personally don't like Pascal, but naturally I don't like Delphi. my admiration for FR is entirely because the author is from Russia. Program The concept embodied in FR is very unique, and the small component size is also proud of the author. My public demo contains the com-specific components of the fr3.0 series. On its forum, I learned that 4.0 is partially incompatible with 3.0 and has some differences in report definition. Of course, there are some more functions.
It is easy to call COM in. net, but there are many skills to grasp. If you carefully observe the demo, you will find that this is what I want to share with you, because this article uses FR as an example, but it is not limited to Fr, my understanding of FR is roughly a transparent programmers manual and a 5-minute user manual hop reading. I have not used FR as a business template, therefore, I may not be able to address some issues. According to my colleagues, there may be some minor bugs in different operating systems. Therefore, I recommend that you use XP as the user environment.
It took me some time to prepare at noon. The following is the result.

Fastreportservice. instance. showdesigner ( Delegate (Tfrxreport Report) {report. main1_whandle = ( Int ) This . Handle ;},
Null , Getdatasource (), Null , String. Format ( " {0} \ simple list. fr3 " , Application. startuppath ), Null );

fastreportservice. instance. showreport ( null , null , getdatasource (), true , false , null ,< br> string. format ( " {0} \ simple list. fr3 " , application. startuppath);

Fastreportservice. instance. showdesigner ((Int)This. Handle, getdatasource ());

This is a piece in the demo. You can see that the encapsulated. Net call is simple enough. This is a common use case for three scenarios.

Service. customregsvr =   True ;

This switch shows a non-deployment method for com. Run frdemo.exe directly. I hope I can be surprised.

This demo depends on two sets: frlib. dll and regsvrex. dll. The company version is signed. I have provided a version without a signature. Please use it properly.

Download:
Frdemo contains the demo project source code.

After writing this article, I have to go through the resignation procedures. The new company is far away from home, and the subway is crowded. Why is there so much traffic...

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.