I am having this annoying issue when adding and implementing additional externs to my own libraries, as well as hxWidgets and keep getting the error "RegisterClassA" or "RegisterClassW not a member of hx".
I read up on
this StackOverflow issue posted 3 years ago, and followed the steps suggested in the accepted answer, but to no avail, causing the same error regardless of which implementation of "RegisterClass" I undef.
I'm currently using the git version of hxcpp to build projects at the moment, to take advantage of
cpp::Reference.
Now the above StackOverflow issue is about using the "windows.h" include file, but with that said I'm not touching that include due to that very experience. I was creating a separate project earlier attempting to use "windows.h" for creating a native binding for Win32 for learning purposes, but because of this issue I gave up after following that same suggestion.
Below is the code I'm attempting to implement into hxWidgets:
package wx.widgets;
import cpp.ConstCharStar;
@:include("wx/glcanvas.h")
@:unreflective
@:native("cpp::Reference<wxGLCanvas>")
extern class GLCanvas extends GLCanvasImpl {
@:native("new wxGLCanvas") public static function createInstance(parent:Window, id:Int):GLCanvas;
}
@:include("wx/glcanvas.h")
@:unreflective
@:native("wxGLCanvas")
extern class GLCanvasImpl extends Window {
@:native("SetColour") public function setColour(colour:ConstCharStar):Bool;
}
And here is the wrapper:
package hx.widgets;
import wx.widgets.GLCanvas in WxGLCanvas;
class GLCanvas extends Window {
public function new(parent:Window = null, id:Int = -1) {
super();
var canvas:WxGLCanvas = WxGLCanvas.createInstance(parent == null ? cast 0 : parent._ref, id);
_ref = cast canvas;
}
public function setColour(name:String) {
glCanvasRef.setColour(name);
}
private var glCanvasRef(get, null):WxGLCanvas;
private inline function get_glCanvasRef():WxGLCanvas {
return cast _ref;
}
}
Any help would be greatly appreciated.