VOXporter - Icon (?naming?) problem

This forum is meant for questions and discussions about the X# language and tools
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

VOXporter - Icon (?naming?) problem

Post by Karl-Heinz »

Chris wrote:Hi Karl-Heinz,

The issues that you were seeing were because you used the X# runtime as references in your test app, but also used vulcan's VulcanWinAPI dll, which has references to the vulcan runtime dlls. So for now, until we release the X# SDK dlls that you can use with the X# runtime, if you need to use any vulcan SDK dll, please also use the vulcan rutnime dlls as well. That should take care of the error messages.

Chris
Hi Chris, Wolfgang

finally i got it running with XSharp.core and xsharp.vo. It works when i import the "missing" funcs manually.

_DLL FUNC GetProcAddress(hModule AS PTR, lpProcName AS PSZ) AS PTR PASCAL:KERNEL32.GetProcAddress
_DLL FUNC GetModuleHandle(lpModuleName AS PSZ) AS PTR PASCAL:KERNEL32.GetModuleHandleA

My next idea is to get rid of the VulcanVOWin32APILibrary, which is only required to import the VOStruct _winOSVERSIONINFOEX. But i think it´s better to discuss this in a new thread like "XSharp and using Structures", or are there any docs/samples to study how to do something like:

OSVERSIONINFOEX ver = new OSVERSIONINFOEX();

ver.dwOSVersionInfoSize = (uint)Marshal.SizeOf(ver);
GetVersionEx(ref ver);

in x# ?

regards
Karl-Heinz
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

VOXporter - Icon (?naming?) problem

Post by robert »

Karl-Heinz,

In X# please don't use PSZ in these prototypes. You can type the parameters with STRING and add a ANSI keyword after the function name:

Code: Select all

_DLL FUNC GetProcAddress(hModule AS PTR, lpProcName AS STRING) AS PTR PASCAL:KERNEL32.GetProcAddress ANSI
_DLL FUNC GetModuleHandle(lpModuleName AS STRING) AS PTR PASCAL:KERNEL32.GetModuleHandleA ANSI
And of course also remove String2Psz() from your calls. That is much cleaner.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

VOXporter - Icon (?naming?) problem

Post by Karl-Heinz »

Hi Robert,

In X# please don't use PSZ in these prototypes. You can type the parameters with STRING and add a ANSI keyword after the function name:

Code: Select all

_DLL FUNC GetProcAddress(hModule AS PTR, lpProcName AS STRING) AS PTR PASCAL:KERNEL32.GetProcAddress ANSI
_DLL FUNC GetModuleHandle(lpModuleName AS STRING) AS PTR PASCAL:KERNEL32.GetModuleHandleA ANSI
And of course also remove String2Psz() from your calls. That is much cleaner.
Ok, i´ve changed it. It´s been a quick copy and paste from VO to see if the app runs under the described conditions.

regards
Karl-Heinz
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

VOXporter - Icon (?naming?) problem

Post by Chris »

Hi Karl-Heinz,
Karl-Heinz wrote:
My next idea is to get rid of the VulcanVOWin32APILibrary, which is only required to import the VOStruct _winOSVERSIONINFOEX. But i think it´s better to discuss this in a new thread like "XSharp and using Structures", or are there any docs/samples to study how to do something like:

OSVERSIONINFOEX ver = new OSVERSIONINFOEX();

ver.dwOSVersionInfoSize = (uint)Marshal.SizeOf(ver);
GetVersionEx(ref ver);

in x# ?
Yes, you can use this trick:

Code: Select all

USING System.Runtime.InteropServices
_DLL FUNC GetVersionEx(lpVersionInformation REF _winOSVersionInfoEx) AS LOGIC PASCAL:KERNEL32.GetVersionExA
	
[StructLayoutAttribute(LayoutKind.Sequential)];
STRUCTURE _winOSVersionInfoEx
	EXPORT dwOSVersionInfoSize AS DWORD
	EXPORT dwMajorVersion AS DWORD
	EXPORT dwMinorVersion AS DWORD
	EXPORT dwBuildNumber    AS DWORD
	EXPORT dwPlatformId AS DWORD
	[MarshalAs(UnmanagedType.ByValTStr, SizeConst:=128)];
	EXPORT szCSDVersion AS STRING
	EXPORT wServicePackMajor AS WORD
	EXPORT wServicePackMinor AS WORD
	EXPORT wSuiteMask AS WORD
	EXPORT wProductType AS BYTE
	EXPORT wReserved AS BYTE
END STRUCTURE
	
FUNCTION Start( ) AS VOID
	LOCAL oInfoEx AS _winOSVersionInfoEx
	oInfoEx:dwOSVersionInfoSize := (DWORD)Marshal.SizeOf(oInfoEx)
	
	? GetVersionEx(oInfoEx)
	? oInfoEx:dwMajorVersion
	? oInfoEx:szCSDVersion
RETURN
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

VOXporter - Icon (?naming?) problem

Post by Karl-Heinz »

Hi Chris,

thanks !

It took a while to come back, but climbing the alps and pyrenees has prio 1 these days ;-)

About using structures: i put the pieces together and have opened a new Thread.

regards
Karl-Heinz
Post Reply