Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2012 Catch: "Invalid Base."

$
0
0
Hi.


I've got this DLL File I'm working with, trying to combine it with a simple VS 2012 GUI, minor good stuff. But I'm sort of at a 'dead end'.

I know the functions inside the DLL file, and the one I'm working on now is;

Code:

sqpUnpack (IntPtr archiveName, IntPtr destFolder);
archiveName – pointer to archive name
destFolder – pointer to destination folder

I've declared it by

Code:

Declare Function unpack Lib "SQPE.dll" Alias "sqpUnpack" (ByRef archiveName As IntPtr, ByRef destFolder As IntPtr)
So in order to do this, I've used

Code:

selected = SelectFileDialog.FileName
 path = selected.ToString().Split("\")
        Dim count As Integer = path.Length
        Dim x As Integer = 0
        ReDim Preserve path(UBound(path) - 1)
        While (x < (count - 1))
            final = final & path(x) & "\"
            x += 1
        End While
        final = final & "_Unpack\"

So final = (selected - Filename+Format) + \_Unpack

These would be strings, for now.

And then, I'm trying to convert them into useable variables for the function inside the DLL file;

Code:

Try
Dim test As IntPtr = New IntPtr(Convert.ToInt32(Marshal.StringToHGlobalAuto(selected), 32))
 Dim test2 As IntPtr = New IntPtr(Convert.ToInt32(Marshal.StringToHGlobalAuto(final), 32))
 unpack(test, test2)
 Catch ex As Exception
 MsgBox(ex.Message())
 End Try

And this results with this;




First time working with VS 2012 & DLL Files, so trying to learn. Anyone got a clue why it's doing this?

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>