RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

UOG.DLL In Visual Basic 6

UOG.DLL In Visual Basic 6

Does anyone have any tips on how I'd go about making a shard connection utility using UOG.DLL in Visual Basic 6 instead of C#? This is what it says in the info. file...
Fuction calls in uog.dll

ProcessID UOG_Client_Launch Client*
BOOL UOG_Client_Terminate
BOOL UOG_Client_Resume
DWORD UOG_Client_Patch

* Client may be a dword where 0 is 2d and 1 is 3d or a filepathstring to a uo client.
But how would I tell VB to access the DLL in the first place, and then how would I use it...


....

[code:1]Private Sub Command1_Click()
UOG_Client_Launch Client(0)
End Sub[/code:1]

?

Thanks all
 
Oh yeah, and I tried the following, to no avail:

[code:1]Option Explicit
Private Declare Function Patch Lib "uog.dll" (ByVal UOG_Client_Patch As Integer) As Integer
Private Declare Function Launch Lib "uog.dll" (ByVal UOG_Client_Launch As Integer) As Integer

Private Sub Command1_Click()
UOG_Client_Launch (1)
End Sub[/code:1]
 

Zippy

Razor Creator
There was a C# file packaged with the latest UOG version (written by me) you can use that without much effort in VB.net, 6 on the other hand... well... why are you using vb 6 anyway.
 

psz

Administrator
Why not use the Framework? All new versions of Windows come with it preinstalled, it's included in all current Service Packs, and it's portable...


Besides, anyone running RunUO or Razor will already have it ;->
 
FallsUpStairs said:
I know I saw your script, but I don't want the program to require the .NET framework, which is why I'm using 6.0.

Not all the players on the shard are going to be using the .NET framework. It's more complicated to have to have every player download it. By using this, all I have to do is include the required DLL's with the setup. And telling me that I *should* use .NET isn't helping answer my question.
 
Most new windows versions already have it and its not too hard to install it on a win98 OS or whichever ones didn't come with it...

but heres an answer i guess... you have to import the method from the .dll

look at the UOGDLL.cs and see how C# does it. Translate it to VB
 
I have tried that but I can't get it to run correctly. I'm not good at getting DLL functions.

This is how they did it in the example:

[code:1] [DllImport( "uog.dll", EntryPoint="UOG_Client_Launch", ExactSpelling=true, CallingConvention=CallingConvention.StdCall)]
public static extern int Launch( int client );

[DllImport( "uog.dll", EntryPoint="UOG_Client_Launch", ExactSpelling=true, CallingConvention=CallingConvention.StdCall)]
public static extern int Launch( string clientPath );

[DllImport( "uog.dll", EntryPoint="UOG_Client_Terminate", ExactSpelling=true, CallingConvention=CallingConvention.StdCall)]
public static extern int Terminate();

[DllImport( "uog.dll", EntryPoint="UOG_Client_Patch", ExactSpelling=true, CallingConvention=CallingConvention.StdCall)]
public static extern int Patch();

[DllImport( "uog.dll", EntryPoint="UOG_Client_Resume", ExactSpelling=true, CallingConvention=CallingConvention.StdCall)]
public static extern int Resume();[/code:1]
 
Top