473,382 Members | 1,407 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Which PInvokes aren't supported in C# or managed code?

I've heard from the CDO team that managed code is unsupported. With a site
like www.pinvoke.net it's possible that I'll easily end up with a faulty
application architecture that will require a rewrite after I write the darn
thing.

I would like to know what are the circumstances that make interop
unsupported (as in CDO), and what other API's aren't supported under PInvoke.

-Chris LaMont

Contact me here:
lamont
(_at__)
dcpromo
(~dot~)
com
Jan 19 '06 #1
6 1269
Chris,
we might be confusing P/Invoke with COM interop here. CDO is a COM Server
for MAPI. You can set a COM -tab reference to the "Microsoft CDO 1.21
Library" (or whatever version you have) and Visual Studio will generate a
Runtime Callable Wrapper for it.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Scottie_do" wrote:
I've heard from the CDO team that managed code is unsupported. With a site
like www.pinvoke.net it's possible that I'll easily end up with a faulty
application architecture that will require a rewrite after I write the darn
thing.

I would like to know what are the circumstances that make interop
unsupported (as in CDO), and what other API's aren't supported under PInvoke.

-Chris LaMont

Contact me here:
lamont
(_at__)
dcpromo
(~dot~)
com

Jan 19 '06 #2
I don't think you heard that. The classes for mail in the
System.Web.Mail namespace use CDO through interop (through reflection) in
order to send mail.

There isn't that much that makes interop unsupported. I would recommend
reading on how interop works, and then you can make the determination for
yourself.

A good place to start is the interop section of the advanced development
issues section of the .NET framework documentation, found at (watch for line
wrap):

http://msdn2.microsoft.com/ms172270(en-US,VS.80).aspx

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Scottie_do" <Sc*******@discussions.microsoft.com> wrote in message
news:95**********************************@microsof t.com...
I've heard from the CDO team that managed code is unsupported. With a
site
like www.pinvoke.net it's possible that I'll easily end up with a faulty
application architecture that will require a rewrite after I write the
darn
thing.

I would like to know what are the circumstances that make interop
unsupported (as in CDO), and what other API's aren't supported under
PInvoke.

-Chris LaMont

Contact me here:
lamont
(_at__)
dcpromo
(~dot~)
com

Jan 19 '06 #3
Thank you, I did confuse Pinvoke with COM Interop. I'll need to study more
so I can see why CDO will not work with C#. Check out
win32.programmer.messaging if you want to read threads about this
incompatibility

-Chris

"Scottie_do" wrote:
I've heard from the CDO team that managed code is unsupported. With a site
like www.pinvoke.net it's possible that I'll easily end up with a faulty
application architecture that will require a rewrite after I write the darn
thing.

I would like to know what are the circumstances that make interop
unsupported (as in CDO), and what other API's aren't supported under PInvoke.

-Chris LaMont

Contact me here:
lamont
(_at__)
dcpromo
(~dot~)
com

Jan 19 '06 #4
Hi,

"Scottie_do" <Sc*******@discussions.microsoft.com> wrote in message
news:95**********************************@microsof t.com...
I've heard from the CDO team that managed code is unsupported.
Probably he meant that they did not solve support question regarding using
the CDO in managed code, not that CDO cannot be used in managed code.
With a site
like www.pinvoke.net it's possible that I'll easily end up with a faulty
application architecture that will require a rewrite after I write the
darn
thing.
Why?
If the function in question is called correctly you should have no problem,
the function would not change, if so all applications that use it would
cease to work.
I would like to know what are the circumstances that make interop
unsupported (as in CDO), and what other API's aren't supported under
PInvoke.


CDO are not part of the Win32 API IIRC, they are COM objects so you can use
them directly in your project by adding a reference to it frmo VS

AFAIK almost all of the API are usable through P/Invoke, not easyly though.
IF you have a very complex structure it's difficult to create a managed
version and marshall it back and forth.
Also IIRC if the API requires a callback you cannot use it , not sure of
this though. anyone care to clarify it?

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Jan 19 '06 #5
Inline
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:ux**************@TK2MSFTNGP14.phx.gbl...
| Hi,
|
| "Scottie_do" <Sc*******@discussions.microsoft.com> wrote in message
| news:95**********************************@microsof t.com...
| > I've heard from the CDO team that managed code is unsupported.
|
| Probably he meant that they did not solve support question regarding using
| the CDO in managed code, not that CDO cannot be used in managed code.
|
| >With a site
| > like www.pinvoke.net it's possible that I'll easily end up with a faulty
| > application architecture that will require a rewrite after I write the
| > darn
| > thing.
|
| Why?
| If the function in question is called correctly you should have no
problem,
| the function would not change, if so all applications that use it would
| cease to work.

Beware the undocumented API's, they can be changed/removed at any time. In
my long carrier I've seen a lot of people calling API's they 'discovered' by
tools like depends etc.., I've seen a lot of code breaking also ;-)
|
| > I would like to know what are the circumstances that make interop
| > unsupported (as in CDO), and what other API's aren't supported under
| > PInvoke.
|
| CDO are not part of the Win32 API IIRC, they are COM objects so you can
use
| them directly in your project by adding a reference to it frmo VS
|

