This article holds information about how to write Com program in VC++ and using it VB. Know the importance of building COM components, a program written in one language should be usable through another. That was an elusive dream in a not too distant part. Then Microsoft unveiled COM. And the once elusive dream started becoming a reality. COM revolutionizes the way software is built. COM is powerful and if you want to remain on the cutting edge of technology, COM is the Way to go. This simple program, This may help you for understanding the COM coding and using it in VB
To make it easy programming in COM. Just go through Inside COM and take a look of this program.
The component which I had designed for sample calculator in VC++. In which we can able to do the simple calculation, I had include Binary and Decimal number conversion.
Source code Guidelines
After creating to the ATL object in COM, you insert ATL Dialog and design it. Add the Clicked event to the Button and write the code part of the program.
Coding for Bin numbers :
LRESULT OnClickedButton_Bin(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
Sample coding for the display number One
LRESULT OnClickedButton1(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
Coding for after pressing the equal button :
LRESULT OnClickedButton_Eqa(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
Coding for 1/X calculation :
LRESULT OnClickedButton_OneByX(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
Coding for Dec number :
LRESULT OnClickedButton_Dec(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
After completing the coding part just Build the program. The component is created. After that open the VB insert completing in the program where your need.
1st Step in VB
2nd Step in VB
Without any coding part for calculator your can able to the proper output in the form of VB program.
This is first step which I kept in COM. which lead me to learn more in this subject. So keep trying until you succeed in COM
I am baladevan programmer in VC++ ATL COM for Software Company based in Trichy, India.
I am B.E (Comp Sci.)