Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / June 2006

Tip: Looking for answers? Try searching our database.

wrappers to call some C++ code from C#.  

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Zachary Hilbun - 16 Jun 2006 17:00 GMT
I'm tyring to create some wrappers to call some C++ code (below) from C#.
The MSDN documentation is mainly about using COM to do this, but my code is
not COM.  In any case, I can't figure out how to do it.  I've also tried
using SWIG, again with no luck.  Is there any MSDN or internet documentation
that gives a step-by-step process on how to do this?  Does anyone have any
wrapper samples to wrap this kind of function?

class DOTSCENEINTERFACE_API dotSceneLoader : public
Singleton<dotSceneLoader>, public types::progressMaker
{
void load(const Ogre::String &fileName,
   const Ogre::String &groupName,
   SceneManager *pSceneManager,
   RenderWindow *pRWin,
   SceneNode *pRootNode = NULL,
   bool doMaterials = false,
   bool forceShadowBuffers = false,
   bool updateDSInfo = false);
};

===================================================
Zachary Hilbun
Software Consultant       http://www.vianova.com
Via Nova        OpenGL, Open Inventor 3D products, Windows 95/NT
Dallas, Texas       VC++, C#, embedded systems, VxD's
1977 SSII  SRX31185    http://www.inlocalarea.com for gun information
Mattias Sjögren - 16 Jun 2006 19:42 GMT
Zachary,

>Is there any MSDN or internet documentation
>that gives a step-by-step process on how to do this?

Not that I know of. But step 1 is probably to decide what kind of
wrapper you want. The options are

- Functions exported from a DLL, called through P/Invoke
- Wrap it in a COM component, consume wthrough COM interop
- A managed C++ wrapper that exposes managed classes that you can use
directly

Which one to choose depens on a number of factors, including how many
APIs you need to wrap, their complexity, related data types and your
own C++ knowledge.

Mattias

Signature

Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Zachary Hilbun - 16 Jun 2006 20:40 GMT
I was thinking of a managed C++ wrapper

===================================================
Zachary Hilbun
Software Consultant       http://www.vianova.com
Via Nova        OpenGL, Open Inventor 3D products, Windows 95/NT
Dallas, Texas       VC++, C#, embedded systems, VxD's
1977 SSII  SRX31185
http://www.inlocalarea.com for gun information

> Zachary,
>
[quoted text clipped - 14 lines]
>
> Mattias

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.