This is ALL the code. A fixedtext on a datrawindow - simple right? :unsure: :unsure: :unsure:
// Application : XSharpRuntimeApp1
// File1.prg , Created : 4/3/2019 9:54 AM
// User : Jeff
PARTIAL CLASS DATAWINDOW1 INHERIT DATAWINDOW
PROTECT oDCFixedText1 AS FIXEDTEXT
// User code starts here (DO NOT remove this line) ##USER##
CONSTRUCTOR(oWindow,iCtlID,oServer,uExtra)
LOCAL oFont AS Font
SELF:PreInit(oWindow,iCtlID,oServer,uExtra)
SUPER(oWindow , ResourceID{"DATAWINDOW1" , _GetInst()},iCtlID)
SELF:oDCFixedText1 := FIXEDTEXT{SELF , ResourceID{ DATAWINDOW1_FIXEDTEXT1 , _GetInst() } }
SELF:oDCFixedText1:TextColor := Color{ 255 , 0 , 0 }
oFont := Font{ , 15.75 , "Microsoft Sans Serif" }
oFont:Bold := TRUE
oFont:Italic := TRUE
SELF:oDCFixedText1:Font( oFont )
SELF:oDCFixedText1:HyperLabel := HyperLabel{#FixedText1 , "My First attempt with X#" , NULL_STRING , NULL_STRING}
SELF:Caption := "DataWindow Caption"
SELF:HyperLabel := HyperLabel{#DATAWINDOW1 , "DataWindow Caption" , NULL_STRING , NULL_STRING}
IF !IsNil(oServer)
SELF:Use(oServer)
ENDIF
SELF:PostInit(oWindow,iCtlID,oServer,uExtra)
RETURN
END CLASS
STATIC DEFINE DATAWINDOW1_FIXEDTEXT1 := 100
Error is:
error XS0246: The type or namespace name 'DATAWINDOW' could not be found (are you missing a using directive or an assembly reference?) 4,1 File1.prg XSharpRuntimeApp1
error XS0246: The type or namespace name 'FIXEDTEXT' could not be found (are you missing a using directive or an assembly reference?) 5,1 File1.prg XSharpRuntimeApp1
Compilation failed (2 errors)
WTH could possibly be wrong with this please?
This is just a dummy app, but...
This is just a dummy app, but...
In .Net, usually classes have a namespace and a classname, just in order to group them together and avoid name conflicts. For the VO SDK classes, we have use the namespace "VO", so the class names become "VO.DataWindow", "VO.HyperLabel" etc, this is why the compiel does not find them when you use simply "DataWindow".
One option to solve this, is to just use the new full names. Anotehr is to putt a
USING VO
on top of your .prg files.
But the best solution is to jut enable the "/ins" (use implicit namespace) compiler option (in App properties/Compiler page), which will make the compiler automatically resolve those names for you, so you will not need to change anything in your code.
Since you are porting code from VO, it is probably a good idea to enable most of the options in thsi page, at least the /vo* (and /lb for late binding) options, which make the compiler behavior compatible with that of VO.
Edit: Of course before all that, you must have added references to the VOSDK dlls!
One option to solve this, is to just use the new full names. Anotehr is to putt a
USING VO
on top of your .prg files.
But the best solution is to jut enable the "/ins" (use implicit namespace) compiler option (in App properties/Compiler page), which will make the compiler automatically resolve those names for you, so you will not need to change anything in your code.
Since you are porting code from VO, it is probably a good idea to enable most of the options in thsi page, at least the /vo* (and /lb for late binding) options, which make the compiler behavior compatible with that of VO.
Edit: Of course before all that, you must have added references to the VOSDK dlls!
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
This is just a dummy app, but...
Brilliant. Thanks very much Chris.
Actually that didn't work. I've basically added every .dll file I can find, and it's made it worse. Also I put the compiler options as you suggested, but the error still remains...
error XS0009: Metadata file 'C:cavo28BinSystem Library SDK.DLL' could not be opened -- PE image doesn't contain managed metadata.
error XS0009: Metadata file 'C:cavo28BinWin32 API Library SDK.DLL' could not be opened -- PE image doesn't contain managed metadata.
error XS0009: Metadata file 'C:cavo28BinTerminal Lite SDK.DLL' could not be opened -- PE image doesn't contain managed metadata.
error XS0009: Metadata file 'C:cavo28BinVO28RDD.DLL' could not be opened -- PE image doesn't contain managed metadata.
error XS0009: Metadata file 'C:cavo28SdkVO28SYS.DLL' could not be opened -- PE image doesn't contain managed metadata.
error XS0009: Metadata file 'C:cavo28SdkVO28SQL.DLL' could not be opened -- PE image doesn't contain managed metadata.
error XS0009: Metadata file 'C:cavo28SdkVO28REP.DLL' could not be opened -- PE image doesn't contain managed metadata.
error XS0009: Metadata file 'C:cavo28SdkVO28RDD.DLL' could not be opened -- PE image doesn't contain managed metadata.
error XS0009: Metadata file 'C:cavo28SdkVO28OLE.DLL' could not be opened -- PE image doesn't contain managed metadata.
error XS0009: Metadata file 'C:cavo28SdkVO28ISRV.DLL' could not be opened -- PE image doesn't contain managed metadata.
error XS0009: Metadata file 'C:cavo28SdkVO28INET.DLL' could not be opened -- PE image doesn't contain managed metadata.
error XS0009: Metadata file 'C:cavo28SdkVO28GUI.DLL' could not be opened -- PE image doesn't contain managed metadata.
error XS0246: The type or namespace name 'DATAWINDOW' could not be found (are you missing a using directive or an assembly reference?) 4,1 File1.prg XSharpRuntimeApp1
error XS0246: The type or namespace name 'FIXEDTEXT' could not be found (are you missing a using directive or an assembly reference?) 5,2 File1.prg XSharpRuntimeApp1
Compilation failed (14 errors)
Actually that didn't work. I've basically added every .dll file I can find, and it's made it worse. Also I put the compiler options as you suggested, but the error still remains...
error XS0009: Metadata file 'C:cavo28BinSystem Library SDK.DLL' could not be opened -- PE image doesn't contain managed metadata.
error XS0009: Metadata file 'C:cavo28BinWin32 API Library SDK.DLL' could not be opened -- PE image doesn't contain managed metadata.
error XS0009: Metadata file 'C:cavo28BinTerminal Lite SDK.DLL' could not be opened -- PE image doesn't contain managed metadata.
error XS0009: Metadata file 'C:cavo28BinVO28RDD.DLL' could not be opened -- PE image doesn't contain managed metadata.
error XS0009: Metadata file 'C:cavo28SdkVO28SYS.DLL' could not be opened -- PE image doesn't contain managed metadata.
error XS0009: Metadata file 'C:cavo28SdkVO28SQL.DLL' could not be opened -- PE image doesn't contain managed metadata.
error XS0009: Metadata file 'C:cavo28SdkVO28REP.DLL' could not be opened -- PE image doesn't contain managed metadata.
error XS0009: Metadata file 'C:cavo28SdkVO28RDD.DLL' could not be opened -- PE image doesn't contain managed metadata.
error XS0009: Metadata file 'C:cavo28SdkVO28OLE.DLL' could not be opened -- PE image doesn't contain managed metadata.
error XS0009: Metadata file 'C:cavo28SdkVO28ISRV.DLL' could not be opened -- PE image doesn't contain managed metadata.
error XS0009: Metadata file 'C:cavo28SdkVO28INET.DLL' could not be opened -- PE image doesn't contain managed metadata.
error XS0009: Metadata file 'C:cavo28SdkVO28GUI.DLL' could not be opened -- PE image doesn't contain managed metadata.
error XS0246: The type or namespace name 'DATAWINDOW' could not be found (are you missing a using directive or an assembly reference?) 4,1 File1.prg XSharpRuntimeApp1
error XS0246: The type or namespace name 'FIXEDTEXT' could not be found (are you missing a using directive or an assembly reference?) 5,2 File1.prg XSharpRuntimeApp1
Compilation failed (14 errors)
- Attachments
-
- xsharp problem.pdf
- (75.23 KiB) Downloaded 55 times