xsharp.eu • VOXporter - Icon (?naming?) problem - Page 4
Page 4 of 4

VOXporter - Icon (?naming?) problem

Posted: Thu Jul 12, 2018 12:05 pm
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

VOXporter - Icon (?naming?) problem

Posted: Thu Jul 12, 2018 2:03 pm
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

VOXporter - Icon (?naming?) problem

Posted: Thu Jul 12, 2018 2:38 pm
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

VOXporter - Icon (?naming?) problem

Posted: Thu Jul 12, 2018 3:27 pm
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

VOXporter - Icon (?naming?) problem

Posted: Fri Jul 27, 2018 10:10 am
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