Author Topic: C++ Interop (Implicit PInvoke)  (Read 2268 times)

0 Members and 1 Guest are viewing this topic.

Paul Richardson

  • Guest
C++ Interop (Implicit PInvoke)
« on: March 31, 2007, 12:09:07 PM »
Hey All -

I am trying to using "acedCoordFromPixelToWorld" from a managed c++ project. I've included the header file as such: #include "C:\ObjectARX 2007\inc\rxmfcapi.h". When building the project I get three errors for every definition in the header similar too:

1>C:\ObjectARX 2007\inc\rxmfcapi.h(68) : error C2143: syntax error : missing ';' before '*'
1>C:\ObjectARX 2007\inc\rxmfcapi.h(68) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\ObjectARX 2007\inc\rxmfcapi.h(68) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

Any hints on what else I need to do?

Thanks - Paul

edit: Guess I should have put this in the net group...?
« Last Edit: March 31, 2007, 05:51:11 PM by Paul Richardson »

It's Alive!

  • BricsCAD
  • Needs a day job
  • Posts: 6940
  • AKA Daniel
Re: C++ Interop (Implicit PInvoke)
« Reply #1 on: April 01, 2007, 01:25:54 AM »
Hi Paul,
I think acedCoordFromPixelToWorld() uses CPoint so you will probably need to load MFC <afxwin.h> .
You will have to get in and play with the compiler settings.
BTY I was able to compile this by using the arx wizard and selecting mix managed/unmanaged
HTH

Paul Richardson

  • Guest
Re: C++ Interop (Implicit PInvoke)
« Reply #2 on: April 01, 2007, 08:37:14 AM »
Hi Paul,
I think acedCoordFromPixelToWorld() uses CPoint so you will probably need to load MFC <afxwin.h> .
You will have to get in and play with the compiler settings.
BTY I was able to compile this by using the arx wizard and selecting mix managed/unmanaged
HTH


Hey Daniel - Including "afxwin.h" to the managed project did the trick. Well it compiles anyway...) Off to play - thanks much!

I wonder if it's better to just use mixed managed/unmanaged instead?

Paul