As from W2K on, CDO (cdosys.dll) is part of the OS API set, this is the
component used by System.Web.Mail.
The problem is that there are other CDO's as well, there is CDO 1.21 (and
older versions) and there is the CDO version that comes with exchange server
(the client stuff). All are COM servers, some are "clients type" of COM
server components (they should never be used in server environments like
service, asp.net etc...) others are server style (like cdosys.dll and the
exchange CDO DLL's).

| AFAIK almost all of the API are usable through P/Invoke, not easyly
though.
| IF you have a very complex structure it's difficult to create a managed
| version and marshall it back and forth.
| Also IIRC if the API requires a callback you cannot use it , not sure of
| this though. anyone care to clarify it?
|

Callbacks are no problem AFAIK, the only problem with v1.x is that the
calling convention is stdcall by default (like all callbacks should use in
windows), while some badly written C 'callbacks' are using cdecl. This
problem is solved in v2.0 where you have the possibilty to change the
default from stdcall to cdecl or whatever.

Willy.

Jan 19 '06 #6
I'm trying to read more about callbacks, cdecl and stdcall, because I have no
idea what they are. Any pointers about where I can find more info? I'm
betting they are like a C# delegate.

"Willy Denoyette [MVP]" wrote:
Inline
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:ux**************@TK2MSFTNGP14.phx.gbl...
| Hi,
|
| "Scottie_do" <Sc*******@discussions.microsoft.com> wrote in message
| news:95**********************************@microsof t.com...
| > I've heard from the CDO team that managed code is unsupported.
|
| Probably he meant that they did not solve support question regarding using
| the CDO in managed code, not that CDO cannot be used in managed code.
|
| >With a site
| > like www.pinvoke.net it's possible that I'll easily end up with a faulty
| > application architecture that will require a rewrite after I write the
| > darn
| > thing.
|
| Why?
| If the function in question is called correctly you should have no
problem,
| the function would not change, if so all applications that use it would
| cease to work.

Beware the undocumented API's, they can be changed/removed at any time. In
my long carrier I've seen a lot of people calling API's they 'discovered' by
tools like depends etc.., I've seen a lot of code breaking also ;-)
|
| > I would like to know what are the circumstances that make interop
| > unsupported (as in CDO), and what other API's aren't supported under
| > PInvoke.
|
| CDO are not part of the Win32 API IIRC, they are COM objects so you can
use
| them directly in your project by adding a reference to it frmo VS
|

As from W2K on, CDO (cdosys.dll) is part of the OS API set, this is the
component used by System.Web.Mail.
The problem is that there are other CDO's as well, there is CDO 1.21 (and
older versions) and there is the CDO version that comes with exchange server
(the client stuff). All are COM servers, some are "clients type" of COM
server components (they should never be used in server environments like
service, asp.net etc...) others are server style (like cdosys.dll and the
exchange CDO DLL's).

| AFAIK almost all of the API are usable through P/Invoke, not easyly
though.
| IF you have a very complex structure it's difficult to create a managed
| version and marshall it back and forth.
| Also IIRC if the API requires a callback you cannot use it , not sure of
| this though. anyone care to clarify it?
|

Callbacks are no problem AFAIK, the only problem with v1.x is that the
calling convention is stdcall by default (like all callbacks should use in
windows), while some badly written C 'callbacks' are using cdecl. This
problem is solved in v2.0 where you have the possibilty to change the
default from stdcall to cdecl or whatever.

Willy.

Jan 23 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Knokmans | last post by:
Hi, We are using DB2 ESE on AIX, having most tablespaces DMS on filesystem This has the disadvantage that all data which is read into bufferpools also is read by JFS filesystem paging. On db2...
13
by: Benny | last post by:
Hi, I have something like this: try { // some code } catch // note - i am catching everything now {
4
by: William F. Kinsley | last post by:
My understanding is that when I re-compile a existing MFC application with the /clr switch, that the code generated is managed(with some exceptions) but that the data isn't, i.e. not garbage...
7
by: Gustavo L. Fabro | last post by:
Greetings! Some classes that once compiled without problems on VS 2003 have now problems on VS 2005 Beta 1. I'm talking about a __nogc class that is exported with __declspec(dllexport). The...
12
by: Peter Oliphant | last post by:
At the following link: http://msdn2.microsoft.com/en-us/library/b23b94s7 there is the following quote near the top of the page (pay special attention to the last sentance): "For Visual C++...
2
by: symbol | last post by:
I am having this problem in a managed c++ DLL which mixes managed and unmanaged C/C++ code. I tried to assign value to a struct array nested in another struct. but I can only write to the first...
1
by: Gary | last post by:
I am wondering if .net2 has a handy function to return supported unicode ranges for given font file. I knew GetFontUnicodeRanges() API can do that. But any way to do it directly in managed code? ...
4
by: J055 | last post by:
Hi I get the error: System.InvalidOperationException: The ReadElementContentAsString method is not supported on node type None. Line 267, position 12. when running the following code: ...
4
by: =?Utf-8?B?dmlwZXJ4MTk2Nw==?= | last post by:
We are having an issue with an application we are developing. We have a Legacy COM DLL in C++ that we have converted to Visual Studio 2008. This COM DLL has methods that are calling Managed C#...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.