Welcome to Dream.In.Code
Getting C# Help is Easy!

Join 95,475 C# Programmers for FREE!. Ask your question and get quick answers from Dream.In.Code experts. There are 971 online right now! We're the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a C# Expert

Register to Make This Box Go Away!


Using .NET/C# in an unmanaged environment

 
Reply to this topicStart new topic

Using .NET/C# in an unmanaged environment, I need to write a COM object for Sharepoint

chrome
post 3 Oct, 2007 - 09:09 AM
Post #1


New D.I.C Head

*
Joined: 3 Oct, 2007
Posts: 2


My Contributions


I am working with MOSS 2007, and need to write a protector (code that interacts directly with WSS). According to the SDK, protectors are written in unmanaged code and registered as COM objects (the sparse examples are in C++). Unfortunately, I don't speak C++; what are my options? I know that you can consume unmanaged code with P/Invoke...
User is offlineProfile CardPM

Go to the top of the page


tody4me
post 3 Oct, 2007 - 10:19 AM
Post #2


livin in a gamers wasteland

Group Icon
Joined: 12 Apr, 2006
Posts: 870



Thanked 1 times

Dream Kudos: 100
My Contributions


and you can write unmanaged code in C#, but you can not write a COM component using C#, to my knowledge. The only two language options that you have are C++ and VB6.


--------------------
"No worries. We always empty the machine when dust starts coming out of the floppy drive." -- Pages of a BOFH Article, circa 1999

Another excellent BOFH excerpt:
"He hangs up, I repatch our phone line to the CEO's humourless PA and he recalibrates himself out of a job."

"A REAL computer has ONE speed and the only powersaving it permits is when you pull the power leads out of the back!" I blurt. "In fact, a REAL computer would have a hole in the front to push trees into and an exhaust pipe out the back for the black smoke to come out of."
User is offlineProfile CardPM

Go to the top of the page

PsychoCoder
post 3 Oct, 2007 - 11:51 AM
Post #3


using Coding.God;

Group Icon
Joined: 26 Jul, 2007
Posts: 6,329



Thanked 19 times

Dream Kudos: 7050

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#

My Contributions


tody4me is correct (to the best of my knowledge anyways) that you canot write a COM object in C#, you can, however, write an object and make it COM Visible, not sure if that helps you though.


--------------------
IPB Image
Facebook | My Blog | My Site | Forums | Rules | Twitter
Syntax_Terror => Friend and fellow code-a-holic. May you rest in piece my friend
User is offlineProfile CardPM

Go to the top of the page

tody4me
post 3 Oct, 2007 - 02:40 PM
Post #4


livin in a gamers wasteland

Group Icon
Joined: 12 Apr, 2006
Posts: 870



Thanked 1 times

Dream Kudos: 100
My Contributions


He's looking for a way to make it an actual COM component. All .net programming languages you can make something com visible.


--------------------
"No worries. We always empty the machine when dust starts coming out of the floppy drive." -- Pages of a BOFH Article, circa 1999

Another excellent BOFH excerpt:
"He hangs up, I repatch our phone line to the CEO's humourless PA and he recalibrates himself out of a job."

"A REAL computer has ONE speed and the only powersaving it permits is when you pull the power leads out of the back!" I blurt. "In fact, a REAL computer would have a hole in the front to push trees into and an exhaust pipe out the back for the black smoke to come out of."
User is offlineProfile CardPM

Go to the top of the page

chrome
post 3 Oct, 2007 - 04:47 PM
Post #5


New D.I.C Head

*
Joined: 3 Oct, 2007
Posts: 2


My Contributions


For some reason, this issue is a little murky to me; I agree that one cannot use C# to write a true COM object, but it seems that using the steps outlined in this msdn article titled "Exposing .NET Framework Components to COM" (http://msdn2.microsoft.com/en-us/library/aa720072(VS.71).aspx) would essentially do the same thing (unmanaged code would treat the wrapped .Net object as a COM object). Will WSS treat a wrapped .Net object as a true COM object?
User is offlineProfile CardPM

Go to the top of the page

PsychoCoder
post 3 Oct, 2007 - 06:14 PM
Post #6


using Coding.God;

Group Icon
Joined: 26 Jul, 2007
Posts: 6,329



Thanked 19 times

Dream Kudos: 7050

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#

My Contributions


@tody4me: Yup, thats why I said "don't know if this will help you much" smile.gif


@chrome: Unfortunately I think you've asked a question I honestly cant answer, I'm not even sure I could BS my way through that one lol


--------------------
IPB Image
Facebook | My Blog | My Site | Forums | Rules | Twitter
Syntax_Terror => Friend and fellow code-a-holic. May you rest in piece my friend
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 7/5/08 03:42AM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month
-->