Hi,
I'm using director for managing callbacks ( C++ -> C# ) on the
coreCallBacks class ( %feature("director") coreCallbacks; )
I have some problems when the name of a parameter of a virtual method of
the coreCallBacks contains an underscore.
In the following example :
struct coreCallbacks_On3dEngineRedrawnData
{
corePoint3d _eye;
corePoint3d _at;
};
struct coreCallbacksOn3dEngineRedrawnData
{
corePoint3d _eye;
corePoint3d _at;
};
class coreCallbacks
{
public:
coreCallbacks(void);
virtual ~coreCallbacks(void);
virtual void On3dEngineRedrawn(const
coreCallbacks_On3dEngineRedrawnData& data){}
virtual void On3dEngineRedrawn2(const
coreCallbacksOn3dEngineRedrawnData& data){}
}
generates in coreCallbacks.cs
public virtual void On3dEngineRedrawn(coreCallbacks_On3dEngineRedrawnData
data) {
if (this.GetType() == typeof(coreCallbacks))
coreCPPInterfacePINVOKE.coreCallbacks_On3dEngineRedrawn(swigCPtr,
coreCallbacks_On3dEngineRedrawnData.getCPtr(data)); else
coreCPPInterfacePINVOKE.coreCallbacks_On3dEngineRedrawnSwigExplicitcoreCall
backs(swigCPtr,
coreCallbacks_On3dEngineRedrawnSwigExplicitcoreCallbacksData.getCPtr(data))
;
if (coreCPPInterfacePINVOKE.SWIGPendingException.Pending) throw
coreCPPInterfacePINVOKE.SWIGPendingException.Retrieve();
}
public virtual void On3dEngineRedrawn2(coreCallbacksOn3dEngineRedrawnData
data) {
if (this.GetType() == typeof(coreCallbacks))
coreCPPInterfacePINVOKE.coreCallbacks_On3dEngineRedrawn2(swigCPtr,
coreCallbacksOn3dEngineRedrawnData.getCPtr(data)); else
coreCPPInterfacePINVOKE.coreCallbacks_On3dEngineRedrawn3SwigExplicitcoreCal
lbacks(swigCPtr, coreCallbacksOn3dEngineRedrawnData.getCPtr(data));
if (coreCPPInterfacePINVOKE.SWIGPendingException.Pending) throw
coreCPPInterfacePINVOKE.SWIGPendingException.Retrieve();
}
when i compile , i got an error in On3dEngineRedrawn ( C# file ) :
coreCallbacks.cs(47,264): error CS0103: The name
'coreCallbacks_On3dEngineRedrawnSwigExplicitcoreCallbacksData' does not
exist in the current context
if you check the difference between the generated code yo ucan see :
coreCallbacks_On3dEngineRedrawnSwigExplicitcoreCallbacksData vs
coreCallbacksOn3dEngineRedrawnData
I don't know where the "SwigExplicitcoreCallbacks" in the middle comes
from...
The only difference is the underscore in the class name.
William Fulton
code generation (general)
None
Public
|
Date: 2007-08-20 20:40
|
| Field | Old Value | Date | By |
|---|---|---|---|
| status_id | Open | 2007-08-20 20:40 | wsfulton |
| resolution_id | None | 2007-08-20 20:40 | wsfulton |
| assigned_to | beazley | 2007-08-20 20:40 | wsfulton |
| close_date | - | 2007-08-20 20:40 | wsfulton |
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use