How to create a C++ dll with Visual Studio?

Following previous post How to create a CLR wrapper of C++ for using in C#, I will continue with C++ project in this post. C++ is not my main programming language anymore in last 10 years but I would like to keep some ‘important’ things (to me) of C++ projects before I have to leave it again in next 5 years for focusing on web development. I would like to spend more time for web development (backend and frontend) where C#, Javascript, HTML and CSS are in a more dominant position. In this post, I’ll write down the steps to create a C++ DLL by Visual Studio. This DLL can again be wrapped by a wrapper like in previous post and consumed in C#.

Continue reading How to create a C++ dll with Visual Studio?

Visual Studio – Shockwave Flash Object not in COM components

Months ago I wrote an article showing how we can play swf in a windows form application by using activex control of Adobe Flash Player. Today I have a small research with memory of swf application and I would like to use my tool SwfToExe to package .swf file to a .exe file. But when I run my exe there is an error telling that something wrong and it can simply not run.
I open Visual Studio project again to check if there is maybe a new version of flash player and it leaded to the incompatibility. But in the “Choose Toolbox Items” I did not see anything which is relevant to Shockwave Flash Object as before.

Where is my ocx? Ok, I just installed new OS. Maybe the flash .ocx was not correctly registered. But how can I register flash .ocx by myself. When I go to Adobe website, I am automatically redirected to site which provides a suitable plug-in for my browser. But I need a standalone flash player so that I can locate ocx file and register it myself. After some searching, I found that there is a standalone flash player http://www.softwarepatch.com/internet/flash.html .

Download and install it, I recognized that the ocx was installed in this folder C:\Windows\SysWOW64\Macromed\Flash (in XP it should be C:\WINDOWS\system32\Macromed\Flash). I happily registered it with the command “regsvr32 Flash10d.ocx” and a dialog jumped out

It is now completely clear that Flash Player does not support Windows 64 bit. I just need a confirmation of Adobe and here is it

http://labs.adobe.com/technologies/flashplayer10/faq.html#flashplayer10FAQ_64-bit04 .

or

http://kb2.adobe.com/cps/000/6b3af6c9.html

So I can conclude now that I can not use Flash Player 10 with Windows 64 bit and my program can not run under Windows 64 bit, too. I think I should find another version of Flash Player which supports OS 64 bits and embed it into my program so that it can run on all Windows.
Update: So that your application can play swf on OS 64 bits, you should specify that your applications only run with 32 bit CPU by setting Platform target to 0x86.

SharePoint, WebPart and Visual Studio = Chaos

I received a new project one week ago.  In this project I should use Visual Studio to create a WebPart Calendar which will be used in SharePoint website. When my chef plans a month for me, I knew that this project must be very complicated. And now I am sure that I am right. :(. If someone uses Outlook Calendar to create an appointment, he may be know how Outlook manages the appointments.  He permits a user to create an appointment and invite the others to participate in. The receiver can decide to participate or not and sends an answer back to the invitor. And with the help of Outlook the invitor knows who will come to his appointment. This function is really comfortable. However this function is still not available in SharePoint calendar. In Sharepoint there is also a calendar which can be synchronized with Outlook. But it doesn’t support to send an invitation directly through website. Therefore I must write a web part to send appointment and manage it.

Last week I can manage to send out an appointment with Outlook format to attendees. But what difficult is that I can not access to the answer of attendees to my invitation. Today after 8 hours working hard I still do not find out why the answer do not come to my incoming email in my virtual server. Tomorrow must be a long day for me. Maybe I must install Visual Studio on the real server and work with it because the real server can “see” the answers of my invitation. It is reget that I still do not know why my virtual system does not work. But I do not have so much time. The dead line comes at the end of month and there is still a lot of things to do. Sometimes man must accept an “resolvable” error as “unresolvable” errors.