473,395 Members | 1,577 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,395 software developers and data experts.

Why can't Marshal::GetDelegateForFunctionPointer() work on C++?

After searching and experimentation, I found the note in the remarks section
of the MSDN doc on Marshal::GetDelegateForFunctionPointer
(http://msdn2.microsoft.com/en-us/lib...onpointer.aspx) -

You cannot use this method with function pointers obtained through C++...

Why not?
Oct 20 '06 #1
2 5361
Hi,

"Rory Plaire" <Ro********@discussions.microsoft.comwrote in message
news:0F**********************************@microsof t.com...
After searching and experimentation, I found the note in the remarks
section
of the MSDN doc on Marshal::GetDelegateForFunctionPointer
(http://msdn2.microsoft.com/en-us/lib...onpointer.aspx)
-

You cannot use this method with function pointers obtained through
C++...

Why not?
I guess the documentation is talking about class function pointers. Native
function pointers and class function pointers are of different size and need
different code to be called so they are not compatible.

--
SvenC
Oct 21 '06 #2

"Rory Plaire" <Ro********@discussions.microsoft.comwrote in message
news:0F**********************************@microsof t.com...
After searching and experimentation, I found the note in the remarks
section
of the MSDN doc on Marshal::GetDelegateForFunctionPointer
(http://msdn2.microsoft.com/en-us/lib...onpointer.aspx)
-

You cannot use this method with function pointers obtained through
C++...

Why not?
Calling convention, I would guess. That method probably assumes stdcall,
while C++ uses thiscall except for variable length argument lists which use
cdecl.

It also mentions that you can't use a function pointer to a managed method,
and if you compile your C++ code with /clr then chances are your C++
functions are MSIL (managed).
Nov 7 '06 #3

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

Similar topics

5
by: middletree | last post by:
The site, which is almost finished, is at http://site234.webhost4life.com/crgmdal7/ If you click most of the links in the gold nav bar, they will take you to various places within the site. But...
1
by: Jet | last post by:
Hi all, There is a problem about single sign on not base on SharePoint . There are different web base application in my network group and all of them are not develop by the same technology, such...
2
by: Nathan Pinno | last post by:
Hi, Can anyone tell me if pygame and Tkinter can work together in the same application? I thought I'd better ask before trying it, since both use widgets. Thanks, Nathan Pinno --
0
by: ice godwater via .NET 247 | last post by:
(Type your message here) I created a Web Service with SSL ,my remote WinForm can work well with it ,but the remote WebFrom can't work. -------------------------------- From: ice godwater ...
8
by: Scorpio | last post by:
Hi all, I found the simple program below, no error, no warning. But it can work with no output. Does anyone know why? int main() { 0; }
2
by: aName | last post by:
How can this work ? http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsdragactionclasstopic.asp In Vbasic( see code below) e is pass ByVal so a...
4
by: Jm lists | last post by:
Please help with this script: class ShortInputException(Exception): '''A user-defined exception class.''' def __init__(self,length,atleast): Exception.__init__(self) self.length=length...
0
by: style_craze_cool | last post by:
Hi. I've just started a data processing firm here in Karachi, Pakistan; So we are looking for data processing campaigns we offer 99.5 accuracy & we can even work on credit if your company/firm is...
0
by: Allen | last post by:
Hi Everybody, I would appreciate it if you can give me a hand here. I want to use the code in the coming paragraph to do the following when the "IN" button is clicked (InBtn_Click): 1- Create...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.