473,546 Members | 2,244 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1274
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.co m

"Scottie_do " <Sc*******@disc ussions.microso ft.com> wrote in message
news:95******** *************** ***********@mic rosoft.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.programme r.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*******@disc ussions.microso ft.com> wrote in message
news:95******** *************** ***********@mic rosoft.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.mach in AT dot.state.fl.us > wrote
in message news:ux******** ******@TK2MSFTN GP14.phx.gbl...
| Hi,
|
| "Scottie_do " <Sc*******@disc ussions.microso ft.com> wrote in message
| news:95******** *************** ***********@mic rosoft.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.mach in AT dot.state.fl.us > wrote
in message news:ux******** ******@TK2MSFTN GP14.phx.gbl...
| Hi,
|
| "Scottie_do " <Sc*******@disc ussions.microso ft.com> wrote in message
| news:95******** *************** ***********@mic rosoft.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
2232
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 8.1 we used these registry settings DB2_DIRECT_IO=on DB2_STRIPED_CONTAINERS=on
13
3697
by: Benny | last post by:
Hi, I have something like this: try { // some code } catch // note - i am catching everything now {
4
5711
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 collected. I also noticed that when replaced some of the existing MFC dialogs with managed winforms that everything is still running in the same app...
7
2612
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 compiler message is this: VCSelectLibraryForm.cpp ...\Forms\QiForm.h(48) : error C3395: 'TQiForm::GetDotNetMouseButton' :
12
1452
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++ 2005, C++ includes new features for targeting virtual machines with garbage collection, such as the .NET Framework. In a future release, support for...
2
1681
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 element in array, not the others. struct struct2{ int a; int b; };
1
1809
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? Thanks,
4
12121
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: while (reader.Read()) {
4
2220
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# assemblies as pass thru to support legacy applications in an effort to move our code to the new Code base. Our COM Object can be instantiated on Windows...
0
7698
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7947
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7461
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6030
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5080
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3492
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1922
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
747
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.