Valhalla Legends Forums Archive | General Programming | Re: Smacker (SmackW32.dll) SDK

AuthorMessageTime
Topaz
Can you port the functions to VB6?
December 11, 2005, 2:09 AM
Quarantine
I believe code for displaying .smk files was posted somewhere in the VB6 forum recently (hint: Joe needed help)
December 12, 2005, 8:52 PM
Myndfyr
[quote author=Warrior link=topic=13481.msg137282#msg137282 date=1134420755]
I believe code for displaying .smk files was posted somewhere in the VB6 forum recently (hint: Joe needed help)
[/quote]

No, that was for displaying PCX files.  There was documentation in Bnet BotDev Reference, but that was a link to the smackw32.dll exports documentation, and this topic was split from that post.
December 12, 2005, 10:39 PM
Quarantine
Oh.
December 12, 2005, 11:57 PM
MesiaH
The document is pretty easy to understand. All you need is some graphics knowledge to combine everything. Took me no time at all...
December 22, 2005, 9:42 AM
kamakazie
[quote author=Topaz link=topic=13481.msg138942#msg138942 date=1135307534]
[quote author=Topaz link=topic=13481.msg137152#msg137152 date=1134266940]
Can you port the functions to VB6?
[/quote]
[/quote]

I don't recall him giving the actual source code (can't check, link doesn't work), at least usually SDKs don't. Perhaps you mean the function declarations? MSDN can help.
December 23, 2005, 3:34 AM
Ringo
I dont think Vb6 can call the functions, as there not __stdcall? or are they?
I just get entry point not found, like the function doesnt exist, or the functions dont support stdcalling.

Is this right?
[code]
Smack* SmackOpen(char* name,u32 flags, u32 extrabuf);
[/code]
[code]
Public Declare Function SmackOpen Lib "Smackw32.dll" (PathToSDK As String, InFlag As Long, ExtraSpace As Long) As Long

Dim SDKhdl As Long 'returns handle to the file i presume..
SDKhdl = SmackOpen(App.Path & "\ad000bed.smk", u32flags, u32extrabuf)
[/code]

Its the same for all, it cant find entry point for any of the functions :(.
December 23, 2005, 2:53 PM
Kp
Prototype looks ok, but you need to specify to VB that the calling convention is _cdecl.  Unfortunately, VB doesn't actually support _cdecl.  You could write wrappers around all of them, though.  Make a new C file which exports _stdcall functions which turn around and call the Smacker _cdecl functions, then rebuild the Smacker DLL with those functions included.  Or just get used to using a language which supports more than one calling convention. :)

Also, you might be getting 'function not found' errors if the Smacker code was compiled as C++ code, which would lead to name mangling in the DLL.  If this has occured, you'll need to recompile the DLL without name mangling enabled.
December 23, 2005, 5:08 PM
Ringo
Is smaker open source? i was useing the one from SC directory, i think all the clients use file version 3.0.0
December 24, 2005, 10:33 AM
UserLoser.
[quote author=Ringo link=topic=13481.msg139121#msg139121 date=1135420413]
Is smaker open source? i was useing the one from SC directory, i think all the clients use file version 3.0.0
[/quote]

No
December 24, 2005, 10:35 AM
Ringo
n/m
December 24, 2005, 11:37 AM
Kp
[quote author=Ringo link=topic=13481.msg139121#msg139121 date=1135420413]Is smaker open source? i was useing the one from SC directory, i think all the clients use file version 3.0.0[/quote]

Why should that stop you?  Just add the necessary functions in the end of .text, update the .edata section (which might've been rolled into .rdata if you're unlucky), and you should be good to go.  It'd obviously be easier if you'd picked something which was Free to begin with, but openness is not required for success.
December 24, 2005, 5:38 PM

Search