wc3edit.net

United Warcraft 3 map hacking!
It is currently March 29th, 2024, 6:34 am

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: MpqLib Question.
PostPosted: May 5th, 2010, 9:42 pm 
Offline
Super Moderator

Joined: February 3rd, 2009, 11:28 pm
Posts: 2394
I am using MPQLib for a VB.NET application. Its made in C++, but works for any .NET app. ImportFile won't work. Heres some of the code I am using.

Declaring vararchive
Code:
Dim vararchive As New MpqLib.Mpq.CArchive("MY FOLDER\MY ARCHIVE")

Then I can use this to extract a file.
Code:
vararchive.ExportFile(NAME OF FILE IN ARCHIVE", "MY FOLDER\MY DOCUMENT")


This works very well untill I get into the re-importing. I didn't know how to do this, so I opened it in the object browser and found this.
Spoiler:
Code:
Public Sub ImportFile(ByVal FileName As String, ByVal FileData As Byte( ))
    Member of MpqLib.Mpq.CArchive

Summary:
Imports a file to the archive.

[size=150]Thanks to help from fatherspace on chat, I no longer need help on this.[/size]


Parameters:
FileName: The filename to save as in the archive
FileData: The file to import, stored in a buffer


So I think that it should be able to be used like this.
Code:
vararchive.ImportFile("NAME OF IMPORT INTO ARCHIVE", "NAME OF FILE TO BE IMPORTED")


but when it gets to this point I get error
Code:
Unable to import
Code:
IOException was unhandled.

Please tell me what i'm doing wrong!


EXTRA- the mpq lib website
http://home.magosx.com/index.php?topic=77.0

Thanks to fatherspace helping on chat, I no longer need help.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO


Privacy Policy Statement
Impressum (German